Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 2.38 KB

change_interface_name.md

File metadata and controls

46 lines (28 loc) · 2.38 KB

Change Network Interface Name

I've encountered a weird and long interface name after installing drivers for my TP-Link Archer T2U Plus USB Wifi Adapter in My Linux Machine. It was shown up as "wlx984827a0287e" in the result of ifconfig or iwconfig. I was only familiar with names like wlan0,wlan1,wlp1s0 .etc So i changed "wlx984827a0287e". Smaller is sometimes better 😄 . Here is how i did it.

lsusb&iwconfig_result

Steps to change Interface name

Disable predicatble Network Interface names

  1. Edit your grub configuration file:

sudo nano /etc/default/grub

Add net.ifnames=0 biosdevname=0 to GRUB_CMDLINE_LINUX=""
like this:GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

  1. Update grub.cfg :

sudo grub-mkconfig -o /boot/grub/grub.cfg

Find the MAC Address of Network Interfaces

  1. ifconfig
    Copy the 12 digit MAC address preciding 'ether' usually in the 4th line .

  2. Create the configuration file (70-persistent-net.rules) :

sudo touch /etc/udev/rules.d/70-persistent-net.rules
sudo nano /etc/udev/rules.d/70-persistent-net-rules you can use any text editor of choice instead of nano

  1. Add the following line per interface. Add the MAC address and the new NAME per interface.

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="{insert MAC Address Here.remove curls}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth", NAME="wlan0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="{insert MAC Address here.remove curls}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth", NAME="wlan1"

  1. Save the file and reboot.

Final-Changed-name

References

Mellanox Community
Stack Exchange
Shellhacks.com