启用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

 

posted on 2022-11-25 18:12  属于我的梦,明明还在  阅读(1225)  评论(0)    收藏  举报