cancel
Showing results for 
Search instead for 
Did you mean: 

Can't modify MX L3 Firewall Rules

Highlighted
Kind of a big deal

Can't modify MX L3 Firewall Rules

What am I doing wrong?  I get a 404 returned.  The "networkid" is correct.  The apikey is correct.

 

headers = {
  'x-cisco-meraki-api-key': format(str(apikey)),
  'Content-Type': 'application/json'
}

puturl = 'https://api.meraki.com/networks/{0}/l3FirewallRules'.format(str(networkid))
dashboard = requests.put(puturl, data=json.dumps({"rules": [{"srcPort": "Any", "syslogEnabled": False, "policy": "deny", "comment": "Test", "destCidr": "1.1.1.1/32", "srcCidr": "Any", "destPort": "80", "protocol": "tcp"}], "syslogDefaultRule": False}), headers=headers)

2 REPLIES
Getting noticed

Re: Can't modify MX L3 Firewall Rules

Try adding /api/v0 in the url.

 

For example:

 

puturl = 'https://api.meraki.com/api/v0/networks/{0}/l3FirewallRules'.format(str(networkid))

 

Also, make sure you're set to follow redirects when you make the request.  This endpoint redirects to the specific 'nXXX.meraki.com' for your organization when you issue the request.

Kind of a big deal

Re: Can't modify MX L3 Firewall Rules

I feel like such a ditz now.  I spent hours on this on specific API call trying to figure it out.  I kept thinking a out the 404 response and that really should have been a bigger hint.

 

It is working now.

 

The documentation for the Python requests module has that it follows redirects automatically.