Centos7中,預設的網路管理是NetworkManager,NetworkManager在桌面系統中比較好用,對於伺服器,真的沒什麼用,雙網路卡繫結必須停止和禁用NetworkManager服務,還是network比較方便,停用NetworkManager,開啟network。

1
2
3
4
5
6
7
[root@45 ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[root@45 ~]# systemctl enable network
network.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig network on

檢視network是否開機啟動

1
2
3
4
5
6
7
8
9
10
[root@45 ~]# chkconfig --list |grep 3:on
Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.
      If you want to list systemd services use `systemctl list-unit-files`.
      To see services enabled on particular target use
      `systemctl list-dependencies [target]`.
mysql              0:off    1:off    2:on    3:on    4:on    5:on    6:off
network            0:off    1:off    2:on    3:on    4:on    5:on    6:off
shadowsocks        0:off    1:off    2:on    3:on    4:on    5:on    6:off