How to Rename WLAN Network Interface – Udev Configuration

udevwifi

I know this question is similar to "Udev : renaming my network interface", but I do not consider it a duplicate because my interface is not named via a udev rule, and none of the other answers in that question worked for me.

So I have one WiFi adapter on this laptop machine, and I would like to rename the interface from wlp5s0 to wlan0:

root@aj-laptop:/etc/udev/rules.d# iwconfig
wlp5s0    IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=off   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

eth0      no wireless extensions.

lo        no wireless extensions.

root@aj-laptop:/etc/udev/rules.d# ifconfig wlp5s0
wlp5s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:80:34:1f:d8:3f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

However, there are no rules for this interface in 70-persistent-net.rules or any of the other files in the /etc/udev/rules.d/ directory.

Is there any way that I can rename this interface?

Best Answer

Choose a solution:

  1. ip link set wlp5s0 name wlan0 - not permanent
  2. create yourself an udev rule file in /etc/udev/rules.d - permanent
  3. add net.ifnames=0 kernel parameter into grub.cfg - permanent, if your distro won't overwrite it.
Related Question