cloud-ip-ranges

Microsoft 365 IP ranges

Current IP ranges (CIDRs) used by the Microsoft 365 cloud infrastructure, updated daily.

categorySaaS & Business APIs
websitehttps://www.microsoft.com/es-mx/microsoft-365
ranges93 (34 IPv4, 59 IPv6)
last change
downloads29,259
download txt csv json — permalinks, always the latest data
curl -O https://cloud-ip-ranges.com/download/microsoft-365.txt

Ranges

Sample of 25 of 93 ranges. Download the full list above, or check a specific IP.

CIDR Type Tag
13.107.6.152/31 ipv4 Exchange Online
13.107.18.10/31 ipv4 Exchange Online
13.107.128.0/22 ipv4 Exchange Online
23.103.160.0/20 ipv4 Exchange Online
2603:1006::/40 ipv6 Exchange Online
2603:1016::/36 ipv6 Exchange Online
2603:1026::/36 ipv6 Exchange Online
2603:1036::/36 ipv6 Exchange Online
13.107.6.171/32 ipv4 Microsoft 365 Common and Office Online
13.107.6.192/32 ipv4 Microsoft 365 Common and Office Online
13.107.9.192/32 ipv4 Microsoft 365 Common and Office Online
2603:1006:1400::/40 ipv6 Microsoft 365 Common and Office Online
2603:1006:2000::/48 ipv6 Microsoft 365 Common and Office Online
2603:1007:200::/48 ipv6 Microsoft 365 Common and Office Online
52.112.0.0/14 ipv4 Microsoft Teams
52.122.0.0/15 ipv4 Microsoft Teams
2603:1027::/48 ipv6 Microsoft Teams
2603:1037::/48 ipv6 Microsoft Teams
2603:1047::/48 ipv6 Microsoft Teams
13.107.136.0/22 ipv4 SharePoint Online and OneDrive for Business
40.108.128.0/17 ipv4 SharePoint Online and OneDrive for Business
52.104.0.0/14 ipv4 SharePoint Online and OneDrive for Business
2603:1061:1300::/40 ipv6 SharePoint Online and OneDrive for Business
2603:1063:6000::/35 ipv6 SharePoint Online and OneDrive for Business
2620:1ec:8f8::/46 ipv6 SharePoint Online and OneDrive for Business

Blocking Microsoft 365

iptables

curl -sO https://cloud-ip-ranges.com/download/microsoft-365.txt
while read ip; do
  iptables -A INPUT -s $ip -j DROP
  iptables -A OUTPUT -d $ip -j DROP
done < microsoft-365.txt

ufw

curl -sO https://cloud-ip-ranges.com/download/microsoft-365.txt
while read ip; do
  ufw deny from $ip
  ufw deny to $ip
done < microsoft-365.txt

fail2ban

sudo tee /etc/fail2ban/filter.d/microsoft-365-block.conf << EOF
[Definition]
failregex = ^.*$
ignoreregex =
EOF

sudo tee /etc/fail2ban/jail.d/microsoft-365-block.conf << EOF
[microsoft-365-block]
enabled = true
filter = microsoft-365-block
action = iptables-allports[name=microsoft-365]
logpath = /tmp/microsoft-365.txt
findtime = 1
bantime = -1
maxretry = 1
EOF

curl -so /tmp/microsoft-365.txt https://cloud-ip-ranges.com/download/microsoft-365.txt
sudo systemctl restart fail2ban

pfSense / OPNsense

curl -sO https://cloud-ip-ranges.com/download/microsoft-365.txt
# Firewall > Aliases: new alias MICROSOFT-365_BLOCK, type Network(s), import the file
# Firewall > Rules > WAN: Action=Block, Source=MICROSOFT-365_BLOCK

About

These IP ranges are sourced directly from Microsoft 365's official feeds and are updated regularly to ensure accuracy. The data includes IPv4 and IPv6 ranges used by Microsoft 365's infrastructure worldwide. Last update was about 3 hours ago.

Other providers

AirVPN, Akamai, Alibaba, Alpha Strike Labs, Amazonbot, Amzn-SearchBot, Amzn-User, Anthropic, AppleBot, Atlassian, AWS, Azure, Backblaze, Baidu, BinaryEdge, BingBot, Bunny, CacheFly, CCBot, Censys, ChatGPT-User, ClaudeBot, Cloudflare, Datadog, DigitalOcean, DuckDuckBot, Fastly, Gabia, G-Core, GitHub, Googlebot, Google Cloud, Google Public DNS, Google Services, GPTBot, Hetzner, Hostway, Huawei Cloud, IBM Cloud, iCloud Private Relay, Internet Archive, IVPN, Leaseweb, Linode, Meta, Mistral, Mullvad, NHN Cloud, NordVPN, OpenAI ChatGPT, OpenAI SearchBot, Oracle Cloud, OVHcloud, OVPN.com, PerplexityBot, Perplexity-User, Pingdom, Private Internet Access, QUIC.cloud, Rackspace, Rapid7 Sonar, Salesforce, Scaleway, Shodan, StatusCake, StormWall, Stretchoid, Sucuri, Telegram, Tencent, TOR, UpCloud, UptimeRobot, Vultr, Wasabi, Windscribe, Yandex, Zoho, Zoom, Zscaler