Say I have two IPs:
startip = '18.104.22.168' and
endip = '22.214.171.124'
I understand that in python
netaddr.iprange_to_cidrs(startip, endip) will give you a list of CIDR subnets that fit exactly between the boundaries. However, I was hoping to go for one CIDR subnet that covers it all even if it gives a few more IPs.
I prefer a function that does it, but I would also welcome any math/logic to calculate it and eventually turn it into code.