A CiliumEgressGatewayPolicy steers matching packets to a gateway node that masquerades them with its egress IP. If the policy finds no gateway or the gateway doesn't have the given IP, packets are dropped – Cilium does not fall back to the node IP.
Symptom
k exec app -- curl -s -m3 http://172.16.0.123:8000/; echo "exit=$?" exit=28
Only the pods matching the policy's selector run into the timeout. Other pods on the same node still reach the destination.
Diagnosis
Look at the pod's dropped packets with their reason, then at the eBPF map of the agent on the pod's node.
k -n kube-system exec $C2 -c cilium-agent -- cilium-dbg bpf egress list hubble observe -P --port-forward-port 0 --from-pod tag16/app \ --verdict DROPPED --last 1 Source IP Destination CIDR Egress IP Gateway IP Egress Ifindex 10.0.2.18 172.16.0.123/32 0.0.0.0 Not Found 0 Nov 18 23:52:50.720: tag16/app:37832 (ID:59425) <> 172.16.0.123:8000 (world) No egress gateway found DROPPED (TCP Flags: SYN)
Causes
No gatewayNo node matches the nodeSelector
If the gateway node fails or loses its label, the policy finds no gateway. Gateway IP then shows "Not Found".
Egress IPegressIP doesn't exist on the gateway node
With egressIP or interface you pin the source IP. The IP must really exist on the gateway node, otherwise packets are dropped with "No Egress IP configured".
k patch cegp tag16-egw --type=merge \
-p '{"spec":{"egressGateway":{"egressIP":"172.16.0.99"}}}'
k -n kube-system exec $C1 -c cilium-agent -- cilium-dbg bpf egress list
Source IP Destination CIDR Egress IP Gateway IP Egress Ifindex
10.0.2.18 172.16.0.123/32 0.0.0.0 172.16.0.228 0
No Egress IP configured DROPPED (TCP Flags: SYN)Fix
k label node worker2 egress-node=true k -n kube-system exec $C2 -c cilium-agent -- cilium-dbg bpf egress list k exec app -- curl -s -m3 http://172.16.0.123:8000/ node/worker2 labeled Source IP Destination CIDR Egress IP Gateway IP Egress Ifindex 10.0.2.18 172.16.0.123/32 172.16.0.83 172.16.0.83 2 hallo vom router
Cilium hands-on, day 16: egress gateway with a fixed source IP, proven via eBPF map, tcpdump and Hubble, plus gateway node failure.
Go to day 16 →
FAQ
Why doesn't Cilium just send the traffic out directly without a gateway?
Without a gateway, packets are dropped, not sent out directly – the firewall outside never sees an unexpected IP.
What has to be enabled for the egress gateway?
egressGateway.enabled=true and BPF masquerading (bpf.masquerade=true) instead of iptables, plus kube-proxy replacement.