启用IP路由转发功能: 1) #echo 1 > /proc/sys/net/ipv4/ip_forward 2) #sysctl -w net.ipv4.ip_forward=1 以上两种方法都可能立即开启路由功能,但如果系统重启,或执行了 #systemctl restart network
永久保留配置,可以修改/etc/sysctl.conf文件将 net.ipv4.ip_forward=0改为net.ipv4.ip_forward=1sed -i '/net.ipv4.ip_forward/ s/\(.*= \).*/\11/' /etc/sysctl.conf
systemctl restart network
标签:sysctl,ip,开启,ipv4,转发,forward,net,IPV4 From: https://www.cnblogs.com/libruce/p/16925987.html