centos6.5克隆虚拟机ip地址更改问题解决Bringing up interface eth0: Error: No suitable device found:

当我们通过克隆得到一台虚拟机后,修改IP地址之后重启网卡会报错:

Bringing up interface eth0:  Error: No suitable device found: no device found for connection system eth0'.                  [FAILED]

如何解决呢?我们发现它用的网卡是eth1,此时,我们要如何修改配置文件去进行网络配置呢?

1、修改 /etc/udev/rules.d/70-persistent-net.rules

centos6.5克隆虚拟机ip地址更改问题解决Bringing up interface eth0: Error: No suitable device found:_第1张图片

 我们发现有有两行,我们删掉上面包含“eth0”那段,修改下面的NAME为“eth0”,保存退出。

注意,这里为什么我们删掉第一段修改第二段呢?

因为我们需要让这里的TTR与MAC地址保持一致,我们可以通过虚拟机设置---网络适配器---高级---MAC地址查看:

centos6.5克隆虚拟机ip地址更改问题解决Bringing up interface eth0: Error: No suitable device found:_第2张图片

 2、修改网卡信息:vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:0C:29:D1:14:36   这里需与之前的MAC地址一样
TYPE=Ethernet
UUID=c0bf142f-045e-466f-910b-ef80c9152a2a

ONBOOT=yes
IPADDR=192.168.216.17    修改你自己的IP地址
PREFIX=24
NETMASK=255.255.255.0
GATEWAY=192.168.216.2
DNS1=8.8.8.8
DNS2=114.114.114.114

NM_CONTROLLED=yes
BOOTPROTO=static
DEFROUTE=yes
NAME="System eth0"

 3、重启网卡:service network restart

[root@hadoop02 Desktop]# service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
                                                           [  OK  ]

此时,我们检验一下:

[root@hadoop02 Desktop]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:D1:14:36  
          inet addr:192.168.216.17  Bcast:192.168.216.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed1:1436/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6781 (6.6 KiB)  TX bytes:4825 (4.7 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:16436  Metric:1
          RX packets:96 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4960 (4.8 KiB)  TX bytes:4960 (4.8 KiB)


 

你可能感兴趣的:(Linux)