Ethernet numbering in Ubuntu

Welcome to the news archive. Here you'll find all the news items, ordered by date. You can use the links below to read other news items, or go back to the archive overview.

2006-08-10 12:35 - Ethernet numbering in Ubuntu

update: this info is obsolete as of Ubuntu Gutsy, check the comments for the modern solution.

My girlfriend's laptop got bricked, so we replaced it with another laptop of the same make and model, and put in her original laptop's harddisk. Of course, Ubuntu ran fine, but there was one issue: instead of having eth0 and eth1 as WiFi and LAN devices, we had eth2 and eth3. For some reason, Ubuntu refused to re-use eth0 and eth1.

After a bit of digging, I found out that /etc/iftab contains the MAC addresses of network cards:

  # This file assigns persistent names to network
# interfaces. See iftab(5).
eth0 mac 00:01:de:ad:be:ef

This is very useful if you have hot-pluggable NICs that need to keep the same ethX every time you plug them in. Ubuntu's installation put in the MAC addresses of the original network interfaces, so that's why the new hardware skipped eth0 and eth1 and used eth2 and eth3.

Setting the correct MAC addresses in /etc/iftab solved the issue.

Post a comment


Comments

Awesome. I recently had this problem as well when I disabled my onboard nic and installed an add in card. This definitely fixed it! Thanks.

by Haw Kor - 3 years, 10 months ago.


In recent Ubuntu versions (and potentially other Linuxes), the iftab file is replaced by /etc/udev/rules.d/70-persistent-net.rules

(The 70 might change, though.)

It's not the same syntax, but you can tell rather easily what it does.

by Bogdan - 2 years, 9 months ago.


Thanks for the update Bogdan!

by Sybren Stüvel - 2 years, 9 months ago.


Thanks Bogdan, couldn't have done it without you.

by Matt - 1 year, 10 months ago.


Thanks a lot for the original blog post and thanks Bogdan for the comment, definitely helped me out.

by tomele - 1 year, 5 months ago.

Post a comment

Use Restructured Text to markup the comment. The link opens in a new window.


All fields are required, except when otherwise noted. You can use a limited subset of Restructured Text to markup the comment.

It might take up to five minutes for your comment to show up, due to caching of the pages.