设置固定IP
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:70:21:6D
TYPE=Ethernet
UUID=7f0205b7-cdd2-4064-aeea-d2bab552c6ee
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.16.2.160
NETMASK=255.255.255.0
DNS1=****(局域网默认DNS)
DNS2=8.8.8.8
GATEWAY=172.16.2.1
eth0变成eth0
当虚拟机复制到另外一个Vmware时,eth0就变成了eth1
解决:
a) vim /etc/udev/rules.d/70-presistent-net.rules (注释掉eth0,记录eth1的mac地址,并将eth1改为eth0)
b) vim /etc/sysconfig/network-script/ifcfg-eth0 (修改eth0的mac地址为eth1的mac地址)