Link to home
Start Free TrialLog in
Avatar of Monitor Support
Monitor SupportFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Change order of route matching in Linux

Hello, do you know if it is possible to change the matching order for traffic.

I need to be able to change the matching order for VPN route policies.

Currently the local routing tables are processed first ('ip rule show' etc), and then NETKEY based IPSec VPN policies are matched.

I need to be able to define a backup static route (to provide redundancy to the VPNs) in the local routing tables that is matched AFTER the VPN route policies.

For example, if the IPSec (NETKEY based) VPN is established the VPN route policy will match first and the traffic will be routed through the tunnel etc.

If the IPSec VPN is NOT established, the traffic will NOT match any VPN route policy and the traffic will be routed via the local routing table instead.

How can this be done?

I am amazed that when NETKEY was being developed, it was designed with a total disregard for VPN redundancy. Hence I am trying to do this to provide a backup route for failed VPNs.

Does anyone know if there is a bulletin board or a specific community which develops the NETKEY libraries so I can ask this question there if no one here knows an answer?

Thanks in advance.
Avatar of Monitor Support
Monitor Support
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Alternatively and probably a better solution, would be to add the backup route to the 'Security Policy' table, instead of changing the matching orders.

'ip xfrm policy list' shows you the current security policies, as created by openswan when VPNs establish.

How can I use 'ip xfrm policy add ...' to insert the necessary backup 'Security Policy' to act as backup route when the openswan VPN tunnel policy is not in place?

Thanks in advance.
Avatar of arnold
Are you working on some appliance that runs under the linux OS?
I think the same vendor had a different VPN handling mechanism that supported what you need in kernel 2.4 but not in 2.6.
Hello,
Yes this is a Linux appliance.

In 2.4 it was easy as KLIPS was used which created IPSecX interfaces where X is a unique number etc. This then allowed for addition of local routing table entires.

However 2.6 uses NETKEY which has no regard for redundancy whatsoever as there are no IPSecX interfaces (meaning no backup routes and no ability to advertise established VPNs via dynamic routing). Instead the routing is done at a Security Policy level by the addition of an entry in the SPDB when the tunnel comes up (and deleted when the tunnel goes down).

As such I need to add a route to the bottom of the SPDB to act as a redundant path for a VPN.

Cheers for your time.
You should search EE, I think there was another similar issue where the user had TWO of those appliances (multi-WAN) and needed to setup a route between the two in the event a VPN from one dies so the load balanced traffic from the LAN will get to its destination.
https://www.experts-exchange.com/questions/24156403/How-can-we-configure-Linux-strongswan-to-advertise-remote-VPN-networks-when-established-via-RIP.html
Hi Arnold, that post as one of ours!

This is actually a continuation of the same problem however this time I am specifically trying to work out how to insert a Security Policy based route to implement your idea of a backup route.

Cheers, Andy.
:)

Good luck.
ASKER CERTIFIED SOLUTION
Avatar of Monitor Support
Monitor Support
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would think that the different approaches taken to address your question led to the solution which was to buy the requisite equipment to meet your needs.