check for subnet conflicts

I'm writing a script that gets a /16 and breaks it down into different subnets (/24, 23, 27, etc). I realized that I may run into conflicting subnets, and I'm looking for a way to check that. I haven't found anything within ipcalc or netaddr that addresses this specifically. Thank youf or your help

def subnetting(self, cidrBlock, subnets):
            networks = subnets
            cidrblock = cidrBlock
            assigned_subnets = []
            ipnetwork = IPNetwork(cidrblock)
            subnet_list = ipnetwork.subnet(int(subnets))
            for subnet in subnet_list:
            return assigned_subnets


To compare two subnets to see if they conflict, you need to apply the smallest mask to both to see if they are equal. If they are equal, then you have a conflict.

I will assume the network. If you create and, you compare them by applying the mask for /23 ( to both and AND = AND =

They are equal, so they overlap and conflict.

Try with ipconflict.



conflict found: <->

Need Your Help

node.js - DatePicker jquery UI not workinng

jquery jquery-ui node.js

I am trying to use JQuery UI datepicker in my node.js project and it doesn't work.

Rewrite url from /forum/page/ to /page/ (actual files are located within /forum/)

regex apache .htaccess mod-rewrite

I have forum files located within a folder directory. Right now my urls look like this