Network Programming with two network cards

Posted on 1998-09-02
Last Modified: 2010-03-18
I am using a LINUX system and am trying to configure it to accept two network cards. They are both 3c509. I am using Redhat. Does anyone have experienced with this?

How do I do network programming such that I can choose
to access via whichever network card and send by another network card. Can the normal socket programming do this?

Please advise thanks.
Question by:sengkiat
  • 2
  • 2

Expert Comment

ID: 1586625
Hmm since the cards are the same, it might bring up a conflict problem, that Linux is also a bit tricky when assigning IRQ's and stuff like that, i would suggest a small experiment on a small useless box...
even thoough i am afraid that the cards will use also the same memory blocks, eben i you succed making them wrk together, yoou might experience varioous and serious prblems with stacks...

Expert Comment

ID: 1586626
sorry for the bad language...but i am posting from my "useless" box :) and this keyboard has certain problems with some keys...lolz ...hehe wonder why i failed login so many times...


Expert Comment

ID: 1586627
I have a system with two net cards working well. One card sees the Internet by a router and the other sees my internal network. My linux box does the routing between the nets, using IP masquerade.

Well, I am using Slackware, not Red Hat. Anyway, you need to configure the cards to be different. I am using NE2000 clones with jumpers, maybe you need the config disks for your boards. I defined one to use IRQ 5, IO 300h and the other as IRQ 10, IO 340h.

Then I configured both cards to be detected at boot time, defining in the /etc/lilo.conf file:

append="ether=5,0x300,eth0 ether=10,0x340,eth1"

Then you need to adjust the rc.inet1 to have ifconfig commands for eth0 and eth1. Also you need to adjust your routes. I figured out looking in the NET-3 Howto.

Good luck.

Accepted Solution

jguerin earned 100 total points
ID: 1586628
Ok buddy here's what you do. First off, compile in the network drivers as modules under "make menuconfig". It's the default option, so you may not have to.

Open your /etc/conf.modules  file and enter this:
alias eth0 3c509
alias eth1 3c509
options eth0 -o 3c509-0 io=<base addr>
options eth1 -o 3c509-1 io=<base addr>

You might also try:
alias eth0 3c509
alias eth1 3c509
options 3c509 io=<base addr first card>,<base addr second card>

I'm not sure of the status of the 3c509 driver, some drivers let you do the second option and some don't. In either case the first one should work.

Now before you go rebooting and all, make sure that inside of your  /etc/sysconfig/network-scripts directory you have both a ifcfg-eth0 and an ifcfg-eth1 file.
These files are what ifconfig looks in for the network info of each card when it boots. If you only see an ifcfg-eth0, then copy it to ifcfg-eth1 and edit the inside to match the settings of the second card. You're a smart person I'm sure you can figure it out (not hard).

Expert Comment

ID: 1586629
Ah by the way all of the info I just sent you can be found in the Ethernet-Howto at       Under the support > howto tabs you see when you first connect. I believe it's under section 3 or 4 of the howto, entitled "Using Multiple Ethernet Cards". You can have a look if I confused you any.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
linux / python expert needed 3 98
Cant reach dockers repository (pull command) 11 92
linux, squid, exchange 14 175
best simple nfs export and fstab commands for basic sharing? 3 80
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question