Policy-based vs route-based IPsec VPN: which to use

Both use the same IKE and ESP. The difference is how the gateway picks the traffic to encrypt: a list of subnet pairs, or the routing table and a tunnel interface.

Policy-basedRoute-basedtraffic selectors# what to encryptlocal 192.168.10.0/24remote 10.10.0.0/16local 192.168.20.0/24remote 10.10.0.0/16tunnel interface# selectors 0.0.0.0/0interface ipsec0route 10.10.0.0/16 via ipsec0route 10.20.0.0/16 via ipsec0# + firewall rules on ipsec0same IKE and ESP · different traffic selection

The short answer

A policy-based VPN encrypts packets that match a list of source and destination subnets. A route-based VPN creates a tunnel interface and encrypts whatever the routing table sends into it. Both are standard IPsec and use the same IKE and ESP underneath; the difference is only how the gateway decides which traffic goes into the tunnel.

For most new site-to-site tunnels, route-based is the easier choice: adding a subnet means adding a route, you can monitor the tunnel like any other interface, and failover and dynamic routing work naturally. Policy-based still makes sense for a simple tunnel between two fixed subnets, and you need to understand it whenever the other end only supports policies.

How a policy-based VPN works

The gateway holds a list of IPsec policies, called crypto maps on older Cisco devices, proxy IDs on Palo Alto and encryption domains in many vendors' documents. Each policy says: traffic from this local subnet to that remote subnet goes to this peer, encrypted. When a matching packet arrives, the gateway brings up the tunnel if it isn't already up and encrypts the packet with ESP.

The policies become the traffic selectors negotiated in IKE. With the example network, the branch (198.51.100.20, LAN 192.168.10.0/24) and the gateway (203.0.113.10, 10.10.0.0/16) each list the same pair, mirrored:

Branch   local 192.168.10.0/24  remote 10.10.0.0/16   peer 203.0.113.10
Gateway  local 10.10.0.0/16     remote 192.168.10.0/24 peer 198.51.100.20

Each subnet pair usually becomes its own child SA. Two local subnets and two remote subnets can mean four child SAs, each negotiated, rekeyed and monitored separately. Some implementations combine them into one SA with several selectors and some don't, which is a classic source of interoperability problems.

Strengths and limits of policy-based IPsec

  • Simple for one subnet pair. No tunnel interface, no extra routes, and the configuration reads like a firewall rule.
  • Widely supported. Every IPsec implementation can do it, including the oldest firewalls.
  • Grows badly. Every new subnet on either side means editing both peers, and every pair adds SAs.
  • No routing decisions. You can't send traffic to a backup tunnel by changing a route, and dynamic routing protocols can't run over the tunnel.
  • Harder to monitor. There is no interface to graph, so you watch SA counters instead.

How a route-based VPN works

A route-based VPN creates a virtual tunnel interface: a VTI on Cisco, a tunnel interface on Palo Alto, an interface-mode tunnel on FortiGate, an XFRM interface on Linux. The IPsec SA is bound to that interface. Whatever the routing table sends into the interface is encrypted to the peer, and whatever arrives from the peer comes out of it.

The traffic selectors are usually wide, 0.0.0.0/0 to 0.0.0.0/0, so IKE no longer decides what may pass. Routing does that, and firewall policy on the tunnel interface decides what is allowed. To reach 10.10.0.0/16, the branch simply adds a route:

# Linux with an XFRM interface (example)
ip link add ipsec0 type xfrm dev eth0 if_id 42
ip link set ipsec0 up
ip route add 10.10.0.0/16 dev ipsec0

# Cisco IOS XE (example)
ip route 10.10.0.0 255.255.0.0 Tunnel10

Strengths and limits of route-based IPsec

  • Easy to grow. A new subnet is one route on each side, with no change to IKE and no new SAs.
  • Works like any interface. You can graph traffic, apply firewall rules and NAT per interface, and see at a glance whether the tunnel is up.
  • Failover and dynamic routing. Two tunnels to two peers can back each other up with route metrics, and routing protocols can run over the tunnel when you need them.
  • Needs routes on both sides. Forgetting the return route is a common cause of one-way traffic.
  • Wide selectors must be accepted. A strict policy-based peer may reject 0.0.0.0/0 selectors and fail with TS_UNACCEPTABLE.

Policy-based vs route-based IPsec at a glance

Policy-basedRoute-based
What selects trafficPolicies (subnet pairs)Routing table
Traffic selectorsExact subnetsUsually 0.0.0.0/0
Child SAsOften one per subnet pairOne per tunnel
Adding a subnetEdit policies on both peersAdd a route on both peers
Failover between tunnelsLimited, vendor-specificRoute metrics or dynamic routing
MonitoringSA countersInterface counters and graphs
Best forOne fixed subnet pair, legacy peersMost new site-to-site VPNs

The choice is local to each gateway. A route-based gateway can talk to a policy-based one, as long as the traffic selectors both sides propose are compatible.

Mixing a route-based and a policy-based peer

This is the case that causes most trouble. The route-based side proposes 0.0.0.0/0 selectors; the policy-based side insists on 192.168.10.0/24 to 10.10.0.0/16 and rejects anything else. The fix is to narrow the selectors on the route-based side so that they mirror the other peer's policies exactly, while keeping the tunnel interface and routes:

  • Palo Alto: add proxy IDs on the IPsec tunnel, one per subnet pair.
  • FortiGate: set specific local and remote addresses in the phase 2 selectors instead of 0.0.0.0/0.
  • Cisco IOS XE: keep the VTI but use a crypto map, or set the traffic selectors the peer expects.
  • strongSwan: set local_ts and remote_ts in the child section to the exact subnets.

If the policy-based peer lists several subnet pairs, match each one, and check whether it expects one child SA per pair. When it does and your side bundles them, the first pair works and the rest don't, which looks like a routing problem but isn't. The IPsec troubleshooting guide covers TS_UNACCEPTABLE and one-way traffic in detail.

What each platform defaults to

  • Cisco IOS XE: both; VTI (route-based) is the modern choice, crypto maps are policy-based. See the Cisco example.
  • FortiGate: both; interface-based (route-based) tunnels are the default in the wizard. See the FortiGate example.
  • Palo Alto: always route-based with tunnel interfaces, with proxy IDs for policy-based peers. See the Palo Alto example.
  • MikroTik RouterOS: policy-based IPsec policies by default.
  • strongSwan and pfSense: policy-based by default, with route-based options (XFRM interfaces, VTI mode).

Which one should you use?

Choose route-based when you expect more subnets later, want backup tunnels, or want to graph and filter tunnel traffic like any other interface. Choose policy-based for one fixed pair of subnets, when the other device can't do anything else, or when the team that runs the far end requires it. When you can't choose for both ends, agree on the exact subnets first and configure both sides to propose the same selectors.

Whichever model you use, both ends must agree on subnets, proposals and keys. TunnelYard's guided tunnel setup suggests settings that match the device on the other end, ready-made peer configs cut copy-paste errors, and live tunnel status and logs show when a negotiation fails. See static IP for SaaS allow-lists and features.

Bottom line

Policy-based IPsec matches subnet pairs; route-based IPsec follows the routing table through a tunnel interface. Route-based scales better and suits most new site-to-site VPNs, while policy-based stays useful for small, fixed tunnels and older peers. Mixing the two works once the traffic selectors match on both ends.

FAQ

Policy-based vs route-based IPsec: common questions

What is the difference between policy-based and route-based VPN?

A policy-based VPN encrypts packets that match a list of source and destination subnets, which become the traffic selectors. A route-based VPN binds the IPsec SA to a tunnel interface and encrypts whatever the routing table sends into it, usually with 0.0.0.0/0 selectors. Both use the same IKE and ESP.

Is route-based VPN better than policy-based?

For most new site-to-site VPNs, yes: new subnets only need routes, the tunnel can be monitored and filtered like any interface, and backup tunnels and dynamic routing work naturally. Policy-based is still fine for one fixed subnet pair, or when the peer supports nothing else.

Can a route-based VPN connect to a policy-based VPN?

Yes. Narrow the traffic selectors on the route-based side so they mirror the policy-based peer's subnets exactly: proxy IDs on Palo Alto, phase 2 selectors on FortiGate, local_ts and remote_ts in strongSwan. Keep the tunnel interface and routes. Check whether the peer expects one child SA per subnet pair.

What is a VTI in IPsec?

A VTI (virtual tunnel interface) is the interface a route-based IPsec VPN uses. Traffic routed into it is encrypted to the peer and decrypted traffic comes out of it, so you can attach routes, firewall rules and monitoring to it. Cisco calls it a VTI; Palo Alto, FortiGate and Linux use tunnel, interface-mode and XFRM interfaces.

Why do I get TS_UNACCEPTABLE between a policy-based and a route-based peer?

The traffic selectors don't match. The route-based side typically proposes 0.0.0.0/0 and the policy-based side only accepts its configured subnets, such as 192.168.10.0/24 to 10.10.0.0/16. Configure the same subnets on both sides, mirrored. See IPsec troubleshooting for more.

Do I need BGP with a route-based VPN?

No. Static routes pointing at the tunnel interface are enough for a few subnets. Dynamic routing such as BGP or OSPF over the tunnel helps when there are many subnets, or when a backup tunnel should take over automatically.