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

FortiManager Object creation via CLI

I am looking into creation of mass objects in a Fortimanager , it is currently managing two 1500 D's . I know i can create the objects in the firewalls them selves but i could not find a way to import just the objects into the manager. The firewalls have been joined to the manager already.

 

What are the CLI commands of creating objects in the manager ?

 

I use the command below on the firewalls

 

edit host_10.12.170.0

set subnet 10.12.170.0 255.255.255.0 next

 

15 REPLIES 15
scao_FTNT
Staff
Staff

you can create a script for the config and run script on package db

 

you can enable script function display on GUI from SS - admin settings

 

Thanks

 

Simon

KPetrov

And what is the context of the script ? is it the same as the context that is done directly on the firewall. I would rather not do it in a script but  one by one in the CLI. Is that possible  ?

scao_FTNT

FMG does not support run CLI to generate db config like address etc

 

a common CLI script content is similar as FOS CLI like

 

config firewall address     edit "FMG200D"         set comment "for testing"         set subnet 10.2.112.71 255.255.255.255     next

end

 

Thanks

 

Simon

KPetrov

just wanted to give an update  this does not work for fortimanager

 

the command "config firewall address"  is not allowed. I am still looking for the correct commands to apply to a fortimanager not directly to a firewall.

KPetrov

Is there a MOD that can ansswer this ?

scao_FTNT
Staff
Staff

you can not just run this CLI like on FGT side

 

the script I mentioned is a function on FMG side

 

so go to System Settings - Admin - Admin Settings, enable "Show Scripts", then  go to "Device Manager", you will see a new section in left tree bottom "Scripts" and go to script page, you can create a CLI script, for device db, or remote device, or package db

 

so if you want to create many address on FMG side, you choose package db, and then copy the address CLI config into script, save script, then in script list page, you will see your newly created script, right click, you can then run script on package/ADOM db to generate the addresses

 

Thanks

 

Simon

gos
New Contributor

As mentioned earlier, you need to enable scripting and run it towards the package/adom database.

This post didn't really sum it all up for me, so I fiddled around and wrote this little guide: http://www.networkoc.net/adding-firewall-objects-in-fortimanager-through-scripting/ 

 

Hope this helps. =)

victorcreed
New Contributor III

Thanks Gos! I was just about to give up on the FortiManager.

laf
New Contributor II

gos wrote:

As mentioned earlier, you need to enable scripting and run it towards the package/adom database.

This post didn't really sum it all up for me, so I fiddled around and wrote this little guide: http://www.networkoc.net/adding-firewall-objects-in-fortimanager-through-scripting/ 

 

Hope this helps. =)

Spent about 20 minutes on your site/blog. Nice work there: small but tidy! Just subscribed to you!

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.

The most expensive and scarce resource for man is time, paradoxically, it' s infinite.
Labels
Top Kudoed Authors