When multiple network cards are installed on a Linux system, changing the name is not that simple. Faced with this situation of multiple network cards, the editor of Huajun will share with you how to change the name of multiple network cards in Linux? , let’s learn how the process works together! If you like it, hurry up and collect it~. .
1. There are 4 network cards installed on a Linux machine, two built-in ones and two extended ones. After installing the system, the two extended ones are identified as eth0 and eth1. I want to change the two system ones to eth0 and eth1.
2. Change the module alias in the /etc/modprobe.conf file
For example alias eth0 e1000e
alias eth1 e1000e
Change to alias eth2 e1000e
alias eth3 e1000e
3. Change the name of the network card configuration file to ifcfg-eth0, that is, swap it
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-temp0
mv /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-temp2
mv /etc/sysconfig/network-scripts/ifcfg-temp2 /etc/sysconfig/network-scripts/ifcfg-eth0
mv /etc/sysconfig/network-scripts/ifcfg-temp0 /etc/sysconfig/network-scripts/ifcfg-eth2
4. Change the configuration file and change DEVICE=eth0 accordingly.
5. Reload the network card module
modprobe eth0
modprobe eth1
modprobe eth2
modprobe eth3
6. Restart the network service /etc/init.d/network restart. I tried restarting the network but it didn’t work. Then I restarted the machine.
7. Check ifconfig is normal
Compare the mac and see if it is running to judge.
The above is the editor's summary of the method of changing the name of multiple network cards in Linux. The method introduced in this article is only for Linux systems. Other systems can be used as a reference. For CentOS, please see System Home CentOS 6.X for details on how to change the name of the network card.