Adding a route for an internal network on a second NIC

Karl Hegbloom hegbloom at pdx.edu
Tue Jun 6 03:43:10 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.

Assuming that you have 'iproute' installed, show us the output of:

 ip route show

You need to have a route configured for each network.  The default route
is for anything not matched by any more specific routes.

 ip route help

... will show you a brief syntax help screen.  Try something like (off
the cuff, not tested) the following, to add a route to the 192.168.11.0
network through eth1, assuming that's the correct device:

 sudo ip route add 192.168.11.0/24 src 192.168.11.11 dev eth1 protocol static

Replace 'add' with 'del' to delete the route.  You can put these
commands into the /etc/network/interfaces file... RTFM "interfaces" for
details.

See also:  The 'ip' man page, and the relevant HOWTO documents at the
Linux Documentation Project web site.

-- 
Karl Hegbloom <hegbloom at pdx.edu>





More information about the ubuntu-users mailing list