Linux单网卡NAT
1 iptables -F
2 iptables -F -t nat
3 iptables -P FORWARD DROP
4 iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
5 iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
6 iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j SNAT --to 172.18.130.87
eth0配置双IP:172.18.130.87 192.168.1.1
目录 返回
首页