Simplifying FortiGate Deployment using FortiManager Scripting with Variables

Jonathan Torian

Jonathan Torian, senior sales engineer for a industry leading machine data processing company, is a Fortinet Network Security Expert 8 (NSE 8) certified professional. In addition to obtaining the highest certification for Fortinet, he also possesses the Certified Information Systems Security Professional (CISSP) since 2011 and has more than 10 years experience in Networking and Security. He is an avid technologist and is loves helping people by solving hard problems with great technology solutions.

You may also like...

Subscribe
Notify of
guest
6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Patrice Carbonneau
Patrice Carbonneau
1 year ago

Hi, i am searching for a way to create VPN and interfaces on a lot of FGT automatically and mapping those interfaces and VPN to dynamic interface in the FortiManager

Rafael Rosseto
Rafael Rosseto
1 month ago

Hello Jonathan,

Do you know a way to do the second script and call some variables like metafields?

I did not find a way to do that, only editing the script itself and replace the device name.

Example:
config dynamic interface
edit “InterfaceX”
config dynamic_mapping
edit “FG_XPTO_HOSTNAME”-“root”
set local-intf “lan1”
next
end
next
end

What I need is set some metadata to be like this
config dynamic interface
edit “InterfaceX”
config dynamic_mapping
edit “$(Metafield_Hostname)”-“root”
set local-intf “lan1”
next
end
next
end

Aymen Zitouni
19 days ago

Hi,
Thank for your post really.
I’m starting to test scriptiong and I have a few question please.
1- For mappin dynamic object, how to run the script on the FGMT;
2- When we edit device vdom, we can’t see the Meta Fields. Is related to the device not vdom.
3- With every VPN, I have to add BGP network route and add the prefix list. How to do this in FGMT. I can’t see the prefix-list.

Thank you in advance,
Aymen