Linux Rename Eth0 Network Interface Card Name [ Udev ]

www‮ruttual.‬i.com
Linux Rename Eth0 Network Interface Card Name [ Udev ]

To rename the "eth0" network interface card (NIC) on a Linux system, you can use the "udev" daemon and create a rule to change the name of the interface. The "udev" daemon is responsible for managing device nodes in the /dev directory and can be used to customize the names and attributes of devices on a Linux system.

To rename the "eth0" interface, follow these steps:

  1. Log in to your Linux system as a user with administrative privileges.

  2. Open a terminal and create a new file in the "/etc/udev/rules.d" directory with a descriptive name, such as "99-rename-eth0.rules". You can use a text editor such as "vi" or "nano" to create the file.

  3. Add the following rule to the file:

SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="newname"

Replace "aa:bb:cc:dd:ee:ff" with the MAC address of your "eth0" interface, and "newname" with the desired name for the interface.

  1. Save the file and exit the text editor.

  2. Reload the udev rules by running the following command:

sudo udevadm control --reload-rules
  1. Restart the network interface by running the following command:
sudo ifdown eth0
sudo ifup newname

This will rename the "eth0" interface to "newname". Keep in mind that this change will not persist across reboots, so you may need to create a startup script or modify the network configuration files to apply the change permanently.

Created Time:2017-10-30 10:17:37  Author:lautturi