|
在使用vmware 做rac的过程中,安装了第一台机器后,再安装另一台机器时,一般可以通过拷贝前一台机器的方式来完成,
但我们拷贝过来后,发现网卡的名字不一样了,比如第一台机器的网卡为 eth0,eth1,但发现拷贝过来后,网卡名字为eth1,eth2了,
如果通过删除网卡,再增加网卡的方式,发现网卡一直在往前面增长,如下:
比如上面,复制后,变成eth4,eth5了,这个时候如何处理呢?
其实,在/etc/udev/rules.d/70-persistent-net.rules中,有这个记录:
[root@rac1 rules.d]# pwd
/etc/udev/rules.d
[root@rac1 rules.d]# more 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:20:dd:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:20:dd:fc", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d1:a3:8f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d1:a3:99", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:23:de:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:39:df:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
[root@rac1 rules.d]#
把前面的部分删除,只留最后两行,同时修改NAME
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:23:de:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:39:df:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
之后,重启机器,再查看,
我们将看到网卡名字已经变了
|
|