multiple NICs (was: Re: Embarrassing question)
kauer at biplane.com.au
Tue Jun 6 04:04:53 UTC 2006
On Tue, 2006-06-06 at 03:23 +0100, Travisty wrote:
> I too have seperate networks. one for internet (192.168.0.1) and one
> intranet (192.168.11.11). It always wants to use the default geteway
> device. Despite having 2 NICs I can only access a single network at a
> time. I am curious as to what soulutions are available to access both.
Does your computer route packets between the two networks? If not, you
will be able to see both networks from your computer, but other hosts in
one network will not be able to see hosts in the other network. So make
sure your computer is forwarding packets. Do this as root:
echo 1 > /proc/sys/net/ipv4/ip_forward
You can make this permanent by making one of your startup scripts repeat
the exercise, or by putting this line in /etc/sysctl.conf (I think):
net.ipv4.ip_forward = 1
And obviously make sure that any iptables packet filtering you may have
is not dropping stuff you need!
Can you ping both interfaces? If yes, the basics are in place. Can you
ping other devices on both networks? If yes, it's probably just
routing/forwarding that's the problem. You say you can "access a single
network at a time" = what exactly does that mean? What do you have to do
to "see" a network?
If your computer can ping both interfaces, but can't see both networks,
send us the output from "ifconfig" and the output from "netstat -rn".
Any device will typically have only one default route. But it should
have, in addition, one route for each network it is on.
"netstat -rn" should show something like this (Flags, MSS, Window and
Kernel IP routing table
Destination Gateway Genmask Flags Iface
192.168.0.0 0.0.0.0 255.255.255.0 U eth1
192.168.1.0 0.0.0.0 255.255.255.0 U eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG eth0
This says that stuff to 192.168.0.0/24 should go out eth1, stuff to
192.168.1.0/24 should go out eth0, and anything else goes to
192.168.1.1. You should be able to reach anything on either network
through the interface on that network, but traffic for the outside world
will go via 192.168.1.1.
These routes should appear automagically as the network interfaces are
Karl Auer (kauer at biplane.com.au) +61-2-64957160 (w/h)
http://www.biplane.com.au/~kauer/ +61-428-957160 (mob)
More information about the ubuntu-users