首先确认系统能够识别你的网卡:
# lspci | egrep -i --color 'network|ethernet'
接下来,有两个方法。
方法1:
vi /etc/udev/rules.d/70-persistent-net.rules
# cd etc/sysconfig/network-scripts/ # mv ifcfg-eth3 ifcfg-eth0
# vi ifcfg-eth0
配置网卡ip相关信息。
# service network restart # ifconfig -a 方法2:
First of all find out the mac address of your interface cards
[root@devmillennium-web ~]# ifconfig -a | grep -i --color hwaddr eth0 Link encap:Ethernet HWaddr **xx:xx:xx:xx:xx:xx**
To rename eth3 as eth0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/ directory.
# vi /etc/udev/rules.d/70-persistent-net.rules
The names of the Ethernet devices are listed in this file as follows:
# PCI device 0x14e4:0x1680 (tg3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="**n6:cd:6f:45:32:e6**", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="**eth0**"
Here change the mac address to your networkinterface mac address xx:xx:xx:xx:xx:xx and change name of the interface from eth3 to eth0.
and now reboot the server。
方法3:
# lspci | egrep -i --color 'network|ethernet'