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.
Disable predicatble Network Interface names
- 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"
- Update grub.cfg :
sudo grub-mkconfig -o /boot/grub/grub.cfg
Find the MAC Address of Network Interfaces
-
ifconfig
Copy the 12 digit MAC address preciding 'ether' usually in the 4th line . -
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 ofnano
- 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"
- Save the file and reboot.