Renaming my wlan network interface

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:

<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dcaeb3b3a89cbdb6f1b0bdaca8b3ac">[email protected]</a>:/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.

<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70021f1f0430111a5d1c1100041f00">[email protected]</a>:/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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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.

Method 2

On Linux Mint 18:

cat /etc/udev/rules.d/70-persistent-net.rules

says in comment:

This file was automatically generated by the /lib/udev/write_net_rules
program, run by the persistent-net-generator.rules rules file.

You can modify it, as long as you keep each rule on a single
line, and change only the value of the NAME= key.

So, I suppose, just change the NAME key to your liking.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x