Egress Connectivity Requirements: CCA practice questions
Traffic that leaves a Cilium cluster has to look acceptable to the network outside. Pod IPv4 addresses usually come from private ranges, so by default Cilium masquerades the source of traffic leaving the cluster to the IPv4 address of the node, which the surrounding network can route. The switches enable-ipv4-masquerade and enable-ipv6-masquerade control this per family.
By Ibrahim Yesilay · Published · Updated
Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.
What Egress Connectivity Requirements covers in CCA
Traffic that leaves a Cilium cluster has to look acceptable to the network outside. Pod IPv4 addresses usually come from private ranges, so by default Cilium masquerades the source of traffic leaving the cluster to the IPv4 address of the node, which the surrounding network can route. The switches enable-ipv4-masquerade and enable-ipv6-masquerade control this per family.
Not every destination should be masqueraded. Cilium leaves traffic to the local node's allocation CIDR alone, and ipv4-native-routing-cidr widens that exclusion when pod addresses are routable across a larger network; in public clouds the VPC range is detected automatically, so pods reach VMs in the same VPC with their own addresses. For finer control the eBPF ip-masq-agent, enabled with ipMasqAgent.enabled, reads a list of nonMasqueradeCIDRs from configuration and falls back to a default list of private and reserved ranges when the file is empty.
Masquerading has two implementations. The eBPF one, enabled with bpf.masquerade=true, is described as the most efficient; it runs on the devices selected for BPF NodePort, handles TCP, UDP and a few ICMP types, and depends on the BPF NodePort feature. The legacy iptables one works on any kernel and masquerades traffic leaving through non-Cilium devices, optionally limited with egress-masquerade-interfaces.
Masquerading to the node address is not enough when an external firewall expects one fixed source. Node IPs change and every node uses its own, so Cilium offers the egress gateway. A cluster-scoped CiliumEgressGatewayPolicy selects source pods with a podSelector, using io.kubernetes.pod.namespace for namespaces, lists destinationCIDRs and optional excludedCIDRs, and names a gateway node through a nodeSelector. The gateway SNATs the matching traffic to an egressIP, the first address of a named interface, or the address of the default-route interface; setting both egressIP and interface makes Cilium ignore the policy. If no node matches the gateway selector, matching traffic is dropped. The feature needs BPF masquerading and the kube-proxy replacement, does not work with Cluster Mesh, and policies apply to new pods only after a short delay.
Egress is also a question of permission and rate. Network policy controls which external destinations are allowed, through the world entity, CIDR rules or toFQDNs with the DNS proxy. The bandwidth manager limits a pod's egress rate from the kubernetes.io/egress-bandwidth annotation, using EDT and eBPF on the native devices, and is off until bandwidthManager.enabled is set.
Key points
- Masquerading to the node IPv4 address is on by default for traffic leaving the cluster.
- ipv4-native-routing-cidr and the ip-masq-agent nonMasqueradeCIDRs list keep pod source IPs for routable ranges.
- Egress gateway requires BPF masquerading and kube-proxy replacement and is incompatible with Cluster Mesh.
- A CiliumEgressGatewayPolicy is cluster-scoped and selects namespaces with the io.kubernetes.pod.namespace label.
Three sample questions
11 CCA questions on Egress Connectivity Requirements, 11 with explanations. How practice works
Question 1
- A.The pod IP address, because Cilium never rewrites source addresses
- B.A random address from the pod CIDR of the node
- C.The IPv4 address of the node the pod runs on
- D.The cluster IP of the kube-dns Service
Correct answer: C
Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Masquerading, Cilium docs: Routing
Question 2
- A.enable-ipv4-masquerade: true
- B.egress-masquerade-interfaces: 10.0.0.0/8
- C.enable-remote-node-masquerade: "true"
- D.ipv4-native-routing-cidr: 10.0.0.0/8
Correct answer: D
Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Masquerading, Cilium docs: Routing
Question 3
- A.bpf.masquerade=true
- B.ipMasqAgent.enabled=true
- C.enableIPv4Masquerade=false
- D.kubeProxyReplacement=false
Correct answer: A
Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Masquerading, Cilium docs: Egress Gateway
Practice this topic
Focus mode keeps every question on Egress Connectivity Requirements until you leave it. 10 free guest answers, then a free account; no credit card.
Or open CCA practice across all topics.
Sources
The explanation above was checked against these official documents.
- Cilium docs: Masquerading (checked 2026-10-28)
- Cilium docs: Egress Gateway (checked 2026-10-28)
- Cilium docs: Bandwidth Manager (checked 2026-10-28)
- Cilium docs: Routing (checked 2026-10-28)
Frequently asked questions
What happens if the egress gateway node cannot be selected?
When no node matches the gateway nodeSelector, Cilium drops the traffic that matches the policy's destination CIDRs rather than sending it out through another node.