Solved

Network Programming with two network cards

Posted on 1998-09-02
5
283 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
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...
0
 
LVL 1

Expert Comment

by:pestilence
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...

0
 
LVL 1

Expert Comment

by:fmismetti
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.
0
 

Accepted Solution

by:
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).
0
 

Expert Comment

by:jguerin
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

932 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

15 Experts available now in Live!

Get 1:1 Help Now