LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-25-2006, 12:29 PM   #1
BuckRogers01
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 232

Rep: Reputation: 30
How to swap eth0 and eth1 round


Hi, I was wondering how I swap the interface names given to my ethernet card. I have two ethernet devices (one inbuilt on motherboard, other PCI card). And I want my onboard ethernet to be assigned eth0, and the card eth1, but it happens the other way round. How do I swap them round or cause them to be assigned the correct name

Thanks in advance, Buck
 
Old 02-25-2006, 12:31 PM   #2
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
I believe the kernel assigns the names as it finds them. Since one is onboard and you can't move it down a few slots below the other, you are stuck with this. Unless there is a way to alias 0 to 1 and 1 to 0, but I would imagine that would make more trouble for you.
 
Old 02-25-2006, 12:34 PM   #3
BuckRogers01
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 232

Original Poster
Rep: Reputation: 30
aah, ok. I'll just live with it
 
Old 02-25-2006, 12:57 PM   #4
sjoerdvvu
LQ Newbie
 
Registered: Nov 2005
Location: the Netherlands
Distribution: Ubuntu, Mandrake, DSL
Posts: 24

Rep: Reputation: 15
pull pci card out of its socket and, and turn your onboard card off in bios, then boot your system, it should remove the cards from hardware..

put onboard device on in bios, let your system detect the card as eth0, after put your pci card in and let it assign to eth1.

just another simple solution...
 
Old 02-25-2006, 01:16 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
May be able to put card in another pci slot and it might get detected before the other.
Any reason other than order you perfer this?

Brian1
 
Old 02-25-2006, 01:46 PM   #6
BuckRogers01
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 232

Original Poster
Rep: Reputation: 30
I just prefere eth0 to be my LAN, and I found that if I load the driver as a module (for the pci card) and compile the driver for the onboard ethernet controller directly into the kernel, then they get assigned properly.

Also, do I need to have the networks on each ethernet interface using different submasks. IE I have a DSL router (proper all in one router, just set DMZ to IP of the server (the computer in question), and the server is plugged in on eth1 to the router (for internet access) and eth0 to the rest of the network, to make sure packets go in the right direction do I need to have eth1 on 255.255.0.0 and my LAN 255.255.255.0 or can they both be 255.255.255.0.

Sorry if thats a bit confusing, Buck
 
Old 02-25-2006, 02:05 PM   #7
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
They both can be 255.255.255.0 but I would make one 192.168.1.0/24 and the other 192.168.2.0/24. Then using ipmasquerading to allow traffic from eth1 to eth0. Is this what you want to accomplish?

Brian1
 
Old 02-25-2006, 02:09 PM   #8
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
hello

i'm not sure about gentoo.

but on debian you can use a file called "/etc/mactab" to assign the name per mac address.

i also think you need to run "nameif" to make this work...

that said maybe you can do something with udev.

http://www.justlinux.com/forum/showt...547#post840547
 
  


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 you swap the eth0 and eth1 boot order? rankis1 Linux - Networking 3 03-15-2005 11:49 PM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
Firewall WAN eth0 LAN eth1 self-bridges, eth0 does all routeing. Nichole_knc Linux - Networking 5 07-29-2004 02:33 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

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

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