LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-20-2009, 12:07 PM   #1
cubehead
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
IPs keep swapping between network interfaces


Hello all,

We have a Linux box running Centos with 3 network interfaces with static IP assigned to each,

eth0 192.168.0.25
eth1 172.17.1.10
eth2 172.19.1.10

whenever we reboot the box, it seem that the IPs between the eth0 and eth1 get swapped, it would become

eth0 172.17.1.10
eth1 192.168.0.25
eth2 172.19.1.10

one the sys admins at work said that depending on which interface comes up first gets assigned the first ip, but that just doesn't sound right to me. I suspect something is not configured properly. What could be the problem? Where should I look to fix this?

Thanks very much in advance!
 
Old 05-20-2009, 03:43 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I think he's on the right track, Check the persistent net rules.. /etc/udev/rules.d/70-persistent-net.rules

http://reactivated.net/writing_udev_rules.html
 
Old 05-20-2009, 03:52 PM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Given that your ethernet device names aren't changing, I'm having trouble understanding how it could be a udev problem. IOW, if your networking script (however that works on Centos) says that eth0 should be 192.168.0.25, then that's what it should be, regardless of what order eth0 comes up in. That's not to say that device 1 (which you want to be eth0) couldn't be the wrong device, and thus get the wrong IP as a result of udev. Or is there something you're not telling us to avoid some confusion?

It might be more helpful if we could see the results of /sbin/ifconfig on two occasions when they're different.

Last edited by Quakeboy02; 05-20-2009 at 03:53 PM.
 
Old 05-20-2009, 11:18 PM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
comparing the IP address and MAC address for each interface when addressed correctly, and incorrectly, would make it obvious if the interface id's are swapping.

As quakeboy02 said it's hard to tell from here without the proper info though. so I'll consult my Magic Eight Ball in lou of factual data. I asked the Magic Eight Ball if the interfaces were swapping position at boot and it responded: "Definitely !" The Magic Eight Ball is rarely ever wrong... so unless we get more info, that is what we will have to go by.





Aw come on you have to admit that was humorous... Well, at least I thought it was..
 
Old 05-20-2009, 11:45 PM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by farslayer View Post
Aw come on you have to admit that was humorous... Well, at least I thought it was..
Wait till I get over the flu to do that, will ya?!
 
Old 05-21-2009, 08:37 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Cubehead are you out there ?

Were you able to check the interface info to get a better idea of what is happening ? ....
Did you already resolve the issue ?
enquiring minds want to know


Quakeboy, you didn't get the H1N1 (swine flu) did you ? Hope you're feeling better soon..
 
Old 05-21-2009, 08:57 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
I haven't used Centos (Red Hat derivative, yes?) but I think that if you look in the ifcfg-ethx files (where x is 0 1 or 2 for you) you have the option to add the line:
Code:
HWADDR=<MAC-address>, where <MAC-address> is the hardware 
address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This 
directive is useful for machines with multiple NICs to ensure that the 
interfaces are assigned the correct device names regardless of the 
configured load order for each NIC's module. This directive should not be 
used in conjunction with MACADDR.
See more here: http://www.redhat.com/docs/manuals/e...nterfaces.html

This looks easier than messing with udev
 
  


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
Routing to internet through one network, and to local ips in another network IceDane Linux - Networking 6 04-02-2009 01:21 AM
the network scripts to create network interfaces for 802.1q VLANs 10 and 11, Lahore Linux - Networking 0 03-18-2009 05:45 AM
For laptop - different networks in /etc/network/interfaces, or use network-manager? dmravaet Linux - Wireless Networking 4 03-17-2007 11:42 PM
Manual Network Setup Works, /etc/network/interfaces doesn't verdeboy2k Linux - Wireless Networking 0 05-31-2006 06:56 PM
Swapping PCMCIA network cards ridertech Linux - Laptop and Netbook 1 10-03-2004 12:31 PM

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

All times are GMT -5. The time now is 07:16 PM.

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