change subnet mask requires redo of all hosts on the subnet?
Of course, I had already entered the router and all its many interfaces into ONA.
ONA would not let me update the incorrect netmask as long as there were hosts on the network.
I ended up manually updating in the database after verifying the correct value with a hand-rolled php script:
ONA handled the update happily. Nothing changed regarding the hosts since the netmask is stored in the subnets table,
and the interfaces table just contains a subnet_id as a foreign key to the subnets table.
I understand that netmask updates are dangerous if there are interfaces that would be excluded from the redefined
subnet. But couldn't that be determined programmatically? I'd rather not risk updating the DB by hand if at all possible...
First off, the typical logic is that you add a subnet and it will automatically be aware of the broadcast and the network address. Then all addresses between are available for hosts. This becomes a problem for /32 and /31 subnets.
I still need to work out the details on how to track these types of addresses. There are a few challenging bits about it like the fact that adding a /32 subnet is easy, this does create an IP interface so you would be unable to search for the host using that IP. I think these things can be worked around, I just need to figure out the logic.
As far as changing a mask from a larger one to a smaller, or even just changing IP addresses in general. I do have an interface_move dcm module that allows you define a source and destination range. You can easily move in bulk, any addresses that would become abandoned. What I dont have is a GUI interface for it yet. I'll see about working one up as it should simple. Also I might add a method in it that allows you to "split" a subnet which is a similar but slightly trickier task due to the checks that are in place.
Hope that explains whats going on. No real fixes as of yet however...................
BTW you can use the subnet calculator tool to display what your little script did for you. Its the little icon hanging on the right of your screen below the top bar.
Ideal would be something like:
Block (defined range where loopbacks would be assigned from) -> Host/Interface
Block -> Subnet -> Host/Interface
I'm open to workarounds if anyone has one.
Hopefully I can find an old copy that still has this work in it. ............ That or I just try and remember what I did.
check back soon.
I'm seeing the updates I would expect in the latest released version.. I'm just not seeing why its failing at the moment. Still looking into that one.
Anyway, give gmp a try.
Do the updates you mention also cover subnets with a /31 mask which we use for point-to-points? Thanks.
Yes it supports /31 as well for P2P links.
You might install from there if you have not yet. It "should" work for you.. I'm looking at the code that is in the latest tarball release and I dont see any differences there that should matter so I'm puzzled as to why its not working for you.
I'm pretty confident the code itself is capable. it would seem there is something else at play, maybe php related? Lets give the github code a try and see?
I think I will try a fresh install somewhere and see if I can figure out the differences. Will keep you posted. Thanks.
With that said, I have noted that there is still a problem that I need to fix. it seems that the top end check is still failing so on a /31 subnet I can add the first IP but not the second. On a /32 it wont work at all since there is only the one IP.
I must still be missing something because I know I have added /32 hosts before.. ... more to come....