Differences
This shows you the differences between two versions of the page.
tips:iptables [2015/07/21 14:14] – created scipio | tips:iptables [2021/10/08 14:50] (current) – removed scipio | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== IPTables ====== | ||
- | ===== Forward port to another host ===== | ||
- | |||
- | SNAT and DNAT | ||
- | < | ||
- | IPLOCAL=a.b.c.d | ||
- | IPREMOTE=x.y.z.w | ||
- | |||
- | echo 1 > / | ||
- | |||
- | iptables -t nat -A PREROUTING -p tcp --dport 33307 -j DNAT --to-destination ${IPREMOTE}: | ||
- | iptables -t nat -A POSTROUTING -p tcp -d ${IPREMOTE} --dport 3306 -j SNAT --to-source ${IPLOCAL} | ||
- | |||
- | </ |