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

Re: 2.6 kernel network interface assignment order

Eric Sproul wrote:

On Thu, 2004-01-29 at 14:55, Franz Georg Köhler wrote:

This occasionally happens with new kernel releases.

I'd like to know why.

Swap your configuration...

Again, I'd like to know *why* it happens rather than blindly changing
configs.  What if I had 3 interfaces, what would happen then?  I
wouldn't know which would end up where.

Anyone have any more constructive advice?

I don't know of any way to reliably ensure that a given card = eth(n). It's obviously a big deal on any multi-card platform. Another problem is if you have multiple cards (often to ensure connectivity if one goes down) and eth0, for instance dies. Now on reboot, all the cards shift over one number, and nothing works (if they're on seperate subnets. Same problem, but can happen without a kernel change. Yuck.

If it's really critical, or happens often, perhaps you'll want to write a custom init script that looks at the hardware address of the interface, and configures the appropriate IP settings for the interface.

Something like the following crude outline:

devs="eth0 eth1 eth2"

setconfig () {
    case "$1" in
		configint $1 <ip> <netmask> <gateway>
		configint $1 <ip> <netmask> <gateway>
#	(etc. etc.)

configint () {

    ifconfig $int netmask $mask  $ip

for dev in $devs; do
  addr=`ifconfig $dev | grep HWaddr | sed -e's/.*HWaddr //'`
  setconfig $addr


Reply to: