LinuxQuestions.org
Review your favorite Linux distribution.
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 12-07-2005, 11:13 AM   #1
slayer17
LQ Newbie
 
Registered: Nov 2005
Location: Lewisville Texas
Posts: 4

Rep: Reputation: 0
eth0 and eth1 switch places on reboot?


Had a network problem the other night and had to reboot the server. Upon starting the nic cards reversed order. The eth0 information was switch with the eth1 information creating tons of confusion. The mac address was hard coded in the /etc/syconfig/ area but hwconf seems to have chanced. Any idea why the cards would have switched? Can anyone point me in the right direction?
 
Old 12-12-2005, 03:55 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
The first card to load it's driver gets to be eth0..

It can be controlled by delaying setting up eth1 until eth0 settles,
however there are several factors in play here.
acpi is the first to detect the card, then hotplug then your /etc/modules file then the /etc/init.d scripts.

Usually, the rc.d scripts and ifup allow you to specify a pre-up script/command, which you could use to load the respective eth modules, if they aren't autoloading already. Your distro will have a specific way of doing this..

But if all else fails, compile into the kernel the driver for the card you want to be eth0. This ensures it will get loaded by the acpi system before any other scripts run.
 
Old 12-12-2005, 04:18 PM   #3
slayer17
LQ Newbie
 
Registered: Nov 2005
Location: Lewisville Texas
Posts: 4

Original Poster
Rep: Reputation: 0
The problem is that the cards are the same and the system has been rebooted several times before without the cards switching. Now all of the suddon the cards switch and great a networking nightmare. I have never had cards switch at this point.
 
Old 12-12-2005, 04:44 PM   #4
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Take a close look at the boot logs.
There is a lot of detailed info about hardware being detected and modules loading. You may get some more sense comparing a pre and post problem log.

Usually nothing changes until something changes..
 
Old 12-13-2005, 03:39 PM   #5
pIscIs
LQ Newbie
 
Registered: May 2005
Posts: 9

Rep: Reputation: 0
i think that your net cards has a different module name. so if i correct, you can assign your card1 to eth0 with alias command. so in modules.conf add: alias eth0 module_name

Last edited by pIscIs; 12-13-2005 at 03:42 PM.
 
Old 12-14-2005, 09:31 AM   #6
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
All that will do is load the particular module regardless of the type of NIC found as eth0..
 
Old 12-14-2005, 10:04 AM   #7
slayer17
LQ Newbie
 
Registered: Nov 2005
Location: Lewisville Texas
Posts: 4

Original Poster
Rep: Reputation: 0
I will have to moniter it from this point forward. I just started working for this company and don't know anything about this systems. They had no linux admin until about 2 weeks ago... me. I was just concerned because I have never seen cards set to macs chance name locations without being told to do so. I am starting to believe that someone set it up that way and upon boot it did it. No way to tell because the logs don't show anything but normal steps.
 
Old 12-14-2005, 03:14 PM   #8
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
dmesg or your boot log will show which card it believes it found first..

eg.
PCI: Found IRQ 11 for device 00:0d.0
eth0: RealTek RTL8139 at 0xd0822f00, 00:90:0b:04:47:91, IRQ 11
eth0: Identified 8139 chip type 'RTL-8100B/8139D'

shows the first found card was in pci slot 00:0d.0

or if you've got acpi working..
ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
e100: eth0: e100_probe: addr 0xe6000000, irq 11, MAC addr 00:A0:C9:4B:B5:79

shows the first found card was in pci slot 0000:01:00.0

There's no reason for this to change unless the BIOS is changed.
 
Old 12-14-2005, 08:33 PM   #9
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
slayer17 ... there is no magic .. it was always like this.
It has to do with what boot/install did with module.conf does ..
edit the file and live happy thereafter.

Peter_Robb is correct, but the only twist I am suggesting is that it was always like this .. has happend to me a zillion times ... mostly with Suse, knoppix/Mepis never caused the same grief on the same hardware
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i assign/switch eth0 & eth1 the-sloth Linux - Networking 10 02-05-2011 12:48 PM
eth0 and eth1 switch cards at run time! haxcess Linux - Networking 8 12-12-2005 04:17 PM
Mandrake is switching the eth1 and eth0 interfaces... how can I switch them back? LaptopLinux Mandriva 3 03-28-2005 09:23 PM
eth0 (and eth1) lost on reboot larsonse Slackware 3 10-12-2004 03:58 AM
How do you switch the default ethernet adapter (eth0 to eth1)? scoobdoobery Linux - Networking 3 09-05-2004 01:29 PM

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

All times are GMT -5. The time now is 10:31 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