The VM uses the cloned Vm and the NIC name is eth1. To change eth1 to eth0, follow these steps:
View the MAC address of eth1
Ifconfig
For example, eth1: 00: 0C: 29: 74: F2: 99
Change the MAC address of/etc/sysconfig/network-scripts/ifcfg-eth0 to the MAC address of eth1
Since the VM is cloned, there is no eth1 file under the network-scripts directory, there is a ifcfg-eth0 under the directory, the modification is as follows:
Hwaddr is changed from the original Mac to the MAC of eth1 and saved.
Device = eth0
Hwaddr = 00: 0C: 29: 74: F2: 99
Onboot = Yes
Ipaddr = 192.168.198.10
Bootproto = none
Netmask = 255.255.255.0
Type = Ethernet
Gateway = 192.198.198.2
3. Modify the/etc/udev/rules. d/70-persistent-net.rules file.
ATTR {address} and name fields
[[Email protected] rules. d] # Cat 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)
# Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 55: 61: 94 ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth0"
# PCI device 0x1022: 0x2000 (pcnet32)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 74: F2: 99 ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth0"
[[Email protected] rules. d] #
4. restart the system
This article comes from "even if it is wrong, let me make a mistake to death !" Blog, please be sure to keep this source http://hxw168.blog.51cto.com/8718136/1571255
Basic settings: Modify the NIC device name.