gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.5k stars 552 forks source link

[Bug]: Weird/Broken IPv6-Addressing #1679

Closed Ruakij closed 6 months ago

Ruakij commented 2 years ago

Contact Details

No response

What happened?

When enabling IPv6 for a netmaker-network, the auto-generated IPv6-addresses for nodes may be wrong/invalid.

Unlike with IPv4, Addressing doesnt start with the 0+1-Address of the CIDR, but 0. Example: Prefix is fd00::/64 First Node gets Address: fd00::

That is the Subnet-Router anycast address as per RFC4291 (2.6.) and maybe shouldnt be used for an individual-node.

Furthermore, i have found out, netmaker handles the Addresses weirdly. When manually setting a node to have the Address fd00::0, the next node will still take fd00::, even though its the same address, thus creating an address-conflict.

Version

v0.16.1

What OS are you using?

Linux

Relevant log output

No response

Contributing guidelines

kwinsch commented 2 years ago

Also noted, that the netmaker-1 node gets the last possible address :ffff:ffff:ffff:ffff. This is also wrong and should be set to a lower value. Why not start with ::1' and end with:ffff:ffff:ffff:fffe`.

For dual stack configurations, it might be worthwhile to checkout RFC 4038 and use the same addresses for IPv4 and IPv6.