Skip to main content
martinsd
Staff
Staff
Apr 28, 2023 3:58 PM UTC

IPsec specific default routes

  • Oct 21, 2026 1:43 PM UTC
  • 0 replies
  • 1888 views
  • Translate All

Description

This article describes how to check and manipulate the priority of specific default routes for IPSec tunnels.

Scope

FortiGate.

Solution

It is possible to configure specific default routes to establish each IPSec Tunnel.

For example:

 

config vpn ipsec phase1-interface
  edit "XPTO_Tunnel"
     set type dynamic
     set interface "vlan100"
     set local-gw 1.1.1.1
     set mode aggressive
     set peertype one
     set net-device disable
     set proposal aes128-sha256 aes256-sha256 aes128-sha1 aes256-sha1
     set dpd on-idle
     set wizard-type dialup-fortigate
     set peerid "peerxpto"
     set default-gw 1.1.1.2
     set psksecret 12345678
   next
end

 

To check this route, run the following command in the FortiGate CLI. Example output is attached here.

 

get router info kernel

tab=254 vf=0 scope=0 type=1 proto=17 prio=0 0.0.0.0/0.0.0.0/0->0.0.0.0/0 pref=0.0.0.0 gwy=1.1.1.2 dev=45(vlan100)

 

To increase the route priority, run the following configuration:

 

config vpn ipsec phase1-interface
   edit "XPTO_Tunnel"
      set default-gw-priority 100
    next
end


By default, the value of 'default-gw-priority' is '0'. Upon changing, a higher priority number signifies a less preferred route.

get router info kernel

tab=254 vf=0 scope=0 type=1 proto=17 prio=100 0.0.0.0/0.0.0.0/0->0.0.0.0/0 pref=0.0.0.0 gwy=1.1.1.2 dev=45(vlan100)

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024