centos8 里 systemctl restart network 不能用了
提示找不到network.service模块
因为被networkManager代替了功能,命令变成nmcli了
使用nmcli命令重启网络或者重启网卡
[root@C8-3 ~]# nmcli n off && nmcli n on
[root@C8-3 ~]# nmcli c down eth0 && nmcli c up eth0
[root@C8-3 ~]# ifdown eth0 && ifup eth0
ifdown / ifup 其实也是调用nmcli的脚本,类似于别名
你也可以用图形界面来修改网卡配置
直接敲nmtui就进入图形界面了!
奶奶个熊猫的,我把networkManager停用了,然后就ssh不上了,进后台看,网都没有了。
又给改回来了。