Description
This article explains how to apply Shared traffic shaper and Per-IP shaping directly within a firewall policy using the CLI.
Scope
FortiGate.
In v5.2, traffic shaping was configured over the firewall policy.
By default, if the intention was to apply traffic shaping, it was only necessary to create a shaper and direct it to a firewall policy.
From v5.6, there is no option to create a shaper for a firewall policy in the GUI. This can only be done through the CLI.
Solution
Traffic shaping in a firewall policy needs to be configured using the CLI. There is currently no method to enable traffic shaping in the GUI. After adding, it will be possible to modify the policy in the GUI.
If traffic shaping is removed through the GUI and the firewall policy has been saved, it will be necessary to use the CLI to create it again.
set traffic-shaper <shaper> <----- Command applies to the traffic from ingress to egress direction, meaning it will affect the upload speeds and outbound traffic.
set traffic-shaper-reverse <shaper> <----- Command applies to the traffic from egress to ingress direction, meaning it will affect the download speeds and the inbound traffic.
set per-ip-shaper <shaper> applies a Per-IP shaper, which limits bandwidth on a per-source IP basis.
Follow the steps below to create traffic shaping in a firewall policy:
Go to Policy&Objects -> IPv4 Policy, 'right-click' the policy for which traffic shaping will be configured, and select 'Edit in CLI'.
Configure the following inside the policy through the CLI: Applying Shared traffic shaper in a Firewall Policy:
set traffic-shaper <shaper name>
set traffic-shaper-reverse <shaper name>
end
Alternatively, go directly from CLI to the specific firewall policy and enable shared traffic shaper:
Related articles:
Technical Tip: How to configure and check which traffic shaper is used
Technical Tip: Monitoring 'Traffic Shaping'
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.