Description |
This article describes how to configure a default route for a specific source(subnet/IP range) with a policy route. Generally, static routes are used to reach the destination over the IPSec VPN and when static routes are configured it usually takes place in the routing table.
In this scenario, if there is already a default route for internet traffic that exists, but another default route is required for a specific source through IPSec VPN, it has to be done using the policy route. After configuring the policy route, it can be noticed that the route is not working, and the general default route is taking place instead of the policy route. |
Scope | FortiGate. |
Solution | To activate the policy route and to make it work, there must be a reachable route for the traffic. Policy route:
FGT # config router policy end To avoid conflict with the default route for internet traffic, the priority should be increased for the additional reachable route where the AD value is the same.
FGT # config router static
edit <id>
set status enable
set dst 0.0.0.0 0.0.0.0
set gateway <gateway addr>
set distance 10
set priority 1
set device "WAN-interface"
set comment "default route over WAN interface"
next
edit <id>
set status enable
set dst 0.0.0.0 0.0.0.0
set gateway <gateway addr>
set distance 10 <----- Same AD value as the default route for internet traffic.
set priority 20 <----- Higher priority to avoid route conflict.
set device "vpn-tunnel"
set comment "default route over VPN tunnel interface"
next
end
After the configuration, the additional reachable route for VPN traffic will be active in the routing table, but will not interrupt the default route for the internet traffic for the higher priority value. Routing Table:
FGT # get router info routing-table all Routing table for VRF=0
If there is no reachable route, the policy route does not work and the VPN traffic matches the route for internet traffic and it gets dropped with policy id 0.
This result can be identified from the traffic trace flow debug report: 2024-02-22 22:07:19 id=65308 trace_id=36 func=iprope_fwd_check line=831 msg="after iprope_captive_check(): is_capt
Related articles: Technical Tip: Configuring the firewall Policy Routes Technical Tip: Use of Black hole route in site to site IPsec VPN scenarios |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.