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.
kaurm
Staff
Staff
Article Id 342301
Description

This article describes how to use an automation stitch to run a CLI script and bounce the FortiGate interface during a fixed interval of time.

An explanation is provided for how to bring down the interface and up during a scheduled time.

Scope FortiGate
Solution

Select the automation from Security Fabric -> Automation -> Trigger.

 

  • Select the trigger with the time the port should go down.

 

kaurm_4-1726693084130.png

 

  • Create a CLI script where the port status is set as 'down'.

 

kaurm_5-1726693084135.png

 

The automation stitch is configured where the trigger and action is chosen.

 

kaurm_6-1726693084139.png

 

Similarly, follow these steps to configure the trigger and script to bring the port up:

 

kaurm_7-1726693084142.png

 

kaurm_8-1726693084146.png

 

kaurm_9-1726693084150.png

 

Automation script to bring a port down in the CLI:

 

config system automation-trigger

edit "ShutDown_Time"

show

config system automation-trigger

edit "ShutDown_Time"

set trigger-type scheduled
set trigger-hour 16
set trigger-minute 33

next

end

 

config system automation-action

edit "port_shutdown"

show

config system automation-action

edit "port_shutdown"

set action-type cli-script
set script "config sys interface

edit port2

set status down

end"

set accprofile "super_admin"

next

end


config system automation-stitch

edit "WAN_Shutdown"

show

config system automation-stitch

edit "WAN_Shutdown"

set trigger "ShutDown_Time"

config actions

edit 1

set action "port_shutdown"
set required enable

next

end

next

end

 

Automation stitch to bring a port up in the CLI:

 

config system automation-trigger

edit "Enable_time"

show

config system automation-trigger

edit "Enable_Time"

set trigger-type scheduled
set trigger-hour 16
set trigger-minute 35

next

end


config system automation-action

edit "WAN_Enable"

show

config system automation-action

edit "WAN_Enable"

set action-type cli-script
set script "config sys interface

edit port2

set status up

end"

set accprofile "super_admin"

next

end


config system automation-stitch

edit "WAN_Enable"

show

config system automation-stitch

edit "WAN_Enable"

set trigger "Enable_Time"

config actions

edit 1

set action "WAN_Enable"

set required enable

next

end

next

end