NetworkManager服务是管理和监控网络设置的守护进程,CentOS7更加注重使用NetworkManager服务来实现网络的配置和管理,CentOS7以前是通过network服务管理网络,以后的版本所有网络管理和设置统一由NetworkManager服务来维护。它是一个动态的,事件驱动的网络管理服务。
下面看一下CentOS7中network和NetworkManger的信息吧。注意:区分大小写
[xf@xuexi ~]$ service network status //使用service查看network 已配置设备: lo ens33 当前活跃设备: lo ens33 virbr0 [xf@xuexi ~]$ systemctl status NetworkManager //使用systemctl查看NetworkManger ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) Active: active (running) since 五 2018-09-07 09:28:00 CST; 18min ago Docs: man:NetworkManager(8) Main PID: 803 (NetworkManager) Tasks: 4 CGroup: /system.slice/NetworkManager.service ├─803 /usr/sbin/NetworkManager --no-daemon └─943 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-ens33.pid -lf /var/lib/NetworkManager/dhclien... 9月 07 09:42:25 xuexi dhclient[943]: DHCPREQUEST on ens33 to 192.168.78.254 port 67 (xid=0x6d7c31b8) 9月 07 09:42:25 xuexi dhclient[943]: DHCPACK from 192.168.78.254 (xid=0x6d7c31b8) 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9229] dhcp4 (ens33): address 192.168.78.135 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9235] dhcp4 (ens33): plen 24 (255.255.255.0) 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9236] dhcp4 (ens33): gateway 192.168.78.2 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9236] dhcp4 (ens33): lease time 1800 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): nameserver '192.168.78.2' 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): domain name 'localdomain' 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): state changed bound -> bound 9月 07 09:42:25 xuexi dhclient[943]: bound to 192.168.78.135 -- renewal in 764 seconds. [xf@xuexi ~]$ service NetworkManager status //使用service查看NetworkManger Redirecting to /bin/systemctl status NetworkManager.service ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) Active: active (running) since 五 2018-09-07 09:28:00 CST; 19min ago Docs: man:NetworkManager(8) Main PID: 803 (NetworkManager) Tasks: 4 CGroup: /system.slice/NetworkManager.service ├─803 /usr/sbin/NetworkManager --no-daemon └─943 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-ens33.pid -lf /var/lib/NetworkManager/dhclien... 9月 07 09:42:25 xuexi dhclient[943]: DHCPREQUEST on ens33 to 192.168.78.254 port 67 (xid=0x6d7c31b8) 9月 07 09:42:25 xuexi dhclient[943]: DHCPACK from 192.168.78.254 (xid=0x6d7c31b8) 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9229] dhcp4 (ens33): address 192.168.78.135 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9235] dhcp4 (ens33): plen 24 (255.255.255.0) 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9236] dhcp4 (ens33): gateway 192.168.78.2 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9236] dhcp4 (ens33): lease time 1800 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): nameserver '192.168.78.2' 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): domain name 'localdomain' 9月 07 09:42:25 xuexi NetworkManager[803]: <info> [1536284545.9237] dhcp4 (ens33): state changed bound -> bound 9月 07 09:42:25 xuexi dhclient[943]: bound to 192.168.78.135 -- renewal in 764 seconds. [xf@xuexi ~]$ systemctl status network //使用systemctl查看network ● network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled) Active: active (exited) since 五 2018-09-07 09:28:04 CST; 20min ago Docs: man:systemd-sysv-generator(8) Process: 957 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS) Tasks: 0 9月 07 09:28:03 xuexi systemd[1]: Starting LSB: Bring up/down networking... 9月 07 09:28:04 xuexi network[957]: 正在打开环回接口: [ 确定 ] 9月 07 09:28:04 xuexi network[957]: 正在打开接口 ens33: [ 确定 ] 9月 07 09:28:04 xuexi systemd[1]: Started LSB: Bring up/down networking.
使用CentOS7尽量记住'system status NetworkManager'