forcing an interface to be athX

Nils Kassube kassube at gmx.net
Wed Nov 21 22:54:50 UTC 2007


David Vincent wrote:
> I have a machine here which has seen three wireless adapters and now
> that I have found one which works in the internal wifi slot for various
> reasons I want to force it to be named "ath0" not "ath2" when the
> machine comes up.
>
> /etc/iftab seems to be what I need to do this but it isn't having any
> effect - anyone know an easier way to accomplish this on Gutsy?  Is
> iftab being ignored because I am using NetworkManager?  How can I
> "purge" the settings Ubuntu has stored on ath0 and ath1?

Networkmanager works on a different layer than the interface names. If you 
are using Ubuntu 7.10 the file /etc/iftab is no longer in use. Maybe 
someone else can tell you how to set the association of interface name 
and MAC address with udev. But if you have an earlier version of Ubuntu, 
the following should work.

If you want the interfaces to get the names mentioned in /etc/iftab you 
should reload the kernel modules for the interfaces. I don't know which 
modules are in use, so I can't tell you the exact command. However it 
would be something like this (if you have 3 different modules for the 3 
diffenrent wifi cards):

sudo rmmod module1 module2 module3
sudo modprobe module1
sudo modprobe module2
sudo modprobe module3
sudo /etc/init.d/networking restart

I'm not sure if the last command is necessary, but it doesn't hurt.

You can probably find out the real module name(s) with one of the 
commands "lsmod" or "dmesg|grep ath".


Nils




More information about the ubuntu-users mailing list