java-ipv6 icon indicating copy to clipboard operation
java-ipv6 copied to clipboard

Unable to create IPv6 larger pool with subnet after creating smaller one

Open saket141288 opened this issue 9 years ago • 1 comments

Hi,

I am getting issue in creating IPv6Address Pool creation when ever i am going to create bigger pool after creating the smaller pools. For example:

i have one parent with value "2010:8892::/20" and if i am go on creating child as "2010:8892::/48","2010:8892:1::/48" and "2010:8892:2::/56" thats fine,that value is getting out of my code only.

This is my code snippet: final IPv6AddressPool pool = IPv6AddressPool.fromRangeAndSubnet(IPv6AddressRange.fromFirstAndLast(IPv6Address.fromString(hexToIPv6Conversion(valueFrom)), IPv6Address.fromString(hexToIPv6Conversion(valueTo))), IPv6NetworkMask.fromPrefixLength(ipSubnetMask)); Iterator<IPv6Network> iterNtwrk = pool.freeNetworks().iterator();

But after that again if i want to create any child pool with subnet value "/48" for eg:"2010:8892:3::/48", this code is not allowing that is giving exception as "Given range is not aligned with prefix length [48], first address should end with 80 zero bits"

Is there any issue with my implementation or any other code i should use? Please suggest

saket141288 avatar Oct 13 '15 07:10 saket141288

Would it be possible to create a test case or snippet of code which demonstrates the problem you have without relying on code I have no access to (such as hexToIPv6Conversion). I don't understand your problem exactly based on the current description. Also I am not sure what you mean with parent and child pools.

janvanbesien avatar Oct 19 '15 07:10 janvanbesien