Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Network Programming with two network cards

Posted on 1998-09-02
Medium Priority
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 200 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
www.linux.org       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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

572 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