To check if the IP address belongs to given CIDR range Link You can check in Python as well >>> from ipaddress import ip_network, ip_address >>> net = ip_network("1.1.0.0/16") >>> print(ip_address("1.1.2.2") in net) True