Performance-based routing to MS Office 365 over Cisco Meraki SD-WAN.

Objective

What does the script do?

This script optimises routing to Microsoft Office 365 over Cisco Meraki SD-WAN.

How does the script do it?

The script checks MS online documentation, fetches up-to-date routes and automatically injects them into VPN Hub.
As a result, performance-based routing to Office 365 is enabled .

Implementation:

  • The script retrieves up-to-date MS Office 365 IP addresses from the official Microsoft online documentation,
  • Compares with currently configured IP addresses,
  • Injects the new routes to Meraki Auto VPN,
  • Deletes outdated routes from Meraki Auto VPN.

Solution

Automation

Presentation

Installation

  1. Clone the repository
git clone https://github.com/SalnikovAndrey/performance-based-routing-to-office-365-over-meraki-sd-wan
  1. Navigate into directory
cd performance-based-routing-to-office-365-over-meraki-sd-wan
  1. Create the virtual environment
python3 -m venv venv
  1. Start the virtual environment
source venv/bin/activate
  1. Install requirements.txt
pip install -r requirements.txt 

Usage

This script has to be applied on the VPN Hub (MX has to be in Routed mode).
The script must be executed with the following flags:

  1. API Key (-a):
  2. Default gateway (-g):
  3. NetworkID (VPN Concentrator) (-n):
python3 o365_sd_wan.py -a {API key} -n {NetworkID} -g {IP address}

Example:

python3 o365_sd_wan.py -a sdfh&8sdkfj2345234LKJFSDhjsdf -n L_13847134355 -g 192.168.1.1
- Get your OrganisationID:
https://dashboard.meraki.com/api/v0/organizations
- Get your NetworkID:
https://dashboard.meraki.com/api/v0/organizations/{OrganisationID}/networks

Important note:
The script injects routes with the description "O365 - X.X.X.X". Please, make sure that these descriptions remain unmodified and there are no other descriptions that contain the prefix "O365".

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.