Skip to content

Latest commit

 

History

History

task-003-if-IP-belongs-to-CIDR

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

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