VMware新克隆的虚拟机CentOS6.6网卡无法启动问题

 

VMware新克隆的虚拟机CentOS6.6网卡无法启动问题

 

虚拟机版本:VMware workstations 11 

系统版本:CentOS  6.6-2.6.32-504.el6.x86_64

参考:

http://lx.wxqrcode.com/post/37.html

http://oldboy.blog.51cto.com/2561410/1363853 

 

 

问题描述:

通过VMware workstations 11 的完全克隆功能快速创建一台版本为CentOS  6.6Linux虚拟机,创建后,

1  启动用ifconfig,发现无只有回环地址127.0.0.1

2  Mac地址及主机名都与源主机相同;

3  service network restart 启动网络服务失败;

 

解决方法:

1.将配置文件70-persistent-net.rules备份,然后清空配置文件

[root@web-nginx network-scripts]# cd  /etc/udev/rules.d/

[root@web-nginx rules.d]# cp  70-persistent-net.rules 70-persistent-net.rules.bak

[root@web-nginx rules.d]#  >70-persistent-net.rules

 

2.将克隆过来的的配置文件ifcfg-eth2备份,然后更改配置文件;删除HWADDRUUID那两行,更改网卡名字为eth0

[root@web-nginx rules.d]# cd  /etc/sysconfig/network-scripts/

[root@web-nginx network-scripts]# cp  ifcfg-eth2 ifcfg-eth2.bak

[root@web-nginx network-scripts]# mv  ifcfg-eth2 ifcfg-eth0

[root@web-nginx network-scripts]# cat  ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=dhcp

 

 

3.reboot重启主机.

注意:这里一定是重启主机,而不是重启服务;

      清空70-persistent-net.rules后,重启主机,系统会自动获取网卡信息,如下:

[root@web-nginx network-scripts]# cat  /etc/udev/rules.d/70-persistent-net.rules

 

# PCI device 0x8086:0x100f (e1000)

SUBSYSTEM=="net",  ACTION=="add", DRIVERS=="?*",  ATTR{address}=="00:0c:29:c9:84:1a", ATTR{type}=="1",  KERNEL=="eth*", NAME="eth0"

4.验证,查看ip地址信息

[root@nginx+keepalive01 ~]# ifconfig

eth0       Link encap:Ethernet  HWaddr  00:0C:29:6C:C9:99 

           inet addr:192.168.116.137   Bcast:192.168.116.255   Mask:255.255.255.0

           inet6 addr: fe80::20c:29ff:fe6c:c999/64 Scope:Link

           UP BROADCAST RUNNING MULTICAST   MTU:1500  Metric:1

           RX packets:924 errors:0 dropped:0 overruns:0 frame:0

           TX packets:163 errors:0 dropped:0 overruns:0 carrier:0

           collisions:0 txqueuelen:1000

           RX bytes:85394 (83.3 KiB)  TX  bytes:21413 (20.9 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:6 errors:0 dropped:0 overruns:0 frame:0

           TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

           collisions:0 txqueuelen:0

           RX bytes:672 (672.0 b)  TX  bytes:672 (672.0 b)


pingwww.baidu.com,也就可以连上CRT了(NAT模式)

[root@nginx+keepalive01 ~]# ping www.baidu.com

PING www.a.shifen.com (61.135.169.121)  56(84) bytes of data.

64 bytes from 61.135.169.121: icmp_seq=1  ttl=128 time=6.67 ms

64 bytes from 61.135.169.121: icmp_seq=2  ttl=128 time=4.60 ms

64 bytes from 61.135.169.121: icmp_seq=3  ttl=128 time=5.85 ms

^C

--- www.a.shifen.com ping statistics ---

3 packets transmitted, 3 received, 0%  packet loss, time 2819ms

rtt min/avg/max/mdev =  4.606/5.713/6.678/0.854 ms

备注:若是内网,选择host-only 仅主机模式,同样的配置方法,验证时可以ping通物理机即可连接CRT

 

 

 

 

 

 

 

 


你可能感兴趣的:(虚拟机,NetWork,克隆,网卡,网络服务)