[Openswan Users] "Simple" ? Vpn setup
paul at xelerance.com
Thu Nov 18 22:06:29 CET 2004
On Thu, 18 Nov 2004, Nicolas Ross wrote:
> Does anybody can give me hint on why I end up with 2 default routes ?
>> conn testvpn
>> Destination Gateway Genmask Flags MSS Window irtt
>> nn.nn.nn.0 0.0.0.0 255.255.255.240 U 0 0 0
>> 0.0.0.0 nn.nn.nn.yy 220.127.116.11 UG 0 0 0
>> 18.104.22.168 nn.nn.nn.yy 22.214.171.124 UG 0 0 0
>> (only new routes are shown)
>> Why does ipsec need to add a new default route (second one) ?
Because the packets need to hit the IPsec machinery. This is currently done by
making them go into the ipsecX interfaces. Openswan needs to process all packets
with a certain source address (your left/rightsubnet). This method predates much
of the advanced routing (iproute) features, so since only destination based
routing was available at the time, the trick that has been used and is still in
use is to split the default route 0.0.0.0/0 in two (0.0.0.0/1 and 126.96.36.199/0, which
both are the entire default route) and route them into a ipsecX device. Since these
half routes are more specific then the default route, the kernel's routing
mechanism will send all packets into ipsecX. this then triggers the Openswan kernel
code to process these packets. Packets meant for an IPsec tunnel are encrypted, and
packets which are not part of a tunnel are released back into the normal routing
schema and send to the real default gateway.
We are looking at how we can use source based routing using 'ip rules' to change
this behaviour and remove the confusing half default routes.
In short, those routes are normal when using subnets.
More information about the Users