In Linux Ubuntu, how does one modify the NIC name ?, Linuxubuntu
In Linux Ubuntu, how does one modify the NIC name?
I. solution 1:
1. First, modify the physical configuration file of the NIC. If this file is not available, create a new one or copy a copy from the existing environment and modify the configuration as required.
Vi/etc/udev/rules. d/70-persistent-net.rules
# PCI device 0x14e4: 0x1692 (tg3)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "*", ATTR {address} = "bc: 30: 5b: b1: cd: be ", ATTR {dev_id} =" 0x0 ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth0"
Keyword explanation:
ATTR {address }= = "bc: 30: 5b: 9c: AE: 79" # view the MAC address ifconfig of the physical network adapter
KERNEL = "eth *" # original Nic name
NAME = "eth0" # current Nic NAME
You need to configure the MAC address of the NIC in this file, the original Nic name, And the NIC name to be changed.
2. Modify the network configuration file
Vi/etc/network/interfaces
Auto eth0
Iface eth0 inet static
Address 172.16.19.XX
Netmask 255.255.255.0
You need to configure the new Nic name after modification.
Auto eth0 # correct Nic name
3. Restart the server.
Restarting a physical server is risky because the server is not restarted. In my personal testing environment, the server cannot be restarted, or the server is disconnected due to network configuration errors. The following message is displayed: when modifying the NIC, it is best to keep the server close to itself. do not modify the NIC remotely to prevent server disconnection.
Ii. solution 2:
In/etc/default/grub, add the net. ifnames = 0 biosdevname = 0 parameter to GRUB_CMDLINE_LINUX, as shown in:
Then execute update-grub in the command line and modify the/etc/network/interfaces file,
Change the NIC name to eth0
Restart the system. The NIC name is successfully changed. Of course, server disconnection may also occur.