解决 Error:No suitable device found: no device found

1、查询当前网卡mac(HWaddr)
yarn004 Desktop]# ifconfig
eth2      Link encap:Ethernet  HWaddr 00:50:56:20:A3:28  
 inet addr:192.168.10.105  Bcast:192.168.10.255  Mask:255.255.255.0
 inet6 addr: fe80::250:56ff:fe20:a328/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 RX packets:27 errors:0 dropped:0 overruns:0 frame:0
 TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:3600 (3.5 KiB)  TX bytes:6372 (6.2 KiB)


lo        Link encap:Local Loopback  
 inet addr:127.0.0.1  Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING  MTU:65536  Metric:1
 RX packets:86 errors:0 dropped:0 overruns:0 frame:0
 TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:6360 (6.2 KiB)  TX bytes:6360 (6.2 KiB)
2、删除/etc/udev/rules.d/70-persistent-net.rules文件中无用网卡记录(更具上面的mac适配)
3、删除/etc/sysconfig/network-scripts/目录下无用的网络配置文件,当前使用的网卡配置ifcfg-Auto_*(网卡名称)
[root@yarn004 network-scripts]# ll
total 228
-rw-r--r--. 1 root root   249 Mar 18  2016 ifcfg-Auto_eth1
-rw-r--r--. 1 root root   249 Jan 15 07:29 ifcfg-Auto_eth3
如果没有ifcfg-Auto开头的文件,手动添加,内容如下
[root@yarn004 network-scripts]# cat ifcfg-Auto_eth3(注意配置mac)
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.10.121
PREFIX=24
GATEWAY=192.168.10.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Auto eth3"
UUID=f6ba1afa-2cf9-4c95-9071-2b3719ba482a
ONBOOT=yes
HWADDR=00:0C:29:65:58:9A
LAST_CONNECT=1484493955
4、重启网卡
server network restart[root@yarn004 network-scripts]# service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface Auto_eth3:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/3
  [  OK  ]

你可能感兴趣的:(linux)