1、

vi /etc/sysconfig/network-scripts/ifcfg-eth0

ifcfg-eth0的配置文件里保存了以前的MAC地址,就把这一行***掉在重启网卡


2、

/etc/udev/rules.d/70-persistent-net.rules ***后重启机器

因为这个文件绑定了网卡和mac地址,所以换了网卡以后MAC地址变了,所以不能正常启动,也可以直接编辑这个配置文件把里面的网卡和mac地址修改乘对应的,不过这样多麻烦,直接***重启,它会自动生成个。


3、解决错误:
1. vi  /etc/udev/rules.d/70-persistent-net.rules
    1)注释或去掉原虚拟机eth0所在的行信息
    2)将新生成的eth1所在的行信息中的eth1改为eth0,将此行的新mac地址写入ifcfg-eth0文件对应的mac地址处
2. start_udev
3. service network restart
4. ifconfig -a确认网络信息


实例:

1、vi  /etc/udev/rules.d/70-persistent-net.rules     这个配置文件eth2修改成eth0,eth3修改成eth1

# 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 0x8086:0x1521 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:ea:a7:a3:02:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2

# PCI device 0x8086:0x1521 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:ea:a7:a3:02:1f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"


2. start_udev
3. service network restart
4. ifconfig -a确认网络信息