iptables转发备忘

iptables -F

sysctl net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8766 -j DNAT --to 172.16.14.17:8766

iptables -t nat -A PREROUTING -p udp -i eth0 --dport 8766 -j DNAT --to 172.16.14.17:8766

sudo iptables -t nat -A POSTROUTING -j MASQUERADE

posted @ 2017-12-05 15:43  麦兜爱学习  阅读(129)  评论(0编辑  收藏  举报