LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Loading 2nd network card (https://www.linuxquestions.org/questions/linux-networking-3/loading-2nd-network-card-14472/)

JHuizingh 02-17-2002 11:26 PM

Loading 2nd network card
 
I am trying to get a linux box set up to use IP Masquerading. RIght now I am stuck at getting both of the NIC's loaded. The first NIC is a PCI card, and this one is loaded fine at boot. The second card is an ISA card. How do I go about finding the hardware address of this card so I can load it manually?

finegan 02-18-2002 05:58 PM

ISA cards are always a bit of a pain. In order to get the module to load, you'll probably have to pass it some values, usually an IRQ and an i/o setting. For instance:

insmod 3c509 irq=12

What kind of card is it? Also, cat /proc/interrupts to see what IRQs are already used.

Cheers,

Finegan

JHuizingh 02-18-2002 06:12 PM

The Card is a 3com 3C509B card.

Anyways, when I made the first post, the PCI card was all set up, and I was able to connect to the network. Since then I have not been able to get either network card working properly. I have tried both combinations of taking a network card out and leaving the other one in. Neither of them is working. Right now it is getting really frustrating... Any suggestions????

finegan 02-18-2002 06:16 PM

Wow... I guess the model, that's nifty. For the ISA card, 'insmod 3c509 irq=x', where x is an un-used number in /proc/interrupts.

Pop the PCI card back in and run netconfig, and let Slackware's cute little utility find the card.

Cheers,

Finegan

JHuizingh 02-18-2002 08:35 PM

Netconfig is not detecting the card anymore, but it was before I posted the original post of this thread. I really have no idea why it's doing this.... What's the best way to start all over? I am really confused.

finegan 02-19-2002 11:26 AM

Keep em both in there, fight them both at once!

Did the ISA card take its module?

What is the model of the PCI card?

If the PCI card worked once, its just a matter of hammering that module in again.

What is the current output of 'ifconfig' with both cards after you try to bring up eth0 and eth1? Just 'lo'?

Cheers,

Finegan

JHuizingh 02-19-2002 12:39 PM

I'm not at the computer right now, so I'm not sure what the output of ifconfig is, but I can give you some info. When I run netconfig now, it says that it can't find any network adapters. Also, if i do lsmod, 3c509 is loaded and it is used by "0". If I do rmmod and then modprobe 3c509, and then lsmod, it says 3c509 is unused. I'll get back to you on the ifconfig output when I back to that comoputer.

finegan 02-19-2002 12:45 PM

Okay this makes sense now. If the 3c509 module hadn't been bound to the card, either it would have said: (unused) in lsmod, or really I'm almost certain is more the case: it wouldn't have loaded at all. The module for the ISA card has loaded. To bring it up use 'ifconfig eth0 xxx.xxx.xxx.xxx up'
where the xxx's are the IP address.

This is also why netconfig is getting confused. It loads and configures the info for eth0, which you already have done, so it doesn't see the PCI card which is eth1 now... probably. Mostly this is a matter of figuring out what kind of card the PCI card is to hand load the module, edit rc.modules by hand, and then everything should come up right from now on at boot.

Cheers,

Finegan

JHuizingh 02-21-2002 09:00 AM

Well, I've only screwed around with it a little bit the past two days, but I figured some things out. First of all, the kernel is detecting the ISA card because it loads the correct module, but something is not quite right when setting it up. How do I know what io= address to assign to it? How would I get it to set up by DHCP server instead of me giving it an IP address? Also, I'm not sure if it is calling this card eth0 or not, how do I figure that out? When I do ifconfig it only shows lo.

Also, my PCI card is a DLink 530TX+. THere are a number of versions of this card: A, B, C, D1, and D2.... A, B, and C, are all supported by drivers which come with the kernel. D1, which I have, requires that I compile a kernel module from code that comes on the cd with the card. I will work on this when I get some free time.

I'll keep you posted on my progress. Thanks for the help so far.

finegan 02-21-2002 05:38 PM

I'm willing to bet my next smoke break that the 3com card is up and ready to go:

Try bringing up eth0 and see what happens:

'ifconfig eth0 up'

Or, to have it grab an IP via dhcp:

'dhcpcd eth0'

To deal with the Dlink card... these jokers keep changing chipsets between minor card revisions: you might want to try and modprobe via-rhine, tulip, rtl8139... I think its one of those. If it worked before, there's no reason to try and jump through the hoops of compiling their poorly hacked drivers.

Also, to see if everything registered correctly:

'dmesg'

This shows the entire log of the kernel registering devices... from the RAM down to the Nic. The 3Com 509 does not need to be assigned an input/output address, it can autonegotiate that... it just needed that free IRQ, which you gave it.

Cheers,

Finegan

JHuizingh 02-22-2002 02:19 AM

YESSS!!!!! I finally got it working. I hate to tell you this, but the root of my problems was when I took out the PCI network card, and then when I put it back in, I didn't push it in hard enough (you need to push it in really hard in this mobo), so it wasn't actually "IN" the computer. On the bright side, I did learn a whole lot about networking in linux :). After all, isn't that what it's all about?

Also, one thing that was weird is that when I did "modprobe 3c509 irq=x", it would assign irq 10 to that card no matter what i put for x. After I did "insmod 3c509 irq=7", it finally worked. Some of the irq's that weren't listed in "cat /proc/interrupts" still seemed to be taken up, but 7 was free, so I'm happy.

Thanks for all your help.

One strange thing that is happening:
During the boot process, the /etc/rc.d/rc.inet1 script tries to configure eth0 (the pci card) by the command /sbin/dhcpcd, but the command times out and it doesn't get configured. It works fine after the login prompt comes up and I log in as root and run the exact same command. I put that command in /etc/rc.local and it didn't work either. Same with "ifconfig eth1 192.168.0.1 up". They both work when I type it in at the comand line though. Can you explain why it's not working on boot, and/or help explain what I can do so that it configures automatically?

finegan 02-22-2002 04:30 AM

I never point out the 'check your hardware' aspect. I did once and got a flame reply... followed much later, on a different thread, with a sly apology. Its just not possible to point that out without sounding like a jackass. Something about a dead eth cable... anyway.

If its not coming up in rc.local then something's really screwy. This is how I do all net configuration as rc.local is a standard among Slack, RedHat, and Mandrake, which is about all I install these days.

First off, in order to get those card's modules loaded in bootup, look in /etc/rc.modules and un-comment (remove the '#') from infront of their modprobe line. The PCI card's line should already be uncommented by the netconfig script. You'll have to add the irq=7 bit after the 3com's entry, which is probably already there.

Second, edit /etc/modules.conf with

alias eth0 nameofmodule
alias eth1 3c509


Third, from there, by the time rc.local gets run (which is dead last), you should be able to put these lines in:

/sbin/dhcpcd eth0
/sbin/ifconfig eth1 192.168.0.1 up
<---Masq rules here--->

Hopefully that will get everything loaded that needs to be at the right times. Using rc.local is always frowned upon as a ghetto-riffic hack, but its my preferred method of network start-up. Let RedHat and the like keep building buggy scripts...

Cheers,

Finegan

JHuizingh 02-22-2002 12:50 PM

OK, I"m making some progress. I've got it so the 3com card gets configured by rc.local with that /sbin/ifconfig call.

The "dhcpcd eth0" command is right before that, and the system just stops for about a minute (i presume because the dhcp request is timing out). When I log in and type it at the command line it works fine though...

Also, I don't think the entries in /etc/modules.conf are doing anything. I had the modules in a different order in /etc/rc.d/rc.modules, and the alias names for the cards were switched... Here's what I have
alias eth0 8139too
alias eth1 3c509

Any idea what's up?

JHuizingh 02-23-2002 02:14 AM

I did it!!! It works without any interaction upon boot!!

I'm still not sure what's up with dhcpcd, but it only works the second time it is run. I put these lines in rc.local and now dhcpcd configures the card:

/sbin/dhcpcd eth0 -t 1
/sbin/dhcpcd eth0 -t 5
sh /sbin/startipmasq #A little script i made

Talk about your ghetto way of doing stuff :).

If you have any idea what's up with the dhcpcd, let me know. Otherwise, thanks a lot for you help finegan. I guess I'm pretty happy now that it's over since everything possible went wrong, and now I know a lot about the boot process :).

finegan 02-23-2002 02:44 AM

That is rather odd. Go ghettoriffic!

My best rc.local is 26 lines long and kicks out about 2-3 errors before I get the login prompt... it works... beats me what's error'ing out.

Good luck, and if you want to lose folicles to networking, go wireless next!

Cheers,

Finegan


All times are GMT -5. The time now is 05:46 PM.