Technical Tip: Traffic Shaping by Firewall Policy
Description
This article describes how to enable and apply Traffic Shaping under the Firewall Policy.
Starting from FortiOS v7.x, the option is now available on the GUI by default, and it can be configured using the GUI and CLI.
Scope
FortiGate.
Solution
- Go to Policy & Objects -> Firewall Policy, 'right-click' on a policy where Traffic Shaping will be configured, and select 'Edit in CLI'.
![gtapia_[object Window]_[object Window]_1117_1(2).jpg gtapia_[object Window]_[object Window]_1117_1(2).jpg](https://uploads-us-west-2.insided.com/fortinet-en/attachment/1542i1FD035C3323B6972.png)
-
Run the following commands in the CLI to enable Traffic Shaping:
set traffic-shaper <shaper name>
set traffic-shaper-reverse <shaper name>
end
Note: When using the CLI directly rather than accessing it through the GUI as outlined above, the following commands are required. If VDOMs are enabled, ensure the commands are executed within the VDOM where the policy is configured.
FGT_3 # config vdom
FGT_3 (vdom) # edit root
current vf=root:0
FGT_3 (root) # config firewall policy
FGT_3 (policy) # edit 1
FGT_3 (1) # set traffic-shaper <shaper name>
FGT_3 (1) # set traffic-shaper-reverse <shaper name>
end
Create a traffic shaper or select/adjust one of the default shapers:

- Once configured, the Traffic Shaping configuration will be visible in the policy from the GUI.
![gtapia_[object Window]_[object Window]_1117_2(1).jpg gtapia_[object Window]_[object Window]_1117_2(1).jpg](https://uploads-us-west-2.insided.com/fortinet-en/attachment/1902i0C442542061C0458.png)
The above steps must be completed on every firewall policy to apply Traffic Shaping.
