Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
New Contributor

TCL Scripting

Is there anyone that could share an example of a TCL script that I can run on FortiManager to simply set the source-ip for FortiManager and FortiAnalyzer settings on multiple firewalls.  Rather than do this per device and have to change the source-ip in the script everytime, I'd like to do it to all devices at  once. 


The source ip will need to be the local vlan interface IP on each device.  The vlan interface is named the same for every location, so the only variable I should need to pull is the ip for that interface, then use that variable in the set src-ip command.


Any help would be appreciated, I'm not much of a TCL or REGEX guy. :(


I'm relatively new to Fortimanager and keep learning for the best way to apply the config/operation model FMG offers to our operation.

I don't know the syntax of TCL. But one thing I can tell now is if you define a meta field per device and define the value under each device,

you can refer the meta field, say "src_addr", as $(src_addr) in a script, then run it against multiple devices you choose.


Hello, I would recommend you to do with the templates that the FMG brings.




Actually, I was just told by TAC not to use meta field in scripts,  instead use them in CLI template when I opened a ticket after encountering an error. I think the same thing can be done with a CLI template.

Esteemed Contributor III

I haven't messed with tcl in age but fortinet support had some simple tclscripts with examples similar to below


You can tickle your self crazy with tcl ( pun intended ) 


Ken Felix




PCNSE NSE StrongSwan

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Top Kudoed Authors