Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After adding IPv6 prefix in config, existing machines don't get IPv6 addresses #614

Closed
viq opened this issue Jun 6, 2022 · 5 comments · Fixed by #1869
Closed

After adding IPv6 prefix in config, existing machines don't get IPv6 addresses #614

viq opened this issue Jun 6, 2022 · 5 comments · Fixed by #1869
Labels
bug Something isn't working

Comments

@viq
Copy link

viq commented Jun 6, 2022

Configuration without any prefixes defined, thus using only the default 100.64.0.0/10. A few machines connected. Added IPv6 prefix (shown in examples fd7a:115c:a1e0::/48), restarted headscale. Even after restarting their services, existing machines did not get IPv6 addresses, that required removing them from headscale and adding anew.

  • set up config only with IPv4 prefix
  • add some machines
  • add IPv6 prefix to configuration
  • only newly added machines receive IPv6 address

Context info

  • headscale 0.15.0
  • tailscale 1.24.2
  • OS: headscale on NixOS (unstable); tailscale on NixOS (unstable), OpenBSD (snapshots); FreeBSD 12.3
@viq viq added the bug Something isn't working label Jun 6, 2022
@kradalby
Copy link
Collaborator

kradalby commented Jun 11, 2022

This highlights a couple of other issues as well, since the IP is only given when a node joins, it will not update if the user:

  • adds more networks (like described here)
  • removes a network
  • changes a network

Not sure yet what would be the best approach.

We could;

  • Check periodically if what we have in the DB aligns with the config
  • Check when a node wakes up/reconnects

@kradalby kradalby added this to the v0.17.0 milestone Jun 11, 2022
@kradalby kradalby modified the milestones: v0.17.0, v0.19.0 Oct 28, 2022
@gbraad
Copy link

gbraad commented Jul 3, 2023

So this also means that when IPv6 is removed, it will still show an IPv6 address for nodes that have registered before the change... and probably also when the range changed?

@kradalby kradalby removed this from the v0.19.0 milestone Dec 10, 2023
Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Mar 10, 2024
@viq
Copy link
Author

viq commented Mar 10, 2024 via email

@kradalby
Copy link
Collaborator

I've given this some thought, and it is definitively possible to do this now with the new allocator, what I am unsure about is "when" to do it, I first thought about it as a check every time we load a node, but it has a lot of sharp edges, both resource and what if:

  • you had ipv4 and added ipv6?
  • you had both, removed ipv6?
  • all the other combos.

What I am leaning towards is having a "back fill based on current setting function" that can be called via CLI/API, and nothing automatic.

So if you have ipv4, and add ipv6, this func will iterate over all machines and add ipv6 if its missing. or if you have both and remove ipv6, it will iterate over and remove all ipv6 addrs.

Yes it is a manual step, but this should be something needed on only rare occasions?

kradalby added a commit to kradalby/headscale that referenced this issue Apr 15, 2024
Updates juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 15, 2024
Updates juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 15, 2024
Updates juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 15, 2024
Fixes juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 15, 2024
Fixes juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 16, 2024
Updates juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this issue Apr 16, 2024
Fixes juanfont#614

Signed-off-by: Kristoffer Dalby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants