visualsubnetcalc
visualsubnetcalc copied to clipboard
Any roadmap for IPv6?
This is something I would like to do but I don't have a timeline yet. I'm not as familiar with IPv6, are there any IPv6-specific features you would look for? Otherwise just equivalent functionality but with IPv6 addresses...
Totally understandable. For v6 I suppose you could to split all the way from /1 to /128, but in reality, doing the splitting in increments of 16 or 4-8 would actually be better for screen real estate in my opinion. That's what we use mostly anyways. It's rare they are divided smaller than that.
I took a brief look at your code. And it looks like the main HTML page does the input validation for v4 via regex. Something similar could be done for v6 with this:
^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(?=/(1[0-2][0-8]|[1-9][0-9]?|[1-9])$).*$
And then just calculate the usable host range by using this simple formula: 2^(128 - [mask])
On Wed, Jun 7, 2023 at 12:55 PM Caesar Kabalan @.***> wrote:
This is something I would like to do but I don't have a timeline yet. I'm not as familiar with IPv6, are there any IPv6-specific features you would look for? Otherwise just equivalent functionality but with IPv6 addresses...
— Reply to this email directly, view it on GitHub https://github.com/ckabalan/visualsubnetcalc/issues/3#issuecomment-1581198470, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHL2ZZIXESSTLMMHHTRVTXKCXBVANCNFSM6AAAAAAY4YJEEM . You are receiving this because you authored the thread.Message ID: @.***>
Yes v6 would be awesome! limiting splits to levels divisible by 4 and not allowing splits past /64 would be good but just plain v6 support would be a big step up from the options we have today.
I use the following for IPv6 Regex:
^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9]))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9]))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9]))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9]))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?[0-9]))|:)))$
It was taken from this code: https://www.powershellgallery.com/packages/IPv6Regex/1.1.1/Content/IPv6Regex.psm1 I have found it to be more reliable and covers more test cases.
Just saw this on TLDR, and yeah, v6 support would be nice. And yeah, you might actually need to split past /64 (some virtual services use /80 or /112).