Posted: Tue Oct 31, 2006 11:31 am Post subject: How to make eth1 named as wlan0?

Hello guys. I was wondering... lots of folks keep to referring to their wireless device as wlan0, mine is eth1.
Is there any useful udev rule to name it wlan0 or maybe it's just some drivers do this themselves?

That comes partly (or maybe completely) through the driver you use for this. I'm using for example the ndiswrapper with windows driver and have wlan0 as name or with my other pcmcia card I have rt0 as name, because this uses rt2500._________________Gentoo compiles you to heaven

There are 10 kinds of people. Those who understands BINARY and those who don't.

if you want to rename your interface, you can do it in /etc/conf.d/net:

Code:

$ cat /etc/conf.d/net.example
...
# If you are unable to write udev rules, then we do provide a way of renaming
# the interface based on it's MAC address, but it is not optimal.
# Here is how to rename an interface whose MAC address is 00:11:22:33:44:55
# to foo1
#rename_001122334455="foo1"

# You can also do this based on current device name - although this is not
# recommended. Here we rename eth1 to foo2.
#rename_eth1="foo2"

Unless you define some udev rules o rename the interface, udev uses the name offered by the kernel, which comes from the driver.
You can rename your interfaces to anything you like, like this:-
Create a file /etc/udev/rules.d/03-local-net.rules

Thanks for the easy way, davjel.
NeddySeagoon, thanks for telling how to write udev rules - I prefer to know stuff like that before allowing
the distribution to config it for me. Where can I find some info on what's available beside SYFS{address}?
Do you think the MAC address matching is the best way to go?

once to update /etc/modprobe.conf
and I make sure the modules are loaded in the order above
Then you can guess what happens

Of course you want the opposite and your modules have different names, but it's
easily adaptable.
Maybe this will work for you!_________________It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

Unless you define some udev rules o rename the interface, udev uses the name offered by the kernel, which comes from the driver.
You can rename your interfaces to anything you like, like this:-
Create a file /etc/udev/rules.d/03-local-net.rules

This is what I have in 10-local.rules, but it doesn't work. If I load my wireless module first, wireless is set to eth0 and ethernet is set to eth1, and if I load the ethernet first, ethernet is set to eth0 and wireless is set to eth1_rename . Both MACS were copied and pasted. wtf? [/quote]_________________Most Linux users don't know this, but the man pages are named after Chuck Norris. Chuck Norris fscking hates noobs!

Now my ethernet always comes up as eth0, but my wireless always comes up as eth1 instead of wlan0. I don't even have a symlink for net.eth1. _________________Most Linux users don't know this, but the man pages are named after Chuck Norris. Chuck Norris fscking hates noobs!

I'm not sure if udev will modify it, because the comments say I can edit it. Just to be on the safe side, I am still going to add this to 10-local.rules.

Thanks.

Code:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.