如下內容轉載於:http://www.linuxidc.com/Linux/2012-12/76248.htmlinux
一:打開/etc/udev/rules.d/70-persistent-net.rules內容以下面例子所示:網絡
# vi /etc/udev/rules.d/70-persistent-net.ruleside
# This file was automatically generated by the /lib/udev/write_net_rulesspa
# program, run by the persistent-net-generator.rules rules file.rest
#htm
# You can modify it, as long as you keep each rule on a singleip
# line, and change only the value of the NAME= key.get
# PCI device 0x1022:0x2000 (pcnet32)generator
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"it
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
二:記錄下,eth1網卡的mac地址00:0c:29:50:bd:17
三:編輯/etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
將 DEVICE="eth0" 改爲 DEVICE="eth1" ,
將 HWADDR="00:0c:29:8f:89:97" 改爲上面的mac地址 HWADDR="00:0c:29:50:bd:17"
四:重啓網卡和網絡服務
/sbin/ifdown eth0
/sbin/ifup eth0
service network restart