Re: Networking troubles with multiple nics
On Sun, Mar 30, 2003 at 01:23:09PM -0600, Eric Eelkema wrote:
> Hi,
>
> I have a 486 with three 3c509 cards set up as a router. It
> took some work to get the cards on different IRQs, but I
> think I did that correctly, and all of them work individually.
> The problem is, when I bring up both interfaces to the internal
> network, the one I bring up first works, but the other doesn't.
> Has anyone had this problem before? More importantly, what can
> I do to fix it?
>
> More info:
> Router eth0 is dhcp, connected to the cable modem
> eth1 is 192.168.1.3
> eth2 is 192.168.1.4
> Internal computer A has eth0 192.168.1.1 connected to 192.168.1.3
> Internal computer B has eth0 192.168.1.2 connected to 192.168.1.4
>
[ snip ]
> The state of the router's eth0 doesn't seem to make any difference
> (and it works just fine). Any pointers to what the problem could
> be are much appreciated. Thanks in advance.
I don't mean to be rude, but it is fairly clear that you don't
understand IP networking or routing.
Briefly, here's what's wrong with your setup:
linux (and most operating systems for that matter) expect each
interface to exist on a distinct network. However, you have one
logical network (192.168.1.0/24) that you've "divided" across two
interfaces (eth1 and eth2). Furthermore, you've addressed your
machines in such a way that your setup will never work without major
surgery.
Solutions:
1) Buy a cheap hub or switch, plug eth1, A, and B into it, and forget
about eth2.
2) assign seperate networks to eth1 and eth2 (and by inference, A and
B). Something like this in /etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.1
network 192.168.1.0
netmask 255.255.255.252
broadcast 192.168.1.3
auto eth2
iface eth2 inet static
address 192.168.1.5
network 192.168.1.4
netmask 255.255.255.252
broadcast 192.168.1.7
Then, you must configure A with address 192.168.1.2, netmask
255.255.255.252, gateway 192.168.1.1; and B with address 192.168.1.6,
netmask 255.255.255.252, gateway 192.168.1.5.
3) You could set up eth1 and eth2 as a bridge. This requires
software and kernel options that may not be stable, and is the really
hard way to do #1 (though you'll save $20).
If I were you, I'd implement #1, and then spend some time reading the
networking HOWTO. Everyone started there (or someplace similar) at
one time.
Good luck!
--
Nathan Norman - Incanus Networking mailto:nnorman@incanus.net
Great minds discuss ideas, average minds discuss events, small
minds discuss people.
-- Laurence J. Peter
Reply to: