How can I get the CIDR notation representing a range of IP addresses, given the starting and ending IP addresses of the range, in Python? I can find the CIDR for the IP range, but I can not find the code for the opposite.
An example of the desired result:
startip = '63.223.64.0' endip = '63.223.127.255' return '63.223.64.0/18'
source share