wireguard-chart icon indicating copy to clipboard operation
wireguard-chart copied to clipboard

Support forwarding IPv6 payloads

Open qdii opened this issue 1 year ago • 3 comments

When using the helm chart to set up a server as an egress point, Wireguard clients will connect the endpoint in IPv4, but forward IPv6 payloads.

As forwarding is only configured for IPv4 by the init script, this result in a weird state for clients browsing the internet where certain resources on the internet work and other don't work.

qdii avatar Dec 30 '24 21:12 qdii

Just as an additional note, the forwards can be setup for IPV6 but for it to function the kubernetes cluster CNI will also need to be configured to allocate IPV6 addresses for the pods.

For example

  • https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/dual-stack-support/#prerequisite-ipv6-forwarding

bryopsida avatar Jan 03 '25 15:01 bryopsida

Looking over the changes needed in the chart.

https://github.com/bryopsida/wireguard-chart/blob/60ceb2d21e245a046660523a20e2a162a52dc03e/helm/wireguard/templates/deployment.yaml#L137

Sysctl calls for IPv6 would need to be added.

Most likely IPV6 SNAT/DNAT would need to be added since most clusters allocate IPv6 addresses from a private range/prefix instead of a public prefix.

https://github.com/bryopsida/wireguard-chart/blob/60ceb2d21e245a046660523a20e2a162a52dc03e/helm/wireguard/templates/config.yaml#L7

https://linux.die.net/man/8/ip6tables-1.4.7

bryopsida avatar Jan 03 '25 16:01 bryopsida

This may be relevant: https://kubernetes.io/docs/concepts/services-networking/dual-stack/#egress-traffic

qdii avatar Jan 06 '25 21:01 qdii