Solved

Network Programming with two network cards

Posted on 1998-09-02
5
276 Views
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.
0
Comment
Question by:sengkiat
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:pestilence
Comment Utility
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
 
LVL 1

Expert Comment

by:pestilence
Comment Utility
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
 
LVL 1

Expert Comment

by:fmismetti
Comment Utility
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
 

Accepted Solution

by:
jguerin earned 100 total points
Comment Utility
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
 

Expert Comment

by:jguerin
Comment Utility
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now