Linux开启ipv4转发

Linux开启ipv4转发

2017-02-04
Linux

查看IP转发功能的状态,若net.ipv4.ip_forward为0,表示禁止进行ip转发。

1sysctl net.ipv4.ip_forward
2net.ipv4.ip_forward = 0

修改 /etc/sysctl.conf:

1net.ipv4.ip_forward = 1

执行如下命令使修改生效:

1sysctl -p /etc/sysctl.conf
© 2024 青蛙小白
comments powered by Disqus