Skip to content

Instantly share code, notes, and snippets.

@laduke
Last active September 23, 2023 15:53
Show Gist options
  • Save laduke/fa1e9a68a79d9038ab117ad0ab69927a to your computer and use it in GitHub Desktop.
Save laduke/fa1e9a68a79d9038ab117ad0ab69927a to your computer and use it in GitHub Desktop.
ZeroTier 6PLANE and RFC4193 address calculation

ZeroTier IPv6 Auto-Assign Addresses

https://www.zerotier.com/manual.shtml#2_2_3

  • A network ID is 16 hex digits (9bee8941b5de0691)
  • A node ID is 10 hex digits (1234512345)

ZeroTier RFC4193 (/128 for each device)

  • fd9b:ee89:41b5:de06:9199:9312:3451:2345

ZeroTier 6PLANE (/80 routable for each device)

  • fc2e:308f:d012:3451:2345:0000:0000:0001
@laduke
Copy link
Author

laduke commented Jan 21, 2019

The RFC4193 is simpler

Something like:

function toRfc4193Ip (networkId, memberId) {
  return `fd${networkId}9993${memberId}`.match(/.{1,4}/g).join(':')
}

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