Getting you started > How to's

Stop network interfaces from switching names, the udev way.

(1/3) > >>

On VL 5.8, udev makes this very easy for you by providing an /etc/udev/rules.d/network-devices.rules file customized to your hardware (NOTE: this is actually not provided by default). In it you will find a line for each of your network interfaces, defined by MAC address. All you need to do is remove the comment markers (#) and edit the names as you want them. Here's an example of how this looks:

--- Code: ---KERNEL=="eth?", SYSFS{address}=="00:c0:9f:f2:fd:c1", NAME="eth0"
KERNEL=="eth?", SYSFS{address}=="00:14:a5:28:68:3a", NAME="eth1"

--- End code ---

As stated above, you only need to know which MAC address corresponds to which network adapter, then set the "NAME=" part as you want it. Keep in mind that ifplugd is set to handle only ethX type interfaces, so if you use a name like "wlan0", you will have to handle it another way (NOTE: seems it does handle wlan0).

If you change your network interfaces and want a new file set up automatically, simply delete the current file and udev should set a new one up for you on the next boot.

The Headacher:
Thanks Joe1962, I could really use this HOWTO. Those switching names are one of the most annoying 'features' in Linux IMO.

hmmm,what about if I dont have that file there?

--- Code: ---root:# cd /etc/udev/rules.d/
root:# dir
10-vl-hot.rules  40-fuse.rules  41-kqemu.rules  libsane.rules  udev.rules

--- End code ---

The Headacher:
Create one from Joe's example. I did and it works just fine. just change the hardware addresses.

so i just create the file

and add this line in it (if i use only one of the two eths)

--- Code: ---KERNEL=="eth?", SYSFS{}=="00:c0:9f:f2:fd:c1", NAME="eth1"
--- End code ---

thats not my real ip/mac btw (just cant remember them,hehe) ::)


[0] Message Index

[#] Next page

Go to full version