Created on
11-14-2023
04:12 PM
Edited on
06-02-2025
01:41 PM
By
Jean-Philippe_P
Description | This article explains the SD-WAN rule matching process. |
Scope | FortiGate, SD-WAN. |
Solution |
SD-WAN rules steer traffic, but traffic must match the rule first. Matching traffic is confirmed through the process outlined in this article.
The article sometimes simply refers to SD-WAN rules as 'rules'. Note that SDWAN rules are 'policy routes', but regular policy routes have precedence over SD-WAN rules. This means the 'regular policy routes' are processed first, i.e., before any SD-WAN rule is processed.
The same command can be used to check both the 'regular policy route' and the SD-WAN rule. However, the ID of any 'regular policy route' is between 1-65535, while the ID of any SD-WAN rule is a ten-digit number like the one shown in the image below.
diagnose firewall proute list <- Checks both regular and SD-WAN rules.
SD-WAN rule matching process analysis: For demonstration, this article will use a PacketA sent from the source address '10.10.10.10' to the destination address '192.168.1.10' for analysis. The device is configured with the following SD-WAN rules and routing table (FIB):
The FortiGate received PacketA and checked the destination IP address for routing (if DNAT was required on PacketA, it would have been done before this stage. DNAT comes before routing lookup).
The validation process is what means routes (which are expected to match a rule) do not match rules, despite how the source and destination are the same as configured in the SD-WAN rule. This is because of the additional condition(s) that have to be fulfilled or met.
Even if PacketA fulfilled the 'source & destination' specified in the SD-WAN rule, if the validation check failed, PacketA will be considered as 'no match' by the rule, and FortiOS will proceed to the next rule. If that rule is the last, it will use an implicit rule for the forwarding, which is the same as FIB.
The following are the criteria in the validation process:
If the answer is no, then the rule will be skipped.
config system sdwan config service <----- SD-WAN rule. edit <xx> set default enable <----- Disable is the default setting. end
In this case, the first validation process has judged PacketA as no match. To change this second validation process or rule (valid route in FIB), use the following command:
config system sdwan config service edit xx set gateway enable <----- Disable is the default setting. end
See the following flowchart for an overview:
This flowchart shows the SD-WAN rule lookup process. SD-WAN rules are essentially policy routes. Like regular policy routes, SD-WAN rules are checked from top to bottom (first match). For each rule, FortiGate maintains an outgoing interface (oif) list.
The oif list sorts the configured members by preference based on the strategy in use.
If FortiGate finds an acceptable member, it forwards the packet to that member, then the firewall policy check occurs,
Note that when both default and gateway settings are enabled, FortiGate does not perform steps 1 and 2.
If 'default' is enabled, the best route check for SD-WAN rules is skipped. If 'gateway' is enabled, the FIB lookup for SD-WAN rules is skipped.
Whenever possible, the default behavior should be preferred, with a configuration of a route to the destination (default or more specific).
Note: FIB stands for Forwarding Information Base. It can be listed by the following CLI commands:
get router info kernel
PBR stands for Policy-Based Routing. It can be listed by below CLI:
diagnose firewall proute list
DNAT refers to Virtual IP. It can be configured by the following CLI:
config firewall vip
Related article: |
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.