02-28-2023 05:16 PM
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.
02-28-2023 05:39 PM
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.
02-28-2023 05:39 PM
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.
02-28-2023 07:26 PM
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.
03-01-2023 05:31 AM
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'])
03-01-2023 05:53 AM
There's an example script that may help you (it uses the Meraki Python library)...
https://github.com/CiscoSE/AddMerakiMXL3FirewallRuleToNetworks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide