centos7上开启路由转发
echo "1" > /proc/sys/net/ipv4/ip_forward
2.永久开启,(写入内核)
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p ----加载,使得配置文件立即生效
检查:
sysctl -a |grep "ip_forward"
------->
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0
net.ipv4.ip_forward_use_pmtu = 0