美文网首页
Centos x64 6.8 虚拟机克隆过程中MAC地址重复解决

Centos x64 6.8 虚拟机克隆过程中MAC地址重复解决

作者: 师娘哪里去了 | 来源:发表于2019-10-16 15:54 被阅读0次

做虚拟机克隆过程中,会将源中的MAC信息一并克隆过来,新机造成MAC地址冲突问题,查阅资料之后,解决方案如下(亲测可行):

清空网络配置信息中的MAC及UUID,如下:

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
#dhcp or static
BOOTPROTO=dhcp

IPADDR=192.168.0.60
NTSMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1

将BOOTPROTO设置为dhcp,通过dhcp方式获得动态IP

删除70-persistent-net.rules配置文件

rm /etc/udev/rules.d/70-persistent-net.rules

此文件会自动生成。其主要目的为动态获得当前虚机的MAC信息

在源机中将网卡移除

image.png

克隆新机

当克隆新机完成之后,在虚拟机属性中添加网卡
如果需要指定IP,则修改以网络配置文件如下:

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
#dhcp or static
BOOTPROTO=static

IPADDR=192.168.0.60
NTSMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1


#重启网络
[root@localhost ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
                                                           [  OK  ]

齐活~

相关文章

网友评论

      本文标题:Centos x64 6.8 虚拟机克隆过程中MAC地址重复解决

      本文链接:https://www.haomeiwen.com/subject/qprumctx.html