# vi /etc/sysctl.conf
添加如下代码:
net.ipv4.ip_forward=1
重启network服务
# systemctl restart network
查看是否修改成功
# sysctl net.ipv4.ip_forward
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
# vi /etc/sysctl.conf
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1