linux上NAT转发问题,允许转发设置

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 [4174:254308]

:POSTROUTING ACCEPT [0:0]

:OUTPUT ACCEPT [2811:167684]

-A PREROUTING -i eth2 -p tcp -m tcp --dport 8002 -j DNAT --to-destination 192.168.195.28:8080

-A POSTROUTING -j MASQUERADE

COMMIT

你可能感兴趣的:(linux上NAT转发问题,允许转发设置)