LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2012, 05:32 AM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
Where ethNUMBER comes from?


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?
 
Old 08-31-2012, 05:54 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
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
 
Old 08-31-2012, 07:18 AM   #3
linuxxer
Member
 
Registered: Apr 2011
Location: I have my own planet
Distribution: SlackwareŽ
Posts: 257

Rep: Reputation: Disabled
Try this command :

Code:
cat /proc/net/dev

Quote:
Originally Posted by xeon123 View Post
I've changed the Motherboard of my pc
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.
 
Old 08-31-2012, 07:58 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by ukiuki View Post
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:
Code:
[schneidz@hyper ~]$ ifconfig -a
eth3      Link encap:Ethernet  HWaddr 90:FB:A6:2A:xx:xx  
          inet addr:192.168.1.25  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::92fb:a6ff:fe2a:5b68/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:309471 errors:10 dropped:0 overruns:10 frame:0
          TX packets:159555 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:267573302 (255.1 MiB)  TX bytes:301464658 (287.4 MiB)
          Interrupt:23 Base address:0x8000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13950 (13.6 KiB)  TX bytes:13950 (13.6 KiB)
 
Old 08-31-2012, 08:39 AM   #5
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
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.
 
Old 08-31-2012, 08:42 AM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
fyi heres mine:
Code:
[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"
 
Old 08-31-2012, 09:11 AM   #7
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Quote:
Originally Posted by schneidz View Post
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.

Regards
 
Old 08-31-2012, 11:04 AM   #8
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
ukiuki, it's because of this file: /etc/udev/rules.d/70-persistent-net.rules
 
Old 08-31-2012, 12:03 PM   #9
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Quote:
Originally Posted by xeon123 View Post
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?

Regards
 
Old 08-31-2012, 12:10 PM   #10
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i didnt change it... didnt even know about that file. fedora must've done something crazy.
 
Old 08-31-2012, 12:32 PM   #11
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Reminds me why I drop that distro, crazy things indeed !!

Regards
 
Old 08-31-2012, 01:04 PM   #12
m1chel
LQ Newbie
 
Registered: Jan 2012
Location: Holland
Distribution: Gentoo
Posts: 4

Rep: Reputation: 0
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.

Michel
 
Old 08-31-2012, 06:24 PM   #13
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Quote:
Originally Posted by m1chel View Post
... Simply delete this file, ...Michel
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.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration