Description
This article describes how the FortiGate selects routes in the routing table from the different routing protocols and how to change the route preference.
Scope
FortiGate.
Solution
How does it work:
Case study
Route distance seen from the GUI:
The distance of the routes can be seen also after executing below command, as below:
# get router info routing-table all
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
V - BGP VPNv4
* - candidate default
Routing table for VRF=0
S* 0.0.0.0/0 [10/0] via 10.191.47.254, port1, [1/0] <- Distance is 10
C 10.112.0.0/20 is directly connected, port2
C 10.191.32.0/20 is directly connected, port1
Solution
How to change the route distance : some examples
config router rip config distance edit 1 set distance 130 next end end config router static edit 1 set device "internal" set distance 20 set gateway 172.31.225.254 next end config router ospf set distance-external 105 set distance-intra-area 100 end config router bgp set distance-external 30 set distance-internal 210 end |
Note :
Related Articles
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.