Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 networking cards, all data sent through one
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
boltronics
n00b
n00b


Joined: 25 Nov 2002
Posts: 49
Location: Melbourne, Australia

PostPosted: Tue Feb 11, 2003 12:48 am    Post subject: 2 networking cards, all data sent through one Reply with quote

Hi all. I've been trying various GNU/Linux distributions for ages, but now I think I'll be hooked on Gentoo for life.

Anyway, I've never networked 2 cards before. Neither card is a module (a monolithic kernel) and both appear to be configured correctly in /etc/conf.d/net:

iface_eth0="192.168.1.15 broadcast 192.168.1.255 netmask 255.255.255.0"
iface_eth1="192.168.1.50 broadcast 192.168.1.255 netmask 255.255.255.0"
gateway="eth0/192.168.1.10"
gateway="eth1/192.168.1.10"

ifconfig seems to confirm that both cards are correctly installed and configured. I can ping both 192.168.1.15 and 192.168.1.50 from any machine on the local network, and all appears to work. Something at this stage caught my eye however: the hub indicates that only one card is actually being used. Pulling the one cable confirms it: I cannot access the machine at all (from another computer). Why can't it use the other card?

Is this because the Linux kernel knows that it's the same network reachable via both cards (and hence ignores the second)? Or have I misconfigured something?

Thanks.
_________________
"Free" as in "free speech", not as in "free beer".
GPG key ID: 0x78FDC750
Back to top
View user's profile Send private message
cram
Guru
Guru


Joined: 17 Nov 2002
Posts: 312
Location: Saskatoon, Canada

PostPosted: Tue Feb 11, 2003 1:07 am    Post subject: Reply with quote

You would need to recompile your kernel with support for ECMP as well as some configuration with iproute2. I've never done this but I imagine it might be a bit difficult if you've never worked iproute before.

btw, I understand using two cards on a gateway machine if you have access to two internet connections but I'm curious why you're doing this on an internal box, do you really need to double your bandwidth within the lan?
_________________
aaarggghhhh.
Good point Chewie.
Back to top
View user's profile Send private message
boltronics
n00b
n00b


Joined: 25 Nov 2002
Posts: 49
Location: Melbourne, Australia

PostPosted: Tue Feb 11, 2003 1:23 am    Post subject: Reply with quote

OK. Thanks a lot for your help - I'll look into it.

As for two cards (and not being a gateway), it's actually only a temporary testing setup. It's going to be a webserver. One will be the public connection, and another will be to a local network for backup/fallover purposes.
_________________
"Free" as in "free speech", not as in "free beer".
GPG key ID: 0x78FDC750
Back to top
View user's profile Send private message
cram
Guru
Guru


Joined: 17 Nov 2002
Posts: 312
Location: Saskatoon, Canada

PostPosted: Tue Feb 11, 2003 1:54 am    Post subject: Reply with quote

Quote:
One will be the public connection, and another will be to a local network for backup/fallover purposes.

hmm, I think I've misunderstood of of your posts.
ECMP and the other stuff I mentioned are only usefult if you want load-balancing, ie. a box with two connections to the same network, presumably for the purposes of increasing overall bandwidth. However, If you intend to have a box with one card for one network (the internet), and the other card for another network (your lan), then please ignore what I said about ECMP.
_________________
aaarggghhhh.
Good point Chewie.
Back to top
View user's profile Send private message
boltronics
n00b
n00b


Joined: 25 Nov 2002
Posts: 49
Location: Melbourne, Australia

PostPosted: Tue Feb 11, 2003 2:01 am    Post subject: Reply with quote

Ok. Thanks anyway. I don't have access to two different networks simultaneoulsy to test, however I'm just trying to verify that the second card will function as expected when server goes live.

Come on guys ;) Somebody out there must think it's weird that when I pull one cable, I loose my connection to both cards?
_________________
"Free" as in "free speech", not as in "free beer".
GPG key ID: 0x78FDC750
Back to top
View user's profile Send private message
Carlos
Guru
Guru


Joined: 07 Aug 2002
Posts: 458
Location: Providence, RI

PostPosted: Tue Feb 11, 2003 2:46 am    Post subject: Re: 2 networking cards, all data sent through one Reply with quote

boltronics wrote:
Is this because the Linux kernel knows that it's the same network reachable via both cards (and hence ignores the second)? Or have I misconfigured something?
It's really very simple, and should become apparent if you do a "netstat -rn". This is the internal process that happens when routing needs to be done:
  1. Application decides that it wants to send packets to a.b.c.d, and sends a message to the kernel.
  2. Kernel looks at the routing table from top to bottom until it finds a route that matches your IP address.
  3. Kernel sends the packet to the corresponding gateway in the routing table.
The important thing to know is that each route has a network interface associated with it. To use two network cards for the same route needs the kind of complicated stuff cram has been describing.

If you're using a computer as a gateawy, it's simpler: you'll associate different routes to each of the two interfaces, and it'll work swimmingly. Load balancing is more involved.
_________________
Man must shape his tools lest they shape him.
Back to top
View user's profile Send private message
krusty_ar
Guru
Guru


Joined: 03 Oct 2002
Posts: 560
Location: Rosario, Argentina

PostPosted: Tue Feb 11, 2003 1:53 pm    Post subject: Reply with quote

if you wasnt to be absolutely sure that both connections work you can do three things

1) delete teh route from the card that is getting all the trffic, that way the kernel will choose the other (ok, not to realistic)

2) check the ping man, there's a way to force the traffic trough one specific interface (probably a specific ip too). if it's going to be a webserver, set httpd to listen on one ip and then the other

3) from the other machines, ping both ip's of that box (not too sure what failures can be determined with this one)

you can think of more probably
_________________
I am Beta, don't expect correct behaviour from me.
Take part of the adopt an unaswered post initiative
Back to top
View user's profile Send private message
boltronics
n00b
n00b


Joined: 25 Nov 2002
Posts: 49
Location: Melbourne, Australia

PostPosted: Wed Feb 12, 2003 12:10 am    Post subject: Reply with quote

Carlos, thanks for the netstat command info - very helpful. Armed with this information, I'm sure I wont have any problems when we go live.

Krusty_ar:
1. Tried that. The card works fine when that is done (confirming what Carlos said).
2. I tried ping with the -I switch (interestingly left out of the manual).
Even though I I use the commands:
ping -I 192.168.1.15 192.168.1.10
ping -I 192.168.1.50 192.168.1.10
they both work through the same card. It still looks at the Kernel IP routing table.
3. Pinging both IPs from other computers still use the same network interface, too.

Thanks all - very useful advice.
_________________
"Free" as in "free speech", not as in "free beer".
GPG key ID: 0x78FDC750
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum