FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
sgiannogloudis
Article Id 224943
Description This articles describes how to copy the original DSCP marking when return traffic arrives as untagged on the FortiGate.
Scope FortiOS 7.2.1+ versions.
Solution

Initially, in order to have an understanding regarding the DSCP feature on FortiOS, read this related KB article:

https://community.fortinet.com/t5/FortiGate/Technical-Tip-Differentiated-Services-Code-Point-DSCP-ma...

 

Currently, there are two main ways on how to mark traffic with DSCP:

 

1) Directly via the firewall policy:

 

# config firewall policy

    edit <X>

        set diffserv-forward enable
        set diffservcode-forward <binary_integer>
        set diffserv-reverse enable
        set diffservcode-rev <binary_integer> 

 

2) Or via as SD-WAN rule:

 

# config system sdwan
# config service
    edit <X>
        set dscp-forward enable
        set dscp-reverse enable
        set dscp-forward-tag <binary_integer>
        set dscp-reverse-tag <binary_integer>

 

Let's assume, there is the below topology:

 

sgiannogloudis_0-1664269840884.png

 

 - End hosts generate traffic towards the servers which are located behind Hub FortiGate.

 

- Spoke FortiGate is marking the traffic with the configured DSCP values for specific type of traffic.

 

- Servers usually do not have the capability to mark the right QoS values, so reply traffic is arriving as untagged on Hub FortiGate and traverses without the correct DSCP values on its way back to branch.

 

- In order to have bidirectional end-to-end QoS markings on the reply traffic as well, it is necessary to configure the firewall policy on the Hub with the below commands:

 

# config firewall policy

    edit <X>

        set diffserv-copy {enable | disable}

end

 

When the particular command is being enabled on a firewall policy, the following commands will become hidden:

 

# config firewall policy

    edit <X>

    diffserv-forward
    diffserv-reverse
    diffservcode-forward
    diffservcode-rev