2014年7月14日 星期一

[CentOS 7.0] Change network interface name (eno* to eth0)

Step1)
# vim /etc/udev/rules.d/70-persistent-net.rules
-----------------------------------------------------------------------
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:7b:d8:06", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eno16777736", NAME="eth0"
-----------------------------------------------------------------------
or
-----------------------------------------------------------------------
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:7b:d8:06", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eno*", NAME="eth0"
-----------------------------------------------------------------------
Step2)
# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0

Step3)
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
-----------------------------------------------------------------------
HWADDR="00:0C:29:7B:D8:06"
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="2aa76b48-487b-425e-a021-ace79c0773cd"
ONBOOT="yes"
-----------------------------------------------------------------------

Step4)
# reboot

Reference:  http://dreamtails.pixnet.net/blog/post/30192150-%5Bcentos-7.0%5D-change-network-interface-name-%28eno*-to-eth0%29

沒有留言: