StepInside

Creativity and Inspiration

November archive

Renaming network interfaces using udev rules

By default network interfaces in Linux have non-informative names, like eth0 or eth1. It is more convenient to give them logical names. F.e. wireless link can be named wlan and ethernet link – lan.

There are several ways to rename network interfaces but I find solution with udev to be the easiest solution. All that you should do is to add following rules to udev (usually this can be done by adding file with new rules to /etc/udev/rules.d directory):

SUBSYSTEM=="net", SYSFS{address}=="00:13:02:65:74:c1", NAME="wlan"
SUBSYSTEM=="net", SYSFS{address}=="00:18:d3:05:e3:da", NAME="lan"

SYSFS{address} in these rules is hardware address of network card and can be found in /sys/class/net/ethN/address file, where ethN – old name of the interface you want to rename. Note that string comparison in udev rules is case sensitive.

Posted by ksh on November 6, 2006 | 0 comments | linux

Calendar

August 2008
MoTuWeThFrSaSu
0000123
45678910
11121314151617
18192021222324
25262728293031

Tags

Archives

RSS feeds