network重启自动添加默认路由

多网卡为了避免都默认路由,把NetworkManager stop disable(应为该服务会默认为各个网卡添加默认路由)


route add default gw 192.168.215.254 dev bond1

但是手动添加的路由在重启,network 以后会丢失路由


route add default gw 192.168.215.254 dev bond1

添加到/etc/init.d/network末尾即可


每次重启network都会etc/init.d/network所以,默认路由又被添加上去了


添加在/etc/rc.d/rc.local是每次开机以后才能读入



[root@centos5 ~]# diff /etc/rc.d/init.d/network /etc/init.d/network
[root@centos5 ~]# diff /etc/rc.d/init.d/network /etc/init.d/network
[root@centos5 ~]# ll  /etc/rc.d/init.d/network
-rwxr-xr-x. 1 root root 7293 May  3  2017 /etc/rc.d/init.d/network
[root@centos5 ~]# ll /etc/init.d/network
-rwxr-xr-x. 1 root root 7293 May  3  2017 /etc/init.d/network


你可能感兴趣的:(Linux网络)