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

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

修改 /etc/sysctl.conf:

1
net.ipv4.ip_forward = 1

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

1
sysctl -p /etc/sysctl.conf