centos7不能启动网卡报No suitable device found for this connection错误
错误1:
ifup ens33 显示
Error: Connection activation failed: No suitable device found for this connection.
错误2:
systemctl restart network 显示:
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
日志文件/var/log/meesage显示
Sep 20 11:21:52 centos129 NetworkManager[624]: <info> [1505877712.6949] audit: op="connection-activate" uuid="c96bc909-188e-ec64-3a96-6a90982b08ad" name="ens33" result="fail" reason="No suitable device found for this connection."
Sep 20 11:21:52 centos129 network: Bringing up interface ens33: Error: Connection activation failed: No suitable device found for this connection.
Sep 20 11:21:52 centos129 network: [FAILED]
1
2
3
上面报的两个错误
错误1 是mac地址出问题,通命令ip a 找到mac地址
[root@centos128 /]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:87:9d:51 brd ff:ff:ff:ff:ff:ff
inet 192.168.44.128/24 brd 192.168.44.255 scope global ens33
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:42:47:9a:32:9e brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
其中ether 00:0c:29:87:9d:51 就是网卡ens33的mac地址
错误2 是 网卡设备的uuid问题
运行命令发现如下信息
ifup ens33
Error: Connection activation failed: No suitable device found for this connection.
查看脚本ifup 发现错误代码源于如下
echo 'a75'
[ -n "${DEVICE}" ] && is_nm_handling ${DEVICE} && exit 0
echo "[ -n "${DEVICE}" ] && is_nm_handling ${DEVICE} && exit 0"
echo "$UUID"
nmcli con up uuid "$UUID"
运行如下一行命令得得同新的错
nmcli con up uuid "$UUID"
其中 UUID值的生成来于ifup脚本加载的/etc/sysconfig/network-scripts/network-functions脚本,network-functions中的的函数get_uuid_by_config ()
get_uuid_by_config ()
{
dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" 2>/dev/null | awk -F '"' '/string / { print $2 }'
}
修改$1为ifcfg-ens33运行如下
dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/ifcfg-ens33" 2>/dev/null
得到uuid:
string "c96bc909-188e-ec64-3a96-6a90982b08ad"
object path "/org/freedesktop/NetworkManager/Settings/1"
其中c96bc909-188e-ec64-3a96-6a90982b08ad就是dbus-send生成的UUID
那么运行一下
nmcli con up uuid "$UUID"
nmcli con up uuid "c96bc909-188e-ec64-3a96-6a90982b08ad"
会得到如下报错信息
Error: Connection activation failed: No suitable device found for this connection.
解决办法:
配置文件/etc/sysconfig/network-scripts/ifcfg-ens33 中添加正确的mac地址和新的uuid
注意,uuid 不要为空,为空就会运dbus-send生成的UUID,系统生成UUID此时是不可用的(具体什么原因我也不知道的),只随便生成一个UUID就行的
如下
[root@centos129 network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
#BOOTPROTO=dhcp
DEFROUTE=yes
#IPV4_FAILURE_FATAL=no
NAME=ens33
HWADDR="00:0C:29:E6:B5:68"
UUID="c96bc909-188e-ec64-3a96-6a90982b08az"
DEVICE=ens33
ONBOOT=yes
#DNS1=192.168.44.2
BOOTPROTO=static
IPADDR=192.168.44.129
PREFIX=24
GATEWAY=192.168.44.2
#IPV6INIT=no
启动网卡
ifup ens33
ifconfig -a
[root@centos129 network-scripts]# ifconfig -a
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:ae:fe:6c:f6 txqueuelen 0 (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
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.44.129 netmask 255.255.255.0 broadcast 192.168.44.255
inet6 fe80::20c:29ff:fee6:b568 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:e6:b5:68 txqueuelen 1000 (Ethernet)
RX packets 1656 bytes 141293 (137.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1145 bytes 455981 (445.2 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 1 (Local Loopback)
RX packets 6 bytes 600 (600.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 600 (600.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@centos129 network-scripts]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:e6:b5:68 brd ff:ff:ff:ff:ff:ff
inet 192.168.44.129/24 brd 192.168.44.255 scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fee6:b568/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:42:ae:fe:6c:f6 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
centos 7:network: 正在打开接口 ens33: 错误:激活连接失败:No suitable device found for this connection.
解决使用VMware克隆出来的新虚拟机无法联网的问题
一.背景
我们安装好了一个虚拟机,我想做分布式集群,想模拟几台服务器,这时就想直接复制已经有的安装好的虚拟机,这样比较省事,不要在重复的安装虚拟机并配置JAVA环境,省掉做同样的事情,这时直接复制,这样之前配置的JAVA环境都有了。
二.问题
这时我复制好的虚拟机,启动登陆进去(用户名和密码跟之前那台是一样的),修改好IPADDR,然后网卡重启出现问题?
#service network restart
出现问题:Error:No suitable device found: no device found for connection "System eth0" 如图所示:
#ifup eth0
出现: eth0: unknown interface: No such device 这样的问题,网卡都启动不了,出现问题.
三.解决问题
第一步:我们在界面点击Network Adapter Remove删除网卡,如图所示:
第二步:然后添加一个新的网卡,就是点击add,这时跟前面一台的MAC Address 就不一样,如图所示:
第三步: 重新启动虚拟机,然后进入到/etc/udev/rules.d/目录
#cat 70-persistent-net.rules
里面的信息跟我们Network Adapter的MAC Address地址一样,如图所示:
第四步:进入/etc/sysconfig/network-scripts/目录
#vi ifcfg-eth0
把HWADDR修改成Network Adapter的MAC Address地址一样,如图所示:
第五步:重启网卡,这时就能正常启动,如图所示:
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/1306.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~