Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dual ISA network cards?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
incubus
n00b
n00b


Joined: 12 Dec 2002
Posts: 20
Location: Sheffield, UK

PostPosted: Mon Jun 02, 2003 6:55 pm    Post subject: Dual ISA network cards? Reply with quote

Hi there,

I currently have a NetPilot (don't ask) acting as a gateway for my home LAN, although I put gentoo on it some time ago. i586, baby!

It has dual ISA network cards (both NE2000 models) and I do packet filtering and forwarding. My current setup loads the cards up fine (I have it compiled into the kernel and a module as I recompiled the same kernel revision a couple times until I got things working, and I know the IO and DMA settings for both cards.

Now, I need to recompile my kernel for a number of reasons, security updates and tc are a couple of them. The problem I'm getting is that it's loading the cards in the wrong order (so my eth0 becomes my eth1, and vice versa). This is a royal pain in the ass for a number of things I have running, not to mention that one of the network cards is plugged into my cablemodem for DHCP.

Is there any way I can specify which card gets which device name? (eth0/eth1)? I've done a lot of searching and I'm at my wit's end.

Please help if you can ... :-)

incubus
_________________
Drink like it's payday
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Mon Jun 02, 2003 8:08 pm    Post subject: Reply with quote

I recommend doing it with modules for the network cards. The relevant trick is you can actually load two copies of the module, giving the second one a different name. Example:

insmod -o ne2000c1 ne2000 io=0x300 irq=5
insmod -o ne2000c2 ne2000 io=0x310 irq=7

The one you load first should become eth0.
Also, in practice, I think you usually only need to specify the io port value - irq should be autodetected... not sure about dma but I didn't think network cards used it, at least the ones I've seen.


Hope this helps - good luck
Back to top
View user's profile Send private message
incubus
n00b
n00b


Joined: 12 Dec 2002
Posts: 20
Location: Sheffield, UK

PostPosted: Mon Jun 02, 2003 8:26 pm    Post subject: Reply with quote

BradN wrote:
I recommend doing it with modules for the network cards. The relevant trick is you can actually load two copies of the module, giving the second one a different name. Example:

insmod -o ne2000c1 ne2000 io=0x300 irq=5
insmod -o ne2000c2 ne2000 io=0x310 irq=7

The one you load first should become eth0.
Also, in practice, I think you usually only need to specify the io port value - irq should be autodetected... not sure about dma but I didn't think network cards used it, at least the ones I've seen.


Hope this helps - good luck


When you say different names, you mean I'd just do

Code:
#cp -a /usr/lib/modules/{kernel}/net/whatever.o /usr/lib/modules/{kernel}/net/whatever2.o


Is that possible?

And sorry, I meant IRQ, not DMA. You sir are a champion! I'll try that when I get home ... cheers!

incubus
_________________
Drink like it's payday
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Mon Jun 02, 2003 8:42 pm    Post subject: Reply with quote

Nope, you don't even have to copy the module file. Just use the -o option, and it changes the name it gives the module in memory (you can see this with lsmod).

You might be able to make another copy of the actual module file and do it that way, but there's no real need for it.

good luck
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Mon Jun 02, 2003 9:30 pm    Post subject: Reply with quote

This is just something you have to live with if they're both the same driver. Some drivers put them in a specific order (3c50x seems to order them by mac addresses), so you could always add a patch to the driver. I'd say just "suck it up." It happens, but it's quite infrequent. The kernel guys try to make sure that the order doesn't change. Sometimes it does (between 2.2 and 2.4 I think it did) but it's not like it happens between minor releases.

If you DO find a good way to do it though (short of using module aliases that specify the irq and such as suggested above) please share with us, because that would be very handy.
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum