[root@centos8 ~]# service network status
Redirecting to /bin/systemctl status network.service
Unit network.service could not be found.
[root@centos8 ~]# systemctl status network.service
Unit network.service could not be found.
[root@centos8 ~]# systemctl status network
Unit network.service could not be found.
[root@centos8 ~]# systemctl restart network
Failed to restart network.service: Unit network.service not found.
装上centos8后,配置好静态ip,想重启网络发现,之前centos7上的命令都不好使了
报错如上边那样
一查资料发现是由于 centos8 已经替换了原来的network, 新版的叫:NetworkManager
这个工具可了不得,好用的一批,尤其是wifi相关的,
所以用这个命令就可以重启了 systemctl restart NetworkManager
[root@centos8 ~]# systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-10-15 22:20:43 CST; 9min ago
Docs: man:NetworkManager(8)
Main PID: 7299 (NetworkManager)
Tasks: 3 (limit: 11357)
Memory: 6.8M
CGroup: /system.slice/NetworkManager.service
└─7299 /usr/sbin/NetworkManager --no-daemon