linux系统(centos、ubuntu...)这些系统默认都是没有开启路由转发功能的,如果你需要在linux上做路由交换操作,就需要手动开启
开启命令 echo 1 > /proc/sys/net/ipv4/ip_forward
把0改为1就开启成功了如果你重启机器后又变为0,可以把这条命令加入开机自启动
方法二:
修改 /etc/sysctl.conf 文件,添加如下行
net.ipv4.ip_forward = 1
使用 sysctl -p命令生效