LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-04-2008, 03:09 AM   #1
bricedebrignaisplage
Member
 
Registered: Apr 2006
Location: singapore
Distribution: debian
Posts: 51

Rep: Reputation: 16
eth0 / eth1 : how is it decided?


I installed linux on a computer then put the hard drive on another computer that should be exactly the same. However the interface was changed from eth0 to eth1.

1) can I make them eth0 on both? because I would like to be able to switch...

2) I want the interface to be 172.16.0.1. Can I configure both eth0 and eth1 in /etc/network/interfaces to be this static IP or will it conflict? Actually this one is more important than previous question?
 
Old 06-04-2008, 06:50 PM   #2
dellcom1800
Member
 
Registered: Apr 2003
Location: Connecticut, USA
Distribution: Gentoo Ubuntu
Posts: 69

Rep: Reputation: 15
hi

1) Was there another NIC on that other computer (IE integrated)?

2) I would say no. You could do this but they would have to be connected to two physically different networks, but if they are connected to the same one then no, it will cause a conflict
 
Old 06-04-2008, 10:41 PM   #3
bricedebrignaisplage
Member
 
Registered: Apr 2006
Location: singapore
Distribution: debian
Posts: 51

Original Poster
Rep: Reputation: 16
1) What do you mean by "another NIC"? Another brand? The computers are the same. Probably the only difference at that point is the serial number of the parts, and the MAC address of the cards. Can it be that since eth0 was assigned to the interface with MAC address MAC1, so when it encountered the interface on the other computer with MAC address MAC2 it assigned it eth1?

2) Since the 2 computers don't co-exist it will not conflict on the network side. I am worried about the system complaining that 2 interfaces have the same address... But this I can simply try...
 
Old 06-05-2008, 02:59 AM   #4
chmick
LQ Newbie
 
Registered: May 2008
Location: on earth
Distribution: debian lenny amd64
Posts: 1

Rep: Reputation: 0
Wink eth0/eth1, decided by udev

Quote:
Originally Posted by bricedebrignaisplage View Post
I installed linux on a computer then put the hard drive on another computer that should be exactly the same. However the interface was changed from eth0 to eth1.

1) can I make them eth0 on both? because I would like to be able to switch...

Hello
I had a similar problem , when re installing my debian lenny .
I do not remember the exact name of the file , but i guess the solution, is in the udev configuration rules files .(i think it's /etc/udev/rules/

I found a file which associate the interface name (eth0 eth1 etc..) with the mac address .
to find this file a grep -R eth0 /etc/udev/* should do the trick .
 
Old 06-05-2008, 04:39 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
My guess is that HAL and UDEV saved information on eth0 including the MAC address (persistant network device naming). The MAC differs on the second host so the system created a new ifcfg-<dev> for it. This comes in handy if you have a pcmcia NIC device. You could plug in one card for work and another one for home and you don't need to reconfigure the network setup, just change NIC cards.

Also check for these files:
/etc/udev/rules.d/70-persistent-net.rules
/etc/udev/rules.d/75-persistent-net-generator.rules

Code:
# 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.

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:0f:b0:0c:ef:ab", NAME="eth0"

# PCI device 0x14e4:0x4320 (bcm43xx)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:90:4b:92:71:a1", NAME="eth1"

# PCI device 0x1737:0xab09 (tulip)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:04:5a:9d:d6:e8", NAME="eth2"
jschiwal@hpamd64:/usr/src/linux/fs/cifs>
In this file, eth0 refers to my built in nic device (on laptop) that failed on me. The second is the built in wireless interface. The third is a PCMCIA card that I normally use.

The easiest way to deal with it may be to run your network configuration program and delete the interfaces and start over.

Make sure you change the hostname so that it is unique. If you have static IPs, the two hosts must have different IPs as well.

Last edited by jschiwal; 06-05-2008 at 06:10 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Eth0 using DHCP and eth1 using static ip: eth0 receive internal ip not the router ip geraldomanaus Linux - Networking 3 04-23-2008 03:00 PM
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM


All times are GMT -5. The time now is 02:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration