Categories
Networking

The official Telegram CIDR list

If for whatever reason you have the need to reroute or block Telegram Messenger traffic, at some point, you would have come across an ASN list with a list of /22 IPv4 blocks and one or two /48 IPv6 blocks. If you’ve hastily based your firewall rules on that list, you’ll notice it works only intermittently. That’s because the list is incomplete. JTT got you covered and you have come to the right place! Below are the known CIDR used by the Telegram Messenger service:

149.154.167.99/32
149.154.175.10/32
149.154.167.40/32
149.154.167.42/32
149.154.175.117/32
149.154.175.50/32
149.154.167.50/32
149.154.167.51/32
149.154.175.100/32
149.154.167.91/32
149.154.167.90/32
149.154.165.120/32
149.154.166.120/32
149.154.164.250/32
149.154.167.117/32
149.154.167.118/32
149.154.167.192/27	
149.154.164.8/29 
91.108.8.0/27  
91.108.12.0/27
91.108.16.0/27
91.108.56.0/24
91.108.4.0/24
149.154.160.0/22
149.154.164.0/22
149.154.168.0/22
149.154.172.0/22
91.108.56.0/22
91.108.4.0/22
91.108.8.0/22
91.108.16.0/22
91.108.12.0/22
149.154.160.0/20
2001:b28:f23d:f001::e/128
2001:67c:4e8:f002::e/128
2001:b28:f23d:f003::e/128
2001:b28:f23d:f001::a/128
2001:67c:4e8:f002::a/128
2001:b28:f23d:f003::a/128
2001:67c:4e8:f004::a/128
2001:b28:f23f:f005::a/128
2001:67c:4e8:fa60::/64
2001:b28:f23d::/48
2001:b28:f23f::/48
2001:67c:4e8::/48

Cut and paste the following ipsets to easily apply these CIDR in conjunction with iptables and ip6tables rules:

ipset create telegramv4 hash:net family inet
ipset create telegramv6 hash:net family inet6
ipset create telegram list:set
ipset add telegram telegramv4
ipset add telegram telegramv6
ipset add telegramv4 149.154.167.99/32
ipset add telegramv4 149.154.175.10/32
ipset add telegramv4 149.154.167.40/32
ipset add telegramv4 149.154.167.42/32
ipset add telegramv4 149.154.175.117/32
ipset add telegramv4 149.154.175.50/32
ipset add telegramv4 149.154.167.50/32
ipset add telegramv4 149.154.167.51/32
ipset add telegramv4 149.154.175.100/32
ipset add telegramv4 149.154.167.91/32
ipset add telegramv4 149.154.167.90/32
ipset add telegramv4 149.154.165.120/32
ipset add telegramv4 149.154.166.120/32
ipset add telegramv4 149.154.164.250/32
ipset add telegramv4 149.154.167.117/32
ipset add telegramv4 149.154.167.118/32
ipset add telegramv4 149.154.167.192/27
ipset add telegramv4 149.154.164.8/29
ipset add telegramv4 91.108.8.0/27
ipset add telegramv4 91.108.12.0/27
ipset add telegramv4 91.108.16.0/27
ipset add telegramv4 91.108.56.0/24
ipset add telegramv4 91.108.4.0/24
ipset add telegramv4 149.154.160.0/22
ipset add telegramv4 149.154.164.0/22
ipset add telegramv4 149.154.168.0/22
ipset add telegramv4 149.154.172.0/22
ipset add telegramv4 91.108.56.0/22
ipset add telegramv4 91.108.4.0/22
ipset add telegramv4 91.108.8.0/22
ipset add telegramv4 91.108.16.0/22
ipset add telegramv4 91.108.12.0/22
ipset add telegramv4 149.154.160.0/20
ipset add telegramv6 2001:b28:f23d:f001::e/128
ipset add telegramv6 2001:67c:4e8:f002::e/128
ipset add telegramv6 2001:b28:f23d:f003::e/128
ipset add telegramv6 2001:b28:f23d:f001::a/128
ipset add telegramv6 2001:67c:4e8:f002::a/128
ipset add telegramv6 2001:b28:f23d:f003::a/128
ipset add telegramv6 2001:67c:4e8:f004::a/128
ipset add telegramv6 2001:b28:f23f:f005::a/128
ipset add telegramv6 2001:67c:4e8:fa60::/64
ipset add telegramv6 2001:b28:f23d::/48
ipset add telegramv6 2001:b28:f23f::/48
ipset add telegramv6 2001:67c:4e8::/48

You’re welcome 🙂

Authoritative source: https://core.telegram.org/resources/cidr.txt

Leave a Reply