table of Contents
I. Description of the problem
Sample virtual machine configured with two network cards, eth0, eth1, after use vmvare cloned virtual machine, the virtual machine replication, no card eth0, eth1, but a eth2, eth3, as follows:
Second, Analysis
Replication system NIC mac address has changed, but still retain the information /etc/udev/rules.d/70-persistent-net.rules old card, the new card will increase from eht1 the Internet, it is recognized as eth2 , eth3
Third, the solution:
Summarize the steps:
1. Check and modify /etc/udev/rules.d/70-persistent-net.rules file name card and reboot the system
2.modprobe -r e1000 uninstall module card
3.modprobe e1000 reload the card module
4. Modify the / etc / sysconfig / network-scrcipts NIC configuration file (so that the card format ifcfg- name)
5. Restart card services service network restart
Specific steps are as follows:
1. Check and modify the file name of the NIC /etc/udev/rules.d/70-persistent-net.rules
Delete the original error eth0 and eth1 configuration information, and modify the NAME = "eth2" is NAME = "eth0", NAME = "eth3" is NAME = "eth1", as shown below
[root@localhost Desktop]# vim /etc/udev/rules.d/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 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b5:69:fc", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b5:69:06", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
reboot reboot the system, the configuration file to take effect
2, modprobe -r e1000 uninstall module card
[root@localhost Desktop]# modprobe -r e1000
3, modprobe e1000 reload the card module
[root@localhost Desktop]# modprobe e1000
4, edit / etc / sysconfig / network-scrcipts network card profile
Modify eth0, mac address of eth1 profile with the 70-persistent-net.rules corresponding to:
[root@localhost Desktop]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0c:29:b5:69:fc #修改为正确的mac地址
TYPE=Ethernet
UUID=9dcce425-39a0-477e-afa2-bf1a2d5615af
ONBOOT=yes # 修改为开机启动
NM_CONTROLLED=yes
BOOTPROTO=dhcp
[root@localhost Desktop]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:0c:29:b5:69:06
TYPE=Ethernet
UUID=99037241-ffe5-4de7-8ca0-64ae19f30bd5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
5, Network Service Restart
[root@localhost Desktop]# service network restart # 重启网络服务
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/9
state: activated
Connection activated
[ OK ]
View network information
[root@localhost Desktop]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:B5:69:FC
inet addr:192.168.57.129 Bcast:192.168.57.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb5:69fc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:272 errors:0 dropped:0 overruns:0 frame:0
TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17170 (16.7 KiB) TX bytes:14884 (14.5 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:B5:69:06
inet6 addr: fe80::20c:29ff:feb5:6906/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:17700 (17.2 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:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:960 (960.0 b) TX bytes:960 (960.0 b)
It found that the amendment is successful, completed
2019-10-23 00:01:32