From 228ee7ca894e98adb40e7384730d0e4d0d88a6a6 Mon Sep 17 00:00:00 2001 From: Tom Mychost Date: Mon, 1 Apr 2024 18:40:43 +0100 Subject: [PATCH 1/2] Add support for setting IPv6 address on macOS --- pkg/vpn/interface_darwin.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/vpn/interface_darwin.go b/pkg/vpn/interface_darwin.go index 8038c737..fcb0383b 100644 --- a/pkg/vpn/interface_darwin.go +++ b/pkg/vpn/interface_darwin.go @@ -54,7 +54,13 @@ func prepareInterface(c *Config) error { // Add the address to the interface. This is not directly possible with the `net` package, // so we use the `ifconfig` command. - cmd = exec.Command("ifconfig", iface.Name, "inet", ip.String(), ip.String()) + if ip.To4() == nil { + // IPV6 + cmd = exec.Command("ifconfig", iface.Name, "inet6", ip.String()) + } else { + // IPv4 + cmd = exec.Command("ifconfig", iface.Name, "inet", ip.String(), ip.String()) + } err = cmd.Run() if err != nil { return err From 1e15bd8e84908f8ff2ee12a35333269dfeb7c50b Mon Sep 17 00:00:00 2001 From: Tom Mychost Date: Mon, 1 Apr 2024 18:44:41 +0100 Subject: [PATCH 2/2] Provide very basic instructions for enabling static IPv6 support. See #15 for current status. --- docs/content/en/docs/Getting started/cli.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/content/en/docs/Getting started/cli.md b/docs/content/en/docs/Getting started/cli.md index bdc738cc..6bd6b8cc 100644 --- a/docs/content/en/docs/Getting started/cli.md +++ b/docs/content/en/docs/Getting started/cli.md @@ -78,3 +78,12 @@ Note: Experimental feature! Automatic IP negotiation is available since version `0.8.1`. DHCP can be enabled with `--dhcp` and `--address` can be omitted. If an IP is specfied with `--address` it will be the default IP. + +## IPv6 (experimental) + +Node: Very experimental feature! Highly unstable! + +Very provisional support for IPv6 is available using static addresses only. Currently only one address is supported per interface, dual stack is not available. +For more information, checkout [issue #15](https://github.com/mudler/edgevpn/issues/15) + +IPv6 can be enabled with `--address fd:ed4e::/64` and `--mtu >1280`.