Kaspars Zibarts show it correctly. You have right syntaxe, but problem must be in execution. I usually pushing configuration from file, so I'm able to add thousands rows at once.
- In case you want to run script from file, make sure that you have there UNIX end of lines (when you copied file from different filesystem)
- In production make database revision first!
- DBEDIT fails and stop in case of first error in your code. This could be annoying when you are using update_all. For better visibility where the problem is you can update each element separately (you'll see which update line failed). It takes you much more time especially if you run something really big, but it is best for troubleshooting.
How to run file?
On localhost:
dbedit -s localhost -f /somepath/import-file.txt
Under MDS on certain domain:
dbedit -s <domain server IP> -f /somepath/import-file.txt
In case you need to add more objects, but some with same names already exist in your database, then you can ingnore errors:
dbedit -s localhost -f /somepath/import-file.txt -ignore_script_failure
Here are some simple object code examples (host, network, ip range, group):
Create host 10.0.0.3
create host_plain host10.0.0.3
modify network_objects host10.0.0.3 ipaddr 10.0.0.3
modify network_objects host10.0.0.3 comments "Company Host"
update network_objects host10.0.0.3
Create network 10.0.0.128/25
create network net10.0.0.128m25
modify network_objects net10.0.0.128m25 ipaddr 10.0.0.128
modify network_objects net10.0.0.128m25 netmask 255.255.255.128
modify network_objects net10.0.0.128m25 comments "Company network"
update network_objects net10.0.0.128m25
Create IP range 10.0.0.2-10.0.0.25
create address_range range10.0.0.2-10.0.0.25
modify network_objects range10.0.0.2-10.0.0.25 ipaddr_first 10.0.0.2
modify network_objects range10.0.0.2-10.0.0.25 ipaddr_last 10.0.0.25
modify network_objects range10.0.0.2-10.0.0.25 comments "server range"
update network_objects range10.0.0.2-10.0.0.25
Put all previous to simple group:
create network_object_group branchSubnetGroup
addelement network_objects branchSubnetGroup '' network_objects:host10.0.0.3
addelement network_objects branchSubnetGroup '' network_objects:net10.0.0.128m25
addelement network_objects branchSubnetGroup '' network_objects:range10.0.0.2-10.0.0.25
modify network_objects branchSubnetGroup comments "Group of objects"
update network_objects branchSubnetGroup
More examples you can find in Multi-Domain Security Management R77 Versions Administration Guide . There are examples of rules, renaming, etc.