Python script that creates networks, adds devices, and creates vlans in Meraki based on input from a .csv file
Data is read from meraki_config.csv. Columns are delimited with comma and devices are delimited with semi-colon. VLAN_subnet column allows you to dictate the IP address space the VLANs will be created in. Those VLANS will be created incrementally and reference back to the MX assigned to the network. NOTE to add vlans an MX MUST be assigned to the network. If the network does not include an MX device, set the Number_VLANS to 0 for that row. Once the meraki_config.csv file is complete and the virtual environment is created:
Once the API key is obtained, you'll need to store the Meraki dashboard API key as an environment variable:
export MERAKI_DASHBOARD_API_KEY = <YOUR MERAKI API KEY>
create a virtual environment:
python<version> -m venv merakivlan
source merakivlan/bin/activate
and install the Meraki SDK via pip install -r requirements.txt
python meraki_network_vlan_provision.py -c
python meraki_network_vlan_provision.py -d
Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the terms of
the License. All rights not expressly granted by the License are
reserved. Unless required by applicable law or agreed to separately in
writing, software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
Deploying Meraki networks on the Meraki Dashboard can be a tedious task. This script allows an engineer to push new networks, devices, and VLANs in a matter of seconds. The base Python script is extendable to allow for any Meraki configuration to be easily added as necessary. Let's do it, the way you want to do it.
Owner
Contributors
Categories
NetworkingSecurityProducts
MerakiProgramming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community