CentOS7 虚拟机还原后无法访问网络,启用 ens33 抛出 No suitable device found for this connection 错误

本文将介绍怎样处理 CentOS7 通过 ifup ens33 启用网卡抛出 “错误:连接激活失败:No suitable device found for this connection (device lo not available because device is strictly unmanaged).” 错误信息。

错误场景

# 切换到 root 用户
[hxstrive@localhost ~]$ su
密码:

# 开启 ens33 网卡
[root@localhost hxstrive]# ifup ens33
错误:连接激活失败:No suitable device found for this connection (device lo not available because device is strictly unmanaged).

解决办法

(1)永久关闭 NetworkManager 托管工具,如下:

[root@localhost hxstrive]# chkconfig NetworkManager off
注意:正在将请求转发到“systemctl disable NetworkManager.service”。
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

(2)设置每次开机自动启动 NetworkManager 服务,如下:

[root@localhost hxstrive]# chkconfig network on

(3)停止 NetworkManager 服务,如下:

[root@localhost hxstrive]# service NetworkManager stop
Redirecting to /bin/systemctl stop NetworkManager.service

(4)启动 network 服务,如下:

[root@localhost hxstrive]# service network start
Starting network (via systemctl):                          [  确定  ]

(5)查看 ip 信息,如下:

[root@localhost hxstrive]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.116.130  netmask 255.255.255.0  broadcast 192.168.116.255
        inet6 fe80::20c:29ff:fe8e:419b  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:8e:41:9b  txqueuelen 1000  (Ethernet)
        RX packets 16  bytes 2076 (2.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35  bytes 5435 (5.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2  bytes 108 (108.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 108 (108.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:ed:90:d1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

到这里,问题就解决了……

一寸光阴一寸金,寸金难买寸光阴。——《增广贤文》
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号