| Description | This article describes how to fix issues where a static IPSec VPN tunnel with 'mode-cfg' enabled injects default route (0.0.0.0/0) into the routing table and cause issue. |
| Scope | FortiOS |
| Solution |
In the scenario described by this article, a provider (SP) resides in a Datacenter and a VPN tunnel is initiated to the provider’s device to enable reachability from client network to the SP network. However, the client did not have control of the SP side and therefore could not make changes on the SP side. Downtime was experienced, and investigation revealed it was caused by a default route announced/injected to the client network over the VPN tunnel from the SP, which thereby forced all traffic to be routed over the VPN tunnel and cause outage. The following is what the client tunnel configuration looked like:
config vpn ipsec phase1-interface edit "test-vpn" set interface "port1" set peertype any set type static <<<<<< this is the default setting BTW. set net-device disable set mode-cfg enable <<<<<<<<<<<<< set proposal aes128-sha512 set dhgrp 2 set remote-gw x.x.x.x end
How the above configuration caused this issue when the tunnel is of type 'STATIC': There are 2 reasons:
ike 136: test-vpn:1793: mode-cfg missing INTERNAL_IP4_SUBNET: set to ALL ike 136: test-vpn: mode-cfg add x.x.x.x/255.255.255.255 to ‘test-vpn’/1691 ike 136: test-vpn:0: add route 0.0.0.0/0.0.0.0 gw y.y.y.y oif test-vpn(1691) metric 15 priority 1
What can be done to avoid this issue. There are multiple ways to prevent this.
config vpn ipsec phase1-interface edit "test-vpn" set distance 220 <- High enough to prevent this route from knocking off iBGP/any protocol. end
Alternatively, use 'ipv4-split-exclude' on the server to inform it not to announce the subnet(s) to the VPN peer over this tunnel. |
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.