Policy routing over IPSEC VPN
I'm having trouble with policy routes that use an IPSEC VPN as the outgoing interface. I'll try to provide an explanation as to why I'm doing this; if there's an easier way to do what I'm trying to do, maybe someone can point me in the right direction.
I have a simple hub-and-spoke topology, with my office as the hub. There are IPSEC VPN tunnels to different sites, and many of these sites use the same subnets (like 192.168.10.0/24). At this time, it is not feasible to change the IP scheme at each remote site to avoid conflicts. Since each of these remotes sites accesses a different subnet at my location, I thought policy routes would be an appropriate way route this traffic correctly. For example, Site A uses 192.168.10.0/24, and they access 10.1.1.0/24 at the hub. Site B might also be using 192.168.10.0/24, but they access 10.2.2.0/24 at the hub. Policy routes seemed like a good solution, since I could route traffic from 10.1.1.10/24 to Site A, and 10.2.2.0/24 to Site B, since the source IP would always be unique.
This is already working for one site, which I'll call site C. However, site C connects to my location via metropolitan ethernet, not a VPN tunnel. Site C utilizes 192.168.2.0/24, which conflicts with a local subnet at the hub. I created a policy route that sends traffic from 10.3.3.0/24 (local network at the hub) to 192.168.2.0/24 using a gateway address on the MoE circuit, and that works as intended; the traffic gets to site C, and not to the local 192.168.2.0 network. I assumed I could do the same for the sites connecting via VPN, but so far have had no success.
When I debug the traffic flow, I can see that the policy route simply isn't being matched when the outgoing interface is a VPN. Instead, it's matching the default route and being sent out the WAN. I've tried leaving the gateway address as 0.0.0.0, using my WAN next-hop address as the gateway address, and even using the address of the remote IPSEC gateway. No matter what I put there, if the outgoing interface is an IPSEC VPN, the policy route gets ignored.
So the tl;dr version of this is: is it possible to use an IPsec VPN tunnel as the outgoing interface in a policy route? If so, what address to I use as the gateway address?
The hub site is a Fortigate 500E running 6.0.1. The IPSec tunnels themselves work fine - while using static routes I can send traffic over the vpn with no issues. And these are interface-based VPNs, not policy-based VPNs. I'm happy to provide any additional information that'll help.
Thanks everyone,
Andrew
