Is there a way to create L3 firewall rules using API?
I am trying to migrate one Checkpoint FW to a Meraki MX, and I have a CSV file with the firewall rules.
The documentation only shows GET and Update firewall rules
Any idea?
Solved! Go to Solution.
The only way is to do a GET to a file, edit it by adding the new rule and then perform the PUT, that is, there is no other way.
The only way is to do a GET to a file, edit it by adding the new rule and then perform the PUT, that is, there is no other way.
You will have to convert the existing firewall rule from your csv into json format and use the API's update PUT operation to apply the firewall rules. If you are not sure what fields are needed in the json file, you can find one by doing a GET to retrieve it from the MX.
Hi as mentioned get the current rules, add your own and update:
In python that will be something like this:
l3Settings = dashboard.appliance.getNetworkApplianceFirewallL3FirewallRules(<network_id>)
# print (l3Settings['rules']) <-- add your rules
# Update:
response = dashboard.appliance.updateNetworkApplianceFirewallL3FirewallRules(<network_id>, rules=l3Settings['rules'])
There's an example script that may help you (it uses the Meraki Python library)...
https://github.com/CiscoSE/AddMerakiMXL3FirewallRuleToNetworks