Skip to main content
WinterSnowYap
Staff
Staff
August 26, 2025

Technical Tip: FortiManager creates a Section Label at Policy Blocks using CLI commands

  • August 26, 2025
  • 0 replies
  • 365 views
Description This article describes how FortiManager creates a Section Label at Policy Blocks using CLI commands.
Scope FortiManager.
Solution
  • At FortiManager, go to Device Manager -> Scripts and create a new Script (Run script on = Policy Package or ADOM Database).
  • At FortiManager, run the new Scripts in Policy Blocks.

 

Sample CLI commands to create a Dummy Firewall Policy with Section Label:

 

config firewall policy
    edit 0
        set name "Dummy1"
        set srcintf "any"
        set dstintf "any"
        set srcaddr "all"
        set dstaddr "all"
        set schedule "always"
        set service "ALL"
        set logtraffic all
        set global-label "Section_SiteA"
    next
    edit 0
        set name "Dummy2"
        set srcintf "any"
        set dstintf "any"
        set srcaddr "all"
        set dstaddr "all"
        set schedule "always"
        set service "ALL"
        set logtraffic all
        set global-label "Section_SiteA"
    next
    edit 0
        set name "Dummy3"
        set srcintf "any"
        set dstintf "any"
        set srcaddr "all"
        set dstaddr "all"
        set schedule "always"
        set service "ALL"
        set logtraffic all
        set global-label "Section_SiteB"
    next
    edit 0
        set name "Dummy4"
        set srcintf "any"
        set dstintf "any"
        set srcaddr "all"
        set dstaddr "all"
        set schedule "always"
        set service "ALL"
        set logtraffic all
        set global-label "Section_SiteB"
    next
end

 

Sample CLI commands to add a Section Label with an existing Firewall Policy:

 

config firewall policy
    edit 1
        set global-label "Section_SiteA"
    next
    edit 2
        set global-label "Section_SiteA"
    next
    edit 3
        set global-label "Section_SiteB"
    next
    edit 4
        set global-label "Section_SiteB"
    next
end

 

202508_FMG_SectionLabel_PolicyBlock_01.jpg