Skip to main content
velosy
New Member
March 13, 2024
Question

Configuration Order Tool/Script

  • March 13, 2024
  • 2 replies
  • 1540 views

Hello,

I am trying to prepare templates in CLI form to deploy at sites. My configuration is complete, but when downloading the entire configuration from a Fortigate firewall it is not ordered correctly to be added to the cli.

 

As an example, tunnel interfaces are specified before the phase1-interface, this creates an error because phase1-interface needs to be created first before editing the tunnel interface.  Another example would be it trying to create the vdoms before multi-vdom mode is configured.

 

Can anyone recommend and efficient way to order the configuration so that it can be added to the cli without error or do I need to go through it manually?

 

Thanks.

2 replies

DPadula
Staff & Editor
Staff & Editor
March 14, 2024

Hi Velosy,
If you want to load the whole configuration file you must load it via menu. Top right, click in admin >> Configuration >> Restore. Then FGT will take care and create everything for you.

 

answer.png

 

But if you want to load part of the configuration as you describe there is no simple way to do that (at least I don't know), but you can use the FortiOS language inside the Notepad++ and collapse all settings, then you can move the whole block easily.

Have a look on this article: https://community.fortinet.com/t5/FortiGate/Technical-Tip-Using-the-FortiOS-language-in-Notepad/ta-p/254325

 

TIP: After you install it, use the ALT + 0 keys together to collapse all configurations and ALT + SHIFT + 0 to expand all configurations.

I hope it helps.

 

Regards

DPadula

velosy
velosyAuthor
New Member
March 19, 2024

Hi Thanks for the response.

Its a shame the config is not in a pastable state when downloading it from a fortigate firewall, as its out of order. My plan was to edit a 100F configuration file and upload it to a different 100F. Not sure why, but the new firewall would behave weirdly when using the restore feature and I was not able to login in to the new 100F.

 

I have gone through it manually now and re-ordered the config which parses. I will try the notepad++ language thanks.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!