LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-25-2004, 02:22 AM   #1
sarah_t_s
LQ Newbie
 
Registered: Feb 2004
Posts: 10

Rep: Reputation: 0
Swapping eth0 & eth1?


Greetings,

I've recently overhaulled my home 'server' and it's developed a rather irksome problem (well it's not a problem but it's annoying if that makes sense?)

The machine is nForce2 based as has an integrated NIC that connects it to the rest of the network and an Realtek that connects it to the cable modem.

It's picking up the nForce2 NIC as eth1 and the Realtek as eth0, both work a-ok but I'd like the swap them around as I'm used to eth0 being LAN and eth1 being Cable.

I've limits experience of playing with Slackware and I have to ask if this is possible and if so how would I do it? Poked around google and search the forums here but not found anything I'm affraid.
 
Old 07-25-2004, 05:35 AM   #2
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
What does your /etc/modules file say?
 
Old 07-25-2004, 06:16 AM   #3
sarah_t_s
LQ Newbie
 
Registered: Feb 2004
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by markus1982
What does your /etc/modules file say?
It's blank I'm affraid:-

root@daedalus:~# cat /etc/modules.conf
root@daedalus:~#
 
Old 07-25-2004, 08:20 AM   #4
alexrait1
Member
 
Registered: Jul 2003
Location: Israel
Distribution: slackware current kernel 2.6.9
Posts: 70

Rep: Reputation: 15
/etc/modules doesn't exist in slackware.. instead it is placed in:
/etc/rc.d/rc.modules
that's the file he asked you to print.
 
Old 07-25-2004, 08:49 AM   #5
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Distribution: Fedora Core, Slackware, Mac OS X, Debian, OpenSUSE
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
/etc/modules.conf still exist.


Well, in the older days, you can pass arguments through lilo at boot-time to the kernel to assign eth0 and eth1 to which every NIC you like. Right now I can think of a few "tricks" BUT I have not tested them.

Trick 1quite sure it will work, not very safe)
Assign the onboard NIC IRQ_no to a bigger no for example 12/13. Before you do this, check what is your current IRQ mapped you can use lspci to check that. So that you do not assign a comflicting IRQ (shouldn't be a problem anymore since kernel can cope with share IRQ).
Edited: Safest is to swap the IRQ of realtech NIC to nforce and vice-versa. Do this in BIOS.

Trick 2: (more probable, not sure it will work)
Have both the NIC drivers compiled as modules.
Edit /etc/rc.d/rc.modules so that modprobe for the realtech NIC comes before the nforce NIC.
I am saying that this may not work since the kernel nowadays seems to be not relying on modules startup script fully.

Trick 3: (it is abit outdated, never got it working, but you may be able to)
Use the lilo to pass arguments to the kernel. Read Ethernet-Howto from www.tldp.org; the section where you can set up two-nics.

Trick 4: (SURE WORKS, with some pain)
Just live with it! It is seemless anyway, you won't need to know eth1 or eth0 when using the comp normally, only when you are doing configuration and maintance, you need to tweak your mind.

Cheers.

Last edited by carboncopy; 07-25-2004 at 08:52 AM.
 
Old 07-25-2004, 09:34 AM   #6
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
From what I remember, trick 2 worked for a friend I was helping, for some reason he wanted them swapped - since I guessed that whatever loaded first was eth0, I just moved the modprobes to suit. I'm pretty sure that's what worked :)
 
Old 07-25-2004, 11:14 AM   #7
HuMJohn
Member
 
Registered: Jun 2004
Location: California - home of Slackware
Distribution: Slackware
Posts: 59

Rep: Reputation: 15
Re: Swapping eth0 & eth1?

Quote:
Originally posted by sarah_t_s
Greetings,

I've recently overhaulled my home 'server' and it's developed a rather irksome problem (well it's not a problem but it's annoying if that makes sense?)

The machine is nForce2 based as has an integrated NIC that connects it to the rest of the network and an Realtek that connects it to the cable modem.

It's picking up the nForce2 NIC as eth1 and the Realtek as eth0, both work a-ok but I'd like the swap them around as I'm used to eth0 being LAN and eth1 being Cable.

I've limits experience of playing with Slackware and I have to ask if this is possible and if so how would I do it? Poked around google and search the forums here but not found anything I'm affraid.
Well, (assuming that you have hotplug running), both of these modules are loaded by the hotplug, in the order that the hotplug finds them. So, there is a way to force the order of loading of these two modules.

1. In /etc/hotplug/blacklist, enter the names of both of the NIC modules. Then in /etc/rc.d/rc.local, modprobe the two nic modules in the order that you prefer them to be loaded.

2. Second version, requires a little experimenting. Put the nForce module in the blacklist and also modprobe it in /etc/rc.d/rc.local. This will cause the nForce module to be loaded AFTER the Realtek.

(Number one is the simplest one to do and to maintain later on down the road, it makes it simpler to remember what and why you made this modification.)
 
  


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
how do i assign/switch eth0 & eth1 the-sloth Linux - Networking 10 02-05-2011 12:48 PM
Swapping cables to eth0 & eth1 on the same machine still works. Why? ses Linux - Networking 2 06-07-2005 01:31 AM
Eth0 & Eth1 boot start Up FAILED.. PAOLO_GRS Linux - Networking 1 09-03-2004 07:18 PM
eth0 & eth1 switched superbondbond Linux - Hardware 5 12-12-2003 08:59 AM
how to set which NIC is eth0, & which is eth1 roshko Linux - Networking 4 09-01-2003 11:08 AM


All times are GMT -5. The time now is 03:51 AM.

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