linux上NAT转发问题,允许转发设置 (linux 开启ip转发)
vim /etc/sysctl.conf 这里是重点 配睁巧置路由转发,路由开启等都要用到悉皮键。
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
修改为
# Controls IP packet forwarding
net.ipv4.ip_forward = 1 允许内置路握槐由
sysctl -p 更新
*nat
:PREROUTING ACCEPT
:POSTROUTING ACCEPT
:OUTPUT ACCEPT
-A PREROUTING -i eth2 -p tcp -m tcp –dportj DNAT –to-destination 192.168.195.28:8080
-A POSTROUTING -j MASQUERADE