Two routes to a host: how to make sure which noe is used when?
- From: Stefan Monnier <monnier@xxxxxxxxxxxxxxxx>
- Date: Thu, 23 Nov 2006 18:18:01 -0500
I recently bumped into a problem with my VPN:
I've setup my networking as follows:
+-----------+ +----------+
| mymachine |---192.168.1.13--> | myrouter |---> The world
+-----------+ +----------+
|
| +-----------------+
+--vpnNNN.domain--> | Some VPN server |---> *.domain
+-----------------+
Some IP range (corresponding to *.domain) goes through the VPN, but the
default routing rule is to go straight to my router. Plus some addresses in
*.domain are special cased to go via the router: these are machines visible
from outside and I don't want connections to these machines to die/hang when
I start/stop the vpn tunnel. One of those addresses is the VPN server itself.
I.e. the routing table looks like this:
% route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
AAA.BBB.CCC.DDD 192.168.1.1 255.255.255.255 UGH 0 0 0 eth1
AAA.BBB.EEE.FFF 192.168.1.1 255.255.255.255 UGH 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
AAA.BBB.0.0 0.0.0.0 255.255.0.0 U 0 0 0 ppp0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
%
AAA.BBB.CCC.DDD is the VPN server and AAA.BBB.EEE.FFF is the IMAP server.
This usually works just dandy, except when AAA.BBB.EEE.FFF or
AAA.BBB.CCC.DDD tries to connect to my VPN-address (i.e. vpnNNN.domain):
- the packets coming from toto.domain reach me fine through the VPN.
- but my replies seem to be sent via the router.
I've tried to add a "src" specification to my routing (using the `ip route'
command):
% ip route
AAA.BBB.CCC.DDD via 192.168.1.1 dev eth1 src 192.168.1.13
AAA.BBB.EEE.FFF via 192.168.1.1 dev eth1 src 192.168.1.13
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.13
AAA.BBB.0.0/16 dev ppp0 scope link src AAA.BBB.NNN.MMM
default via 192.168.1.1 dev eth1
%
but it doesn't seem to help. Any idea what I should do?
Stefan
.
- Follow-Ups:
- Re: Two routes to a host: how to make sure which noe is used when?
- From: Clifford Kite
- Re: Two routes to a host: how to make sure which noe is used when?
- From: Unruh
- Re: Two routes to a host: how to make sure which noe is used when?
- Prev by Date: socket lib with IGMPv3 support
- Next by Date: Re: Two routes to a host: how to make sure which noe is used when?
- Previous by thread: socket lib with IGMPv3 support
- Next by thread: Re: Two routes to a host: how to make sure which noe is used when?
- Index(es):
Relevant Pages
|