Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 328
  • Last Modified:

Network Programming with two network cards

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.
0
sengkiat
Asked:
sengkiat
  • 2
  • 2
1 Solution
 
pestilenceCommented:
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...
0
 
pestilenceCommented:
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...

0
 
fmismettiCommented:
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.
0
 
jguerinCommented:
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).
0
 
jguerinCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now