SCRIPT CREATION

Ciroski
Comes here often

SCRIPT CREATION

Hello good morning everyone

I am an admin user for the meraki console and my client asked me to create a script to block ip,
we currently have 400 active networks and making them once becomes complicated
is there the possibility to create a script for all the stores I have on the meraki console?

Thanks for the reply

Regards
Ciro Scalera

7 Replies 7
CptnCrnch
Kind of a big deal
Kind of a big deal

Hi Ciro,

 

yes, it‘s definitely possible to update Meraki firewall rules by using the API:

https://developer.cisco.com/meraki/api/#!update-network-l-3-firewall-rules

 

In a nutshell, you‘d have to write a script that cycles though all of your networks (https://developer.cisco.com/meraki/api/#!get-organization-networks) and add the wanted rule(s).

Inderdeep
Kind of a big deal
Kind of a big deal

@Ciroski Apart from what @CptnCrnch provides, you can also have Python Script as well 

https://developer.cisco.com/meraki/build/mx-firewall-control-python-script/

 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
Ciroski
Comes here often

thanks for the reply, but i can't figure out which is the correct script to block 2 ip addresses
Inderdeep
Kind of a big deal
Kind of a big deal

@Ciroski May be check this as well, it also shows with the IP address

https://developer.cisco.com/codeexchange/github/repo/CiscoSE/AddMerakiMXL3FirewallRuleToNetworks

 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
Ciroski
Comes here often

ok I created a txt file with api code and id organization,
 
----
but this part i didn't understand what i have to do
You must also have the input file named NewRuleToAdd.txt in the same directory as AddRulesToMXL3Firewall.py
It should only have two lines:
 
Comment to use to add a new rule
comma-separated list of IP addresses in point-decimal notation
Example of content of the NewRuleToAdd.txt file to create:
 
Case323423
40.17.41.118,40.17.41.119
Ciroski
Comes here often

can you help me create a script?

GregLiu
Here to help
Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.
Labels