Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've changed the Motherboard of my pc, and when I restart it, I didn't got internet. I checked if I was acquiring IP with 'ifconfig' and I noticed that the PC wasn't getting IP for eth1. I checked the interfaces file in ubuntu and the OS was trying to acquire for eth0. So, I changed the /etc/network/interfaces auto eth0 to auto eth1. Now, everything works.
1 - Where ethNUMBER name is defined? Is it in the BIOS?
In a simple way, if you have 1 wired network card, the system will set it as eth0 so the 1st device, if the system has 2 network cards then the 1st will be eth0 and the 2nd will be eth1 and so on. You did change the motherboard but not the hard drive and you still have the same OS(is that correct?), if is that so the OS see this network card as a new card and second card in the system(eth1) and can't find eth0 because it isn't there, and previous settings were for eth0. So eth0 is present in the OS but there is no hardware. I hope this clarify your question.
Newer Linux uses udev to configure device dynamically.
So I think It will work well with new hardware configuration.
But system create some udev rules for hard disk and network cards, .... for consistant naming of device.
This rule uses product ID, Vendor ID kind of details for naming.
In your case it may be problem
My system uses /etc/udev/rules.d/70-persistent-net.rules file for network card naming.
Udev device naming related configuration stored in,
/lib/udev/rules.d and /etc/udev/rules.d/.
So check these directories.
In a simple way, if you have 1 wired network card, the system will set it as eth0 so the 1st device, if the system has 2 network cards then the 1st will be eth0 and the 2nd will be eth1 and so on. You did change the motherboard but not the hard drive and you still have the same OS(is that correct?), if is that so the OS see this network card as a new card and second card in the system(eth1) and can't find eth0 because it isn't there, and previous settings were for eth0. So eth0 is present in the OS but there is no hardware. I hope this clarify your question.
Regards
fyi, i have 1 network card but it checks in as eth3:
linuxxer, I think you're right. I've eth1 instead of eth0 because of the file '/etc/udev/rules.d/70-persistent-net.rules' like you said. If I clean this file maybe I would get now the network card eth0 instead of eth1. I will try that later.
[schneidz@hyper ~]$ cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# Networking Interface (rule written by anaconda)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:fb:a6:2a:5b:68", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
fyi, i have 1 network card but it checks in as eth3
This is interesting, has this been changed manually? Or does your distribution set that way as default? Usualy the 1st device is set as eth0, but that doesnt mean it can't be changed later.
ukiuki, it's because of this file: /etc/udev/rules.d/70-persistent-net.rules
I know it is set in that file, still that isn't what the question is about so again and:
@schneidz: has this been changed manually? Or does your distribution set that way as default?
It is not crazy. This is a udev 'feature'. The new LAN card/controller on your motherboard has a different MAC address than the previous ones. This will add to the udev persistent rules. Simply delete this file, and have udev build it again on next boot. Then you should have eth0 again.
I have seen this also with Gentoo. The distro I use.
Talking about crazy things, just make sure to make a backup of that file, just in case, so crazy things don't happen, also have a live cd in hand.
Wasn't Van Gogh from Holland? He was crazy yes? Great painter thou, crazy !!
I'm just kidding no offense.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.