After configuring the virtual machine, we want to reuse the configurations of the first virtual machine, so we will use the cloning method, but with this convenience, there is a disadvantageous problem, that is, after cloning, the virtual The problem of the network card of the machine is as follows:
After cloning,
ifconfig -a
Solution:
vim etc/udev/rules.d/70-persistent-net.rules
- Delete the content of the first network card eth0, and modify the name of the above eth1 network card to eth0, as follows:
- Modify the mac address of eth0 (eth0 here is the name after eth1 was changed just now)
vim etc/sysconfig/network-scripts/ifcfg-eth0
Change HWADDR: HWADDR="00:0c:29:dc:e4:c9"
- Restart the virtual machine, execute
reboot
- implement
ifup eth0
- Configure static ip address:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
IPADDR=192.168.0.X
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
service network restart