700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > centos8重启网卡命令nmcli

centos8重启网卡命令nmcli

时间:2019-03-28 06:03:22

相关推荐

centos8重启网卡命令nmcli

centos8没法用systemctl restart networkservice restart network

方法:nmcli c reload +网卡名

查询网卡名

[root@localhost ~]# ifconfigenp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 192.168.0.168 netmask 255.255.255.0 broadcast 192.168.0.255inet6 fe80::adb4:388c:4129:ad4c prefixlen 64 scopeid 0x20<link>ether 08:00:27:9e:c4:42 txqueuelen 1000 (Ethernet)RX packets 33853 bytes 2474817 (2.3 MiB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 120 bytes 22832 (22.2 KiB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10<host>loop txqueuelen 1000 (Local Loopback)RX packets 12 bytes 1020 (1020.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 12 bytes 1020 (1020.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

可以看到网卡名为enp0s3

重启命令可以这样使用

例:nmcli c reload enp0s3

如果不行,可尝试以下命令

重载所有ifcfg或route到connection(不会立即生效)

nmcli c reload ifcfg-xxx

重载指定ifcfg或route到connection(不会立即生效)

nmcli c load /etc/sysconfig/network-scripts/ifcfg-enp0s3nmcli c load /etc/sysconfig/network-scripts/route-enp0s3

立即生效connection,有3种方法

nmcli c up enp0s3nmcli d reapply enp0s3nmcli d connect enp0s3

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。