Community discussions

MikroTik App
 
User avatar
alexvdbaan
Trainer
Trainer
Topic Author
Posts: 40
Joined: Sun Feb 22, 2015 12:12 pm
Location: Amsterdam, Netherlands
Contact:

Convert .json Office 365 IP range to address list

Thu Aug 23, 2018 4:00 pm

Goodafternoon,

I am trying to find a way to automate adress-list creation from the published IP ranges from Microsoft Office 365 services. Microsoft delivers an online json presentation that can also be downloaded.

Was hoping that one of you might have some script or solution for this?

Thanks, Alex
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: Convert .json Office 365 IP range to address list

Thu Aug 23, 2018 5:25 pm

After a quick glance, I would say that you can do this with awk/gawk in a bash script, or if you wanted to get fancy in php.
I was actually looking at this same json to be used for whitelisting office365 in my Blacklist service.

I need to earn some money today so I'll be our doing uber & lyft for a few hours. When I get back in, I'll see if I can put together a script for this.
 
User avatar
alexvdbaan
Trainer
Trainer
Topic Author
Posts: 40
Joined: Sun Feb 22, 2015 12:12 pm
Location: Amsterdam, Netherlands
Contact:

Re: Convert .json Office 365 IP range to address list

Thu Aug 23, 2018 10:03 pm

When I get back in, I'll see if I can put together a script for this.
That would be great, thanks in advance.
 
CateFul
just joined
Posts: 16
Joined: Tue Jan 27, 2015 10:58 pm

Re: Convert .json Office 365 IP range to address list

Wed Mar 20, 2019 9:38 am

I wrote this script for split-routing of office 365 traffic.

https://github.com/fillorkill/o365addrlist

tested on python 2.x on CentOS

it generates a conf file to be used with dnsmasq for office 365 urls and a mikrotik address list file.

ipv4 endpoints only

usage:
python parser.py

Who is online

Users browsing this forum: 4l4R1, Bernhard, jason9456402, slimmerwifi and 80 guests