Skip to content

Commit

Permalink
Merge pull request #165 from CodedInternet/IPv6
Browse files Browse the repository at this point in the history
Fix IPv6 support on macOS and provide very basic documentation detailing how it can be used
  • Loading branch information
mudler committed Apr 11, 2024
2 parents 1ae9a98 + 1e15bd8 commit 6ab9ef6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/content/en/docs/Getting started/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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::<IP>/64` and `--mtu >1280`.
8 changes: 7 additions & 1 deletion pkg/vpn/interface_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6ab9ef6

Please sign in to comment.