Can't enroll machines if ip_prefix is an ipv6 prefix #75

Closed
opened 2025-12-29 01:21:43 +01:00 by adam · 2 comments
Owner

Originally created by @afics on GitHub (Nov 10, 2021).

ip_prefix: fd42::/56 is set in the config.

After trying to enroll a new machine with headscale -n test nodes register xxx I get:

panic: As4 called on IPv6 address

goroutine 1 [running]:
inet.af/netaddr.IP.As4(0x20010678018c2600, 0x0, 0xc000122210, 0x0)
	inet.af/netaddr@v0.0.0-20210903134321-85fa6c94624e/netaddr.go:776 +0xd1
github.com/juanfont/headscale.(*Headscale).getAvailableIP(0xc000394240, 0x0, 0x11b82c0, 0xc0004243f0)
	github.com/juanfont/headscale/utils.go:96 +0x165
github.com/juanfont/headscale.(*Headscale).RegisterMachine(0xc000394240, 0x7ffe0ffc1aa6, 0x40, 0x7ffe0ffc1a92, 0x4, 0x0, 0x0, 0xc000145b00)
	github.com/juanfont/headscale/cli.go:30 +0x277
github.com/juanfont/headscale/cmd/headscale/cli.glob..func9(0x16fdce0, 0xc0005cb4d0, 0x1, 0x3)
	github.com/juanfont/headscale/cmd/headscale/cli/nodes.go:57 +0x207
github.com/spf13/cobra.(*Command).execute(0x16fdce0, 0xc00014c200, 0x3, 0x4, 0x16fdce0, 0xc00014c200)
	github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x16fc3e0, 0xc0001bc200, 0xc00048e820, 0xc0005fa000)
	github.com/spf13/cobra@v1.2.1/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.2.1/command.go:902
github.com/juanfont/headscale/cmd/headscale/cli.Execute()
	github.com/juanfont/headscale/cmd/headscale/cli/root.go:25 +0x31
main.main()
	github.com/juanfont/headscale/cmd/headscale/headscale.go:80 +0x2cb

This is with v0.11.0

Originally created by @afics on GitHub (Nov 10, 2021). `ip_prefix: fd42::/56` is set in the config. After trying to enroll a new machine with `headscale -n test nodes register xxx` I get: ``` panic: As4 called on IPv6 address goroutine 1 [running]: inet.af/netaddr.IP.As4(0x20010678018c2600, 0x0, 0xc000122210, 0x0) inet.af/netaddr@v0.0.0-20210903134321-85fa6c94624e/netaddr.go:776 +0xd1 github.com/juanfont/headscale.(*Headscale).getAvailableIP(0xc000394240, 0x0, 0x11b82c0, 0xc0004243f0) github.com/juanfont/headscale/utils.go:96 +0x165 github.com/juanfont/headscale.(*Headscale).RegisterMachine(0xc000394240, 0x7ffe0ffc1aa6, 0x40, 0x7ffe0ffc1a92, 0x4, 0x0, 0x0, 0xc000145b00) github.com/juanfont/headscale/cli.go:30 +0x277 github.com/juanfont/headscale/cmd/headscale/cli.glob..func9(0x16fdce0, 0xc0005cb4d0, 0x1, 0x3) github.com/juanfont/headscale/cmd/headscale/cli/nodes.go:57 +0x207 github.com/spf13/cobra.(*Command).execute(0x16fdce0, 0xc00014c200, 0x3, 0x4, 0x16fdce0, 0xc00014c200) github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x16fc3e0, 0xc0001bc200, 0xc00048e820, 0xc0005fa000) github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.2.1/command.go:902 github.com/juanfont/headscale/cmd/headscale/cli.Execute() github.com/juanfont/headscale/cmd/headscale/cli/root.go:25 +0x31 main.main() github.com/juanfont/headscale/cmd/headscale/headscale.go:80 +0x2cb ``` This is with `v0.11.0`
adam closed this issue 2025-12-29 01:21:44 +01:00
Author
Owner

@juanfont commented on GitHub (Nov 10, 2021):

I am afraid IPv6 is not yet supported...

@juanfont commented on GitHub (Nov 10, 2021): I am afraid IPv6 is not yet supported...
Author
Owner

@enoperm commented on GitHub (Nov 10, 2021):

I haven't investigated it further since I made the initial changes, but #208 might be of interest.

@enoperm commented on GitHub (Nov 10, 2021): I haven't investigated it further since I made the initial changes, but #208 might be of interest.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#75