Re: Multiple ethernet cards
I've been experimenting with this stuff, too. So maybe I can help you
I put two ethernet cards in my pc. However, i can't
ping a remote host from both interfaces (eth0,eth1, after
swapping the cable over).
I assume you mean a computer that is not in your own network. If that is
the case, you are completely right. To reach a computer beyond the
specified routes in your routing table, you have to specify a default
route. This however, is only possible to specify for one inteface as
long as you use the standard 'route' tool. Try the iproute package and
read Advanced Routing HOWTO on tldp.org. But I don't see why you need
this complex setup.
If the "remote host" is a computer at your LAN, then you've got
something set up wrong.
If i disable one interface, then i can ping from the
other. Both cards are pci of different brands.
By disable, do you mean a) ifdown or do you also b) remove the module?
The difference could be a) routing problems and for b) rescource conflicts.
I've tried giving both cards the same address and
different addresses.
I think it's because of the routing. netstat -rn:
Kernel IP routing table
Destination Gateway Genmask Flags Iface
210.50.118.58 0.0.0.0 255.255.255.255 UH ppp0
0.0.0.0 210.50.118.58 0.0.0.0 UG ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U eth0
192.168.0.0 0.0.0.0 255.255.255.0 U eth1
I want to connect two PCs to the 3rd gateway PC.
So this is the 3rd computer? And you want the following setup?:
Computer0 eth0 <-> eth0 Gateway PC ppp0 <-> ISP
Computer1 eth0 <-> eth1 ''
And you don't want to use a hub/switch for the internal network, right?
So then you'll have to use different address spaces for eth0 and eth1,
otherwise it will use the first one even if the desired computer is on
another interface. It might be possible to have the addresses in the
same space by specifying more rules (eg. 192.168.0.2/32 on eth0,
192.168.0.3 on eth1) but I don't see why it would be worth the extra
work. If you have simple address spaces, you won't have to touch the
routing table.
One computer could be 192.168.0.2, the other 192.168.1.2. The gateway
would then be for example 192.168.0.1 and .1.1.
I see the first part of my answer wasn't really what you were looking
for, but just in case...
hth,
/johan
--
Johan Ehnberg
johan@ehnberg.net
"Windows? No... I don't think so."
Reply to: