centos7添加多个网段

 # service network restart是重启所有网卡。
例如下面的例子:
>ifconfig eth0 up|down
>service network restart|start|stop
1.前者指定对应网卡后者是所有网卡
2.前者选项有启动和关闭后者有重启选项。
即:前者若要有restart效果,需要 ifconfig eth0 down && ifconfig eth0 up[远程操作需要注意]
3.后者service的操作和前者/sbin下命令操作,权限不同
一些情况下service命令会收给root使用,而普通用户在特定情况下仍可以使用ifconfig。

 ifconfig eth0 192.168.10.130 netmask 255.255.252.0 gw 192.168.8.1 up

参考网址:https://blog.csdn.net/qq_44945035/article/details/89432444

     https://www.cnblogs.com/liujiyu/p/9045575.html

       CENTOS 7 下service network restart失败最全解决方案:https://blog.csdn.net/play_chess_ITmanito/article/details/82423725

     https://zhidao.baidu.com/question/1499456059711395979.html

     https://blog.csdn.net/cpongo3/article/details/93854067

原文地址:https://www.cnblogs.com/jingzaixin/p/11950609.html