VMWare Image Clone Problem: eth0 Renamed As eth1

after cloning a VMWare image I had noticed that my CentOS Linux server renamed eth0 as eth1, eth1 as eth2 and so on. This is due to wrong or duplicate mac address. To fix this problem login to your CentOS Linux server using console and type the following commands:

solution

1、

[root@localhost ~]# cd /etc/udev/rules.d/
[root@localhost rules.d]# ls
40-hplip.rules               69-vmware-vmmouse.rules  90-hal.rules
56-hpmud_support.rules       70-cups-libusb.rules     91-drm-modeset.rules
60-fprint-autosuspend.rules  70-persistent-cd.rules   98-kexec.rules
60-pcmcia.rules              70-persistent-net.rules  99-fuse.rules
60-raw.rules                 90-alsa.rules            99-vmware-scsi-udev.rules
[root@localhost rules.d]# vi 70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1022:0x2000 (pcnet32) (custom name provided by external tool)

# PCI device 0x1022:0x2000 (vmxnet) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8c:cc:4f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

================================================================================================

将上面的从

# PCI device 0x1022:0x2000 (pcnet32) (custom name provided by external tool)

开始的内容,包含下面所有的

# PCI device 0x1022:0x2000 (vmxnet) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8c:cc:4f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

内容删除

保存退出。


2、

[root@localhost rules.d]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:8C:CC:4F  
          inet addr:192.168.10.20  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe8c:cc4f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:481 errors:0 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:37364 (36.4 KiB)  TX bytes:27055 (26.4 KiB)
          Interrupt:19 Base address:0x2024

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
# HWADDR="00:0C:29:C6:16:5D"
HWADDR="00:0C:29:8C:CC:4F"


注意将两处蓝色的地址保存成一致的,然后reboot你的系统就可以将eth1修改成你想设置的名称了



==============================================================

以上内容也适用于修改网卡名称的需求!



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值