Wireguard Link-Local Address Generator

Akaza Akari, smiling, heart near left eye, greets visitor

Wireguard Link-Local Address Generator

Here, you can hash WireGuard private key and form an IPv6 link-local address.

How?

llOfWgPubKey :: PublicKey → IPv6Addr llOfWgPubKey pubkey = let digest: Array[u8, 8] = blake2s pubkey in ofOctets [0xfe, 0x80, 0, 0, 0, 0, 0, 0, ..digest];;

Why?

Statically assigning IP addresses to devices is annoying and SLAAC is pretty easy and works well over WireGuard.

Though for it to work, you need a link-local IP address.For Ethernet networks, MAC address is commonly used and Wireguard public keyis pretty much an equivalent for that. It is the thing you have to have and itidentifies the peer in the network.