cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1787
Views
2
Helpful
4
Replies

Help with Meraki-CLI to update firewall rules

NetEng11
Community Member

Here's my argument:

meraki appliance updateNetworkApplianceFirewallL3FirewallRules --networkId <networkID> --kwargs "{
"rules":[
{
"comment": "Block",
"policy": "deny",
"protocol": "any",
"srcPort": "any",
"srcCidr": "any",
"destPort": "any",
"destCidr": "<IP.ADDR>/32",
"syslogEnabled": false
}
]
}"
Trying to update firewall rule to block an IP for multiple sites but get following error:
2025-02-14 12:41:25,820 [CRITI] Error loading JSON kwargs. Check syntax.
2025-02-14 12:41:25,820 [ERROR] Expecting property name enclosed in double quotes: line 3 column 5 (char 7)
Traceback (most recent call last):
File "/home/sgre/.local/share/pipx/venvs/meraki-cli/lib/python3.12/site-packages/meraki_cli/__main__.py", line 466, in _get_method_params
kwargs = json.loads(kwargs_value) # Interpret the JSON
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3 column 5 (char 7)
Any advise on where I have gone wrong?
4 Replies 4

aleabrahao
Meraki Community All-Star
Meraki Community All-Star

The error indicates that there is a problem with the JSON syntax in the arguments (kwargs) passed to the updateNetworkApplianceFirewallL3FirewallRules command.

The specific error is: Expecting property name enclosed in double quotes: line 3 column 5 (char 7)

This suggests that there is a problem with the double quotes somewhere in the JSON.

When examining the JSON provided, I noticed that there is a space before the { curly brace that begins the rules object. This may be causing the error.

Try removing the space before the { curly brace and see if the command works:

--kwargs "{ "rules": [{ "comment": "Block", "policy": "deny", "protocol": "any", "srcPort": "any", "srcCidr": "any", "destPort": "any", "destCidr": "<IP.ADDR>/32", "syslogEnabled": false }] }"

I am not a Cisco employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Your platform might not allow quotes to be used inside of quotes. Try making the outside ones single quotes. I think Mac is super picky about this in particular.

meraki appliance updateNetworkApplianceFirewallL3FirewallRules --networkId <networkID> --kwargs '{
...
}'

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Or perhaps try using double quotes for the inside ones:

""rules"":[
{
""comment"": ""Block"",
...
"policy": "deny",