iptables的端口转发:
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -F -t nat
iptables -t nat -A PREROUTING -p tcp --dport 29001 -d 223.183.181.212 -j DNAT --to 111.83.161.152:29000 (从本机IP29001端口转发到111.83.161.152的2900端口)
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -L -t nat (显示nat转发表规则)
iptables -F -t nat (清除nat表规则)
阅读(777) | 评论(0) | 转发(0) |