Linux network card name change Eth0 method
Note: You need to operate on a physical machine (that is, a Linux server) the Linux tested here is Redhat version 6.7 (pro-test effective)
Reprint please indicate the Source: Search & Star Children
Step One
View network card information under root user ifconfig–a
If the NIC name is Ethx perform step two, start with step three. (x represents any number, and step three begins ethx to indicate that the physical network card name can be another name EG:P3P1, EM1, etc.) Step two
Let's get the ethx down first.
[Root@app1 desktop]# ifdown ethx found 70-persistent-net.rules file
[Root@app1 desktop]# CD/ETC/UDEV/RULES.D
[Root@app1 rules.d]# ls-l 70*
-rw-r--r--. 1 root root 1342 Feb 201470-persistent-cd.rules
-rw-r--r--. 1 root 420 Apr 2014 70-persistent-net.rules Modify 70-persistent-net.rules This file
[Root@app1 rules.d]# Vi70-persistent-net.rules
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:65:02:ff", attr{type}== "1", kernel== "eth*" ,name= "Ethx"
Change to (just this name)
subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:65:02:ff", attr{type}== "1", kernel== "eth*" ,name= "eth0"
Save exit. Step three
and then enter network-scripts this configuration directory [Root@app1 desktop]# cd/etc/sysconfig/network-scripts
[Root@app1 network-scripts]# ls-l ifcfg*
-rw-r--r--. 1 root root 140 June 6 05:30 ifcfg-ethx
-rw-r--r--. 1 root root 254 9 2013ifcfg-lo
To modify the network card file name
[Root@app1 network-scripts]# mv Ifcfg-ethx Ifcfg-eth0
[Root@app1 network-scripts]# ls-l ifcfg*
-rw-r--r--. 1 root root 140 June 6 05:30 Ifcfg-eth0
-rw-r--r--. 1 root root 254 9 2013ifcfg-lo
Edit Network card configuration file
[Root@app1 network-scripts]# VI ifcfg-eth0
change the device=ethx to eth0and do not need to modify the MAC address .
and remove the UUID (if not)
Save and exit. Step Four Reboot the new network card and verify
[root@app1network-scripts]# ifup eth0
Device eth0does not seem to be present, delaying initialization.
[root@app1network-scripts]# servicenetwork Restart
Shuttingdown Loopback interface: [OK]
Bringingup Loopback interface: [OK]
Bringingup interface Eth3:device Eth3 does not seem to be present, delayinginitialization. [FAILED]
This time is Qibulai, need to reboot the machine to make the changes take effect. reboot the server
[root@app1network-scripts]#reboot
Restart after reboot if you find that the network is not connected automatically
If the original is the ETH series of network card name has been modified, the network is normal.
Verify after reboot:
[root@app1~]# Ifconfig–a