View previous topic :: View next topic |
Author |
Message |
boltronics n00b
Joined: 25 Nov 2002 Posts: 49 Location: Melbourne, Australia
|
Posted: Tue Feb 11, 2003 12:48 am Post subject: 2 networking cards, all data sent through one |
|
|
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 |
|
|
cram Guru
Joined: 17 Nov 2002 Posts: 312 Location: Saskatoon, Canada
|
Posted: Tue Feb 11, 2003 1:07 am Post subject: |
|
|
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 |
|
|
boltronics n00b
Joined: 25 Nov 2002 Posts: 49 Location: Melbourne, Australia
|
Posted: Tue Feb 11, 2003 1:23 am Post subject: |
|
|
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 |
|
|
cram Guru
Joined: 17 Nov 2002 Posts: 312 Location: Saskatoon, Canada
|
Posted: Tue Feb 11, 2003 1:54 am Post subject: |
|
|
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 |
|
|
boltronics n00b
Joined: 25 Nov 2002 Posts: 49 Location: Melbourne, Australia
|
Posted: Tue Feb 11, 2003 2:01 am Post subject: |
|
|
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 |
|
|
Carlos Guru
Joined: 07 Aug 2002 Posts: 458 Location: Providence, RI
|
Posted: Tue Feb 11, 2003 2:46 am Post subject: Re: 2 networking cards, all data sent through one |
|
|
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:- Application decides that it wants to send packets to a.b.c.d, and sends a message to the kernel.
- Kernel looks at the routing table from top to bottom until it finds a route that matches your IP address.
- 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 |
|
|
krusty_ar Guru
Joined: 03 Oct 2002 Posts: 560 Location: Rosario, Argentina
|
Posted: Tue Feb 11, 2003 1:53 pm Post subject: |
|
|
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 |
|
|
boltronics n00b
Joined: 25 Nov 2002 Posts: 49 Location: Melbourne, Australia
|
Posted: Wed Feb 12, 2003 12:10 am Post subject: |
|
|
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 |
|
|
|