VMWare克隆linux系统之后,网卡问题

环境:vmware9.0 + RHEL6.4

当linux系统在识别网卡的时候会把mac地址和网卡名称对应起来记录到udev的脚本中,但是VMWare会给我们自动生成虚拟机的mac地址,但是在我们克隆的linux系统中udev脚本中已经记录了原本的mac地址与网卡名称,也就是eth0,但现在克隆过的虚拟机的mac地址已经不再是之前的mac地址了,所以udev就会自动将这个网卡的mac地址对应上网卡eth1(udev会记录所有已经识别的mac地址和网卡的对应关系,网卡名都会+1)kenerl仅仅只识别到了一张网卡,跟网卡名相关的网络配置也就没有发生变化。

解决办法:

1,文件:/etc/udev/rules.d/70-persistent-net.rules

内容:

  1. # This file was automatically generated by the /lib/udev/write_net_rules  
  2. # program, run by the persistent-net-generator.rules rules file.  
  3. #  
  4. # You can modify it, as long as you keep each rule on a single  
  5. # line, and change only the value of the NAME= key.  
  6.   
  7. # PCI device 0x8086:0x100f (e1000)  
  8. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"  
  9.   
  10. # PCI device 0x8086:0x100f (e10000)  
  11. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:46", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"  
将eth0网卡的代码注释掉,然后将eth1改成eth0

  1. # This file was automatically generated by the /lib/udev/write_net_rules  
  2. # program, run by the persistent-net-generator.rules rules file.  
  3. #  
  4. # You can modify it, as long as you keep each rule on a single  
  5. # line, and change only the value of the NAME= key.  
  6.   
  7. # PCI device 0x8086:0x100f (e1000)  
  8. #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"  
  9.   
  10. # PCI device 0x8086:0x100f (e10000)  
  11. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:46", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"  
2,修改:   /etc/sysconfig/network-scripts/ifcfg-eth0

把mac地址改为新的mac地址,即

HWADDR=00:50:56:bc:00:46


#啰嗦一下 : 更改host名称

编辑 /etc/sysconfig/network

[plain]  view plain  copy
 print ? 在CODE上查看代码片 派生到我的代码片
  1. # vi /etc/sysconfig/network  
[plain]  view plain  copy
 print ? 在CODE上查看代码片 派生到我的代码片
  1. NETWORKING=yes  
  2. HOSTNAME= myhostname  
3,reboot系统


转载自:http://blog.csdn.net/zhngjan/article/details/20797777

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值