iptables nat 端口映射转发
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


//所有从eth0(外网卡)出来的数据包的源地址改成61.99.28.1
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to 61.99.28.1


//将外部服务器的ip访问转到目的ip端口
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 53 -j DNAT --to-destination 1.2.3.4:53

上一篇
下一篇