[RndTbl] Binding device names to MAC addresses

Adam Thompson athompso at athompso.net
Wed May 10 15:14:46 CDT 2006


Further to the discussion about binding ethernet devices to specific 
ethernet cards...

I appear to have been mistaken - I cannot find any consistent way to 
tell the kernel to attach "eth0" to, say the device "02:01.0" (which in 
my system is:
Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet 
Controller (rev 02)").
If you use hotpluggable devices (e.g. USB ethernet adapters) then there 
may be a way but that's through the hotplug scripts, not through the kernel.

However, the mechanism for mapping specific hardware MAC addresses to 
device names (eth0, eth1, eth2, etc.) is actually quite straightforward.

    /sbin/nameif (from net-tools)
and
    /sbin/ifrename (from wireless-tools)

both do the same trick, as far as I can tell.  I have no idea how it 
massages kernel innards in this way, but whatever - it apparently just 
works.

-Adam Thompson
 athompso-muug at athompso.net




More information about the Roundtable mailing list