💾 Archived View for thrig.me › blog › 2024 › 12 › 02 › ula.gmi captured on 2024-12-17 at 10:40:59. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Exciting stuff. These are presumably globally unique IPv6 addresses intended for local communications, and are not expected to be routable globally. The presumably part is because someone could end up using the same 40-bit global ID (and 16-bit subnet ID) as you did, and then your companies merge, and then you have a problem. This is more likely if you have companies to merge, and if the ID are chosen …poorly, such as 0, 42, 640, 0xDEADBEEF, and similar that have good cultural but bad random properties.
RFC 4193 contains the details, but tooling here may help as IPv6 addresses are tricky and easy for humans (and code running on computers) to screw up. For example, someone had recently been given the equivalent of fde3:de56:900e::8c97::1 as the gateway address, and thus was asking others for networking help.
fde3:de56:900e::8c97:1 or fde3:de56:900e:8c97::1 are unique local unicast addresses; there's a 40-bit global ID and a 16-bit subnet ID, followed by 64-bits for whatever interface ID you want, though those 64 bits could instead by handled by SLAAC or DHCPv6. One is supposed to pick the global ID randomly; the RFC has a very complicated specification involving NTP and interface MAC addresses and bearded ladies but my code simply fills the 40 bits via arc4random_buf(3). The subnet could also be randomized to reduce the chance of conflicts, or you could start at 0 and reserve them on a wiki as your site grows.
$ v6ula -s 0xBEEF -i 42 fd24:e451:f884:beef::2a 24E451F884 BEEF 2A
A productive use for such addresses might be to do IPv6 over wireguard, or more likely to practice doing IPv6 over wireguard for the unlikely case that someone paying money actually needs something like that.