tips:iptables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tips:iptables [2015/07/21 14:14] – created scipiotips:iptables [2021/10/08 14:50] (current) – removed scipio
Line 1: Line 1:
-====== IPTables ====== 
  
-===== Forward port to another host ===== 
- 
-SNAT and DNAT 
-<code> 
-IPLOCAL=a.b.c.d 
-IPREMOTE=x.y.z.w 
- 
-echo 1 > /proc/sys/net/ipv4/ip_forward 
- 
-iptables -t nat -A PREROUTING -p tcp --dport 33307 -j DNAT --to-destination ${IPREMOTE}:3306 
-iptables -t nat -A POSTROUTING -p tcp -d ${IPREMOTE} --dport 3306 -j SNAT --to-source ${IPLOCAL} 
- 
-</code> 
  • tips/iptables.1437480857.txt.gz
  • Last modified: 2015/07/21 14:14
  • by scipio