write udev rules for changing network interface name

write udev rules for changing network interface name

udev rules, write udev rules for rename network interface name in linux. here i changed second wireless card name.  change network interface name using udev rules. linux topic, linuxtopic,

Step 1:

Check card is detected or not

All available interface list
ip a

Here i have realtek usb wifi card and name is “wlx2824fffa1dcb” & MAC is 28:24:ff:fa:1d:cb

Now we write a udev rules to change interface name:

Step 2 :

Create udev rules file
cd /etc/udev/rules.d/

vi 75-wifi-interface-name-change.rules

# Add Rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="28:24:ff:fa:1d:cb", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="w*", NAME="wireless-usb"

ATTR{address}==     →  your card mac address
KERNEL==        →  detected interface name ( wlx2824fffa1dcb ) OR  used ( w* )
NAME=        →  new interface name

Step 2:

Update udev rules
udevadm control --reload

Next Post »