Skip to content

Instantly share code, notes, and snippets.

@Maverik
Created September 15, 2024 21:36
Show Gist options
  • Save Maverik/67df3b19d3828640704ef19e9b399e6a to your computer and use it in GitHub Desktop.
Save Maverik/67df3b19d3828640704ef19e9b399e6a to your computer and use it in GitHub Desktop.
Generate IPv6 Private Prefix

Prefix using RFC 4193

Seed

Generate bytes from local server

echo "$(date +%s%N)$(cat /var/lib/dbus/machine-id)" | sha1sum | cut -c 31-

output of the form:

65ede472f0 -

ULA

Combine with FD in 2 + 4 + 4 format to get prefix

fd65:ede4:72f0::/64

Credits

Condensed from excellent article at Digital Ocean - How To Set Up WireGuard on Debian 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment