Re: nic enumeration
From: Steve Fink
Date: Wed Jul 07 2010 - 19:16:00 EST
On Wed, Jul 7, 2010 at 3:25 PM, Michael Di Domenico
<mdidomenico4@xxxxxxxxx> wrote:
> What I'm curious about is how/why Linux actually decides Nic1 should be Eth0?
>
> My theory is it starts on the lowest MAC address and works up,
> depending partly on driver load order.
I may be spewing misinformation here, but my understanding of how this
works is that the specific ordering is pretty much random. It's rather
unlikely to be based on MAC address value, except accidentally; it's
probably just whatever comes up first when it enumerates the
interfaces, which could easily be timing-dependent. (From personal
experience, two identical but physically separate NICs will come up in
a different order on every boot. Your case may be more consistent.)
The first time it does this, though, it records the MAC address into
the appropriate ifcfg-* script. From then on, at boot time it checks
the MAC address of each interface as it comes up. If it mismatches
with what is recorded in the ifcfg-* script, then it skips that name
and tries using the next.
In other words, all you should have to do is set HWADDR appropriately
in the the ifcfg-* scripts and it should do the right thing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/