Pod-forwarded VPN traffic to Cilium L2 LoadBalancer VIP fails with ICMP host unreachable
Is there an existing issue for this?
- I have searched the existing issues
Version
equal or higher than v1.18.12 and lower than v1.19.0
What happened?
Summary
Traffic forwarded from a VPN pod to a Cilium LoadBalancer VIP advertised by L2 announcements fails with ICMP host unreachable.
The same VPN tunnel can reach the Kubernetes API on the node IP, but cannot reach internal applications exposed through a Cilium LoadBalancer IP used by Traefik.
This looks like a Cilium datapath/L2 LB VIP edge case involving forwarded traffic from a pod.
Environment
- Kubernetes distribution: Talos
- Cluster topology: single-node cluster
- CNI: Cilium
- Cilium version/chart:
1.18.6 - kube-proxy replacement: enabled
- LoadBalancer IPAM: used for service VIPs
- L2 announcements: enabled
- VPN: WireGuard running in a Kubernetes pod via
wireguard-operator - Ingress: Traefik Gateway behind a Cilium LoadBalancer service
- Node LAN IP:
192.168.1.16 - Traefik internal LoadBalancer VIP:
192.168.1.228 - WireGuard pod IP:
10.244.0.50 - WireGuard client IP:
10.8.0.14
Relevant Cilium values:
cilium:
kubeProxyReplacement: true
l2announcements:
enabled: true
externalIPs:
enabled: true
ciliumEndpointSlice:
enabled: true
loadBalancer:
algorithm: maglevL2 announcement policy:
apiVersion: cilium.io/v2alpha1
kind: CiliumL2AnnouncementPolicy
metadata:
name: default-l2-announcement-policy
namespace: kube-system
spec:
externalIPs: true
loadBalancerIPs: trueTraefik service:
traefik LoadBalancer 192.168.1.228 80/TCP,443/TCPWireGuard service:
wireguard-svc NodePort 51820:31820/UDPExpected Behavior
A VPN client connected to the WireGuard pod should be able to reach the Cilium LoadBalancer VIP:
10.8.0.14 -> 192.168.1.228:443The packet should be forwarded to the Traefik service/backend, the same as a normal LAN client hitting 192.168.1.228:443.
Actual Behavior
The WireGuard tunnel works and traffic reaches the WireGuard pod.
The VPN client can reach the Kubernetes API on the real node IP:
10.8.0.14 -> 192.168.1.16:6443But traffic to the Cilium LoadBalancer VIP fails:
10.8.0.14 -> 192.168.1.228:443Tcpdump from a debug container attached to the WireGuard pod network namespace shows:
wg0 In IP 10.8.0.14.55140 > 192.168.1.228.443: Flags [S], length 0
eth0 Out IP 10.244.0.50.55140 > 192.168.1.228.443: Flags [S], length 0
eth0 In IP 192.168.1.16 > 10.244.0.50: ICMP host 192.168.1.228 unreachable, length 68
wg0 Out IP 192.168.1.16 > 10.8.0.14: ICMP host 192.168.1.228 unreachable, length 68So the VPN pod forwards the packet, but the node responds that the Cilium LoadBalancer VIP is unreachable.
Additional Observations
- The WireGuard tunnel is active and handshakes successfully.
- The VPN client can reach the Kubernetes API using the real node IP.
- A pod can originate traffic to the LoadBalancer VIP directly.
- The failure appears specific to traffic forwarded through the VPN pod toward the Cilium LoadBalancer VIP.
- Running a Tailscale subnet router in userspace networking mode avoids the issue, likely because it opens outbound userspace connections instead of relying on kernel forwarding from a pod interface.
Questions
Is traffic forwarded from a pod to a Cilium LoadBalancer IP advertised by L2 announcements expected to work?
If yes, what Cilium setting should allow this datapath?
If no, is the recommended solution to run the VPN router with hostNetwork: true, or is there a supported way to make pod-forwarded VPN traffic reach Cilium LoadBalancer VIPs?
How can we reproduce the issue?
Deploy a single-node Kubernetes cluster with Cilium.
Relevant Cilium settings:
kubeProxyReplacement: true l2announcements: enabled: true externalIPs: enabled: trueCreate a Cilium L2 announcement policy for LoadBalancer IPs.
apiVersion: cilium.io/v2alpha1 kind: CiliumL2AnnouncementPolicy metadata: name: default-l2-announcement-policy spec: externalIPs: true loadBalancerIPs: trueExpose an HTTP/HTTPS ingress controller using a Cilium LoadBalancer IP from the LAN subnet.
Example:
Node LAN IP: 192.168.1.16 LoadBalancer VIP: 192.168.1.228 Ingress controller: TraefikDeploy WireGuard inside Kubernetes as a normal pod, not
hostNetwork.The WireGuard pod should route client traffic from a VPN subnet, for example:
WireGuard pod IP: 10.244.0.50 WireGuard interface: wg0 VPN client IP: 10.8.0.14 Routed LAN subnet: 192.168.1.0/24Connect a remote WireGuard client.
From the WireGuard client, access the Cilium LoadBalancer VIP:
curl -vk https://192.168.1.228Or access a hostname that resolves to the VIP:
curl -vk https://grafana.home.Attach tcpdump to the WireGuard pod network namespace.
Example:
kubectl debug -n wireguard pod/<wireguard-pod> -it \ --image=nicolaka/netshoot \ --target=<wireguard-container> \ -- tcpdump -ni any 'host 192.168.1.228 or icmp or udp port 51820'Observe that the VPN client SYN reaches the WireGuard pod and is forwarded out of the pod:
wg0 In IP 10.8.0.14.55140 > 192.168.1.228.443: Flags [S], length 0 eth0 Out IP 10.244.0.50.55140 > 192.168.1.228.443: Flags [S], length 0Observe that the node replies with
ICMP host unreachablefor the LoadBalancer VIP:eth0 In IP 192.168.1.16 > 10.244.0.50: ICMP host 192.168.1.228 unreachable, length 68 wg0 Out IP 192.168.1.16 > 10.8.0.14: ICMP host 192.168.1.228 unreachable, length 68Verify that the same VPN client can reach the real node IP, for example the Kubernetes API:
curl -k https://192.168.1.16:6443This confirms the VPN route itself works and the failure is specific to the Cilium LoadBalancer VIP.
Optional control test: from inside a normal pod, originate traffic to the LoadBalancer VIP:
wget http://192.168.1.228In my cluster, pod-originated traffic to the VIP works, but forwarded VPN traffic from the pod fails.
Cilium Version
v1.18.6 Running images: quay.io/cilium/cilium:v1.18.6 quay.io/cilium/operator-generic:v1.18.6
Kernel Version
OS-IMAGE: Talos (v1.13.7) KERNEL-VERSION: 6.18.39-talos (amd64) Kubernetes: v1.36.2 Container runtime: containerd://2.2.6
Kubernetes Version
Client Version: v1.36.3 Kustomize Version: v5.8.1 Server Version: v1.36.2
Regression
No response
Sysdump
No response
Relevant log output
Anything else?
No response
Cilium Users Document
- Are you a user of Cilium? Please add yourself to the Users doc
Code of Conduct
- I agree to follow this project's Code of Conduct
Source: cilium/cilium