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

Re: SCRIPT CREATION

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
Head in the Cloud

Re: SCRIPT CREATION

@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
Inderdeep Singh
www.thenetworkdna.com
Ciroski
Comes here often

Re: SCRIPT CREATION

thanks for the reply, but i can't figure out which is the correct script to block 2 ip addresses
Inderdeep
Head in the Cloud

Re: SCRIPT CREATION

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

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

 

Regards
Inderdeep Singh
www.thenetworkdna.com
Ciroski
Comes here often

Re: SCRIPT CREATION

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

Re: SCRIPT CREATION

can you help me create a script?

GregLiu
Here to help
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.