Routing with two gateways

From: Matthias Haack (clearwater_at_bigfoot.com)
Date: 07/30/04


Date: Fri, 30 Jul 2004 19:33:55 +0200

Hi,

currently I am trying to setup my routing table to route everything
through the default gateway except for three networks which should be
routed through a vpn. My problem is that the second gateway lies within
one of the three networks.

Table that doesn't work (due to a cycle I think):

Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
A.B.0.0 W.X.Y.Z 255.255.0.0 U 0 0 0 tun0
C.D.0.0 W.X.Y.Z 255.255.0.0 U 0 0 0 tun0
W.X.0.0 W.X.Y.Z 255.255.0.0 U 0 0 0 tun0 <=X
0.0.0.0 10.0.0.138 0.0.0.0 UG 0 0 0 eth0

As long as line X is not within the table it works but without the
network W.X.0.0. With that line I think (i.e.) W.X.1.1 is routed to
W.X.Y.Z then line X matches again and so on...

Is there a way to set up this properly without replacing my default
route? Even using iptables would be fine...

Matthias



Relevant Pages

  • Re: VPN and remote gateway
    ... > It seems you use the wrong route add command. ... > when the VPN connection is established. ... > | using the remote network as my gateway. ...
    (microsoft.public.windows.server.sbs)
  • RE: Quickie... Hopefully!
    ... the interface two Ips with ifconfig and set the default route to our newest ... > via the 1.1.1.1 gateway. ... > addresses on the same NIC that are different networks. ... We are in the process of changing ISPs, ...
    (freebsd-questions)
  • RE: Quickie... Hopefully!
    ... both ISPs feeds end up coming into a hub/switch ... route on the machine would be 1.1.1.1 and all traffic goes there. ... via the 1.1.1.1 gateway. ... addresses on the same NIC that are different networks. ...
    (freebsd-questions)
  • RE: OT: Need some proxy advice
    ... IMO you'll probably have better results if you just route your outbound mail ... angry.su-networking.com (Corporate Torrent Transfer Networks on Windows) ... I have VPN routers at both locations and have managed to create a site ...
    (microsoft.public.windows.server.sbs)
  • Re: Adding Static route
    ... The server is a TS server for VPN clients. ... Our VPN does not have a problem because it will route ... back to the external IP of the client but the client cannot get to our ... I was thinking about putting the default gateway on the 172.xxx. ...
    (microsoft.public.windows.server.networking)