[root@server1 nginx]# vim /etc/sysctl.conf
在最后一段添加net.ipv4.ip_forward=1
[root@server1 nginx]# sysctl -p
net.ipv4.ip_forward = 1
[root@server1 nginx]# service network restart 重启网卡
[root@server1 nginx]# systemctl restart docker 重启docker
[root@server1 nginx]# vim /etc/sysctl.conf
在最后一段添加net.ipv4.ip_forward=1
[root@server1 nginx]# sysctl -p
net.ipv4.ip_forward = 1
[root@server1 nginx]# service network restart 重启网卡
[root@server1 nginx]# systemctl restart docker 重启docker