linux添加静态路由

  

 

  1. /etc/sysconfig/network-scripts/route-eth0
    ip/prefix via ip

  2. /etc/rc.d/rc.local
    ip route add 10.1.1.0/24 via 192.168.1.1 dev eth0 proto static metric 100
    chmod +x /etc/rc.d/rc.local

     

  3. /etc/sysconfig/network 添加的是默认网关   
    GATEWAY=IP

 

posted @ 2021-04-16 10:56  ascertain  阅读(294)  评论(0编辑  收藏  举报