Closed nemesifier closed 4 years ago
I'd say just remove master_subnet
and all its related logic because we don't have time to implement this right now, we need to hurry up to implement #19, #17 and #10 and move on to integrate this module with the rest of OpenWISP 2.
I'm totally agree, the master subnet with nested subnets cloud be implemented in the future.
@hispanico shall we start defining how to implement this feature?
The python's ipaddress module provides some helpful functions, like subnet_of
, supernet
, etc. which we can use while implementing nested subnet feature.
Source - https://docs.python.org/3/library/ipaddress.html#ip-network-definitions
what happens if a user tries to create a new subnet which is part of an existing subnet? Does the system propose to make the new subnet a child of the parent subnet?
The system should be show a message to explain the issue:
how does the visualization of address allocation take master subnets into account?
When a subnet has at least one nested subnet, the visualization should be only the nested subnets, because we cannot add IP address into the master subnet .
If a nested subnet has been created in a master subnet with IP address already the visualization should be somting like this:
how does the visualization of address allocation take children subnets into account?
Linke the current one for the IP address with a Hierarchy field
Maybe we can create a drop-down menu with the availeble nested subnets up to the prefix /24:
@nemesisdesign @hispanico the subnet and master subnet validation checks are done on my local branch, but I am not sure about the visualizations, how do they work in case of master subnet and subnets, could explain a bit more?
The master subnet view, in case of nested subnets, shows the child subnets instead of the ip address. See the following image:
Update: Implemented the hierarchical network view for subnets. Implementing the same for IPv6, please review and suggest accordingly. :smile:
@atb00ker that looks great! Is a PR already open for that?
AFAIK this can be closed.
@hispanico what is the purpose of the master subnet field?
Right now I think the current implementation doesn't really do much with it, infact I can select pretty much any rubbish value and the system will accept it. Implementing this correctly will take effort because we'll also probably need to have any subnet which is flagged as master (by another subnet) to show part of its address space occupied.
I suggest removing it temporarily and discuss of how it should be properly implemented.