FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
WinterSnowYap
Article Id 408283
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