How to change the network card name in Debian?

In Debian operating system, you can change the network card name by following these steps:

  1. Open the terminal and enter the following command to view the current network card names and their corresponding MAC addresses:
ip addr
  1. Find the name of the network card that needs to be modified and remember the corresponding MAC address.
  2. You can edit the file /etc/udev/rules.d/70-persistent-net.rules using a text editor like nano.
sudo nano /etc/udev/rules.d/70-persistent-net.rules
  1. Find the entry for the network card that needs to be modified in the file, and change the value of NAME=”” to the new network card name, following the format below:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC 地址>", ATTR{type}=="1", KERNEL=="eth*", NAME="新的网卡名称"
  1. Save and exit the editor, restart the networking service to apply the changes.
sudo systemctl restart networking
  1. Finally, double check to see if the network card name has been successfully changed.
ip addr

By following the above steps, you can successfully modify the network card name in the Debian operating system.

bannerAds