Solving eth0 eth1 eth2 eth3 eth4 …

I occasionally swap network cards in my Thinkpad either as a troubleshooting measure or just to see if one is working better than another. I have a custom kernel in that machine, running under Crux that has support for about four different cards, and depending on which one is inserted, the kernel adjusts automatically.

The problem with that arrangement though, was that each time the card was swapped, a new interface name was given to it. The original Xircom-based card started out as eth0, the Linksys WPC11 was eth1, the ASIX-based wired card was eth2, and so forth.

Which is an okay arrangement, except the network script for Crux required me to change the interface name manually each time I tried a different card. And after reinserting the original card one more time and getting eth5, I decided that was enough of that nonsense.

I managed to track down the culprit — udev — and further track down its persistent rules file, which is at /etc/udev/rules.d/70-persistent-net.rules on that machine. It’s fairly easy to decipher: There is roughly a line apiece for the MAC address and the name assigned to it, and so forth. Why I had two lines for the same card but with different names … is beyond me.

Anyway, it was easy enough to comment out the offending lines in that file, and after rebooting, the sequence started over again at eth0. One last edit of the networking script, and I could at least use the Xircom card without running it as eth5. :|

I think, if I understand it right, that the ifrename utility uses /etc/iftab to assign names; I suppose I might have just pointed everything at “eth0″ since there’s no chance of having more than one interface in that machine (technically). I’ll give that a try sometime, and see if it works.

About these ads

2 Responses to “Solving eth0 eth1 eth2 eth3 eth4 …”


  1. 1 steve 2009/10/03 at 3:50 PM

    Interesting .. as always ;o)

  2. 2 steve...again 2009/10/09 at 4:55 AM

    This (and not pointless!) blog is a godsend…this particular issue has been plaguing me for a while and I had to make use of this info just now and it worked like a charm.

    Thanks a million. :o)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,682 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: