[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Netowrk interface ids keep changing order



Koen Vermeer said...
> On Wed, 2005-10-12 at 00:45 +0200, Miroslav Maiksnar wrote:
> > Dne st 12. Å=3Fíjna 2005 0:23 marc napsal(a):
> > > Each time I boot, the order of eth0, eth1 and eth2 is random.
> > > Is there a way to fix their order?
> > Try to look at
> > http://www.debian.org/doc/manuals/reference/ch-gateway.en.html#s-high-rename
> 
> Alternatively, you could try writing an udev rule for this:
> http://www.reactivated.net/writing_udev_rules.html#example-iface

Thanks, Koen.

This worked and was very easy to setup, and worked first time - 
something that I haven't experienced for about three weeks!

Here's the short HOWTO:

To rename network devices using udev.

The udev scripts reside here:
/etc/udev/rules.d/
and are actioned in lexical order.

So, create a script that will run first, say:
010_local.rules

Query the interface to find its (all lowercase) MAC with:
# udevinfo -a -p /sys/class/net/eth0/

Add lines for each interface like:
KERNEL="eth*", SYSFS{address}="00:52:8b:d5:04:48", NAME="lan"

After you add rules, they must be made known to udev by:
# udevstart

A reboot will be necessary for network cards, because the drivers need 
to be reloaded.

-- 
Best,
Marc



Reply to: