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.
akileshc
Staff
Staff
Article Id 332046
Description
Scope FortiOS.
Solution













 

Firewall_Address.png

 

In the CLI: 

 

config firewall address
    edit "MAC_Addr"
        set type mac
        set macaddr "02:09:0f:00:01:03"
    next
end

 

Step 






 

Shaper.png

 

In the CLI:

 

config firewall shaper traffic-shaper

    edit "TEST"

        set guaranteed-bandwidth 10
        set maximum-bandwidth 100

    next

end

 

Note: The Traffic Shaping option in the GUI over the corresponding IPv4 Policy will only appear after it has been configured via CLI. If it is not configured through the CLI first, it will not be visible in the GUI. Additionally, once the profile is removed from the CLI, this option will disappear from the GUI again.










 

IPv4_Policy.png

 

In the CLI:

 

config firewall policy

    edit 1

        set name "LAN-WAN"
        set srcintf "port3"
        set dstintf "port2"
        set action accept
        set srcaddr "MAC_Addr"
        set dstaddr "all"
        set schedule "always"
        set service "ALL"
        set logtraffic all
        set nat enable
        set traffic-shaper "TEST" 

        set traffic-shaper-reverse "TEST"

    next

end

 

Step 4: Verify the Configuration.

To ensure the configuration is working as expected, navigate to Policy & Object -> Traffic Shaping -> Traffic Shapers.

 

Traffic_Shaper.png

 

Verify the traffic matching traffic shapers and bandwidth usage or drops by session list as mentioned below:

di sys session filter dst 51.158.1.21

di sys session list


session info: proto=1 proto_state=00 duration=189 expire=60 timeout=0 refresh_dir=both flags=00000000 socktype=0 sockport=0 av_idx=0 use=3
origin-shaper=TEST prio=2 guarantee 1250Bps max 12500Bps traffic 3706Bps drops 0B 
reply-shaper=TEST prio=2 guarantee 1250Bps max 12500Bps traffic 3706Bps drops 0B 
per_ip_shaper=
class_id=0 ha_id=0 policy_dir=0 tunnel=/ vlan_cos=0/255
state=log may_dirty os rs f00
statistic(bytes/packets/allow_err): org=347320/190/1 reply=345492/189/1 tuples=2
tx speed(Bps/kbps): 2077/16 rx speed(Bps/kbps): 2077/16
orgin->sink: org pre->post, reply pre->post dev=5->4/4->5 gwy=10.0.0.254/0.0.0.0
hook=post dir=org act=snat 172.16.10.1:5->51.158.1.21:8(10.0.0.1:60422)
hook=pre dir=reply act=dnat 51.158.1.21:60422->10.0.0.1:0(172.16.10.1:5)
misc=0 policy_id=1 pol_uuid_idx=15849 auth_info=0 chk_client_info=0 vd=0
serial=00000177 tos=ff/ff app_list=0 app=0 url_cat=0
rpdb_link_id=00000000 ngfwid=n/a
npu_state=0x000100
no_ofld_reason: npu-flag-off
total session: 1

 

Note: The address object configured with the 'mac' type cannot be used in the traffic shaper policy. Instead, this can be accomplished using an IPv4 policy, as outlined in the steps provided above.