Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Announce Services to the network with BGP and Cilium

By updated

Improve this page

Outside a cloud, a LoadBalancer Service gets no address, and even when it gets one, the network around the cluster does not know where to send it. The Cilium BGP control plane solves both problems. An address pool (CiliumLoadBalancerIPPool) gives the Service an address. Then each node opens a BGP session with a router on the network and announces that address, along with the range of addresses of its Pods. BGP is the protocol by which two routers exchange the networks they know how to reach.

This lesson enables the feature on Cilium 1.20.5, declares an FRR router outside the cluster as a peer, reads the sessions on both sides and proves the announcement with a wget run from the router. It also shows a session that does not come up because of a wrong AS number, that is, a network identifier that does not match on both sides. It is aimed at readers who already administer a Cilium cluster and must expose Services on a corporate network.

What you will learn

  • Explain why a LoadBalancer Service needs an address and an announcement to the network when there is no cloud provider.
  • Enable the BGP control plane with bgpControlPlane.enabled=true, then wait for the Cilium agents to restart.
  • Write the four cilium.io/v2 objects: CiliumBGPClusterConfig, CiliumBGPPeerConfig, CiliumBGPAdvertisement and CiliumLoadBalancerIPPool, and label the nodes that take part.
  • Read the sessions with show bgp summary on the router, cilium-dbg shell -- bgp/peers in the agent of one node and cilium bgp peers for all nodes at once.
  • Read the routes received by the router (Pod network first, then the Service address as a /32) and reach the Service from the router.
  • Diagnose a session stuck in active because of a wrong ASN, and say that CiliumBGPPeeringPolicy no longer exists.
  • Diagnose a Service left in <pending> from the condition in its status (a case covered in troubleshooting, not replayed in the demonstration).
  • Name the risks of BGP announcement and the protections to put in place.

Prerequisites

  • The lesson Install Cilium without kube-proxy and choose your IPAM, which installs the cluster used in this lesson: Cilium 1.20.5 deployed with Helm.
  • The lesson Services, to know what a LoadBalancer Service is.
  • ssh access to a node with sudo for helm, a kubectl that administers the cluster, and a workstation with Docker to run the demonstration router.
  • The demonstration environment: three VMs net-cp, net-w1 and net-w2 (addresses 10.10.50.14, 10.10.50.15 and 10.10.50.16) running Kubernetes 1.37.2, and an FRR 10.6.2 router in a container on the workstation, at 10.10.50.200.

The commands in the lesson are those of Cilium 1.20.5. The outputs were captured on 17 November 2026 with 1.20.4, except those of cilium-dbg shell -- bgp/peers and cilium bgp peers, captured on 18 November 2026 with 1.20.5. The lab, replayed on 1.20.5 the same day, gave the same results: three sessions established, Pod networks and Service address learned by the router, application reachable. Cilium does not declare Kubernetes 1.37 (1.20.5 declares 1.33 to 1.36): this combination is tested by this site, not announced by the vendor.

These values are those of the demonstration. On your side, replace them as follows:

In the lessonWhat you use on your side
10.10.50.200, AS 65000the address and AS number of your router
AS 65001 (localASN)a free AS number for the cluster, different from the router's
10.10.50.14, 10.10.50.15, 10.10.50.16the address of each node (kubectl get nodes -o wide, INTERNAL-IP column), to declare as neighbors of the router
172.30.0.0/28a block of addresses your network does not use elsewhere, and that your router can distribute
net-cp.lab, net-w1.lab, net-w2.labthe names of your nodes
virbr-k8s, 10.10.50.0/24, 10.10.50.1the interface, subnet and gateway of the node network, for the demonstration router only

Why announce a Service to the network?

A LoadBalancer Service asks for an external address. On a cloud, the provider creates it and routes it. On your own machines, nobody does: the Service stays in <pending> (the lesson Services shows this on kind). Two things are missing. The first is an address: Cilium draws it from a pool that you declare with a CiliumLoadBalancerIPPool. The second is a path: the network router must know that this address sits behind your nodes.

The BGP protocol (Border Gateway Protocol) serves this second purpose. Two routers open a TCP session, on port 179, and exchange the networks they know how to reach. Each side belongs to an autonomous system (AS), identified by a number called the ASN. When the two ASNs differ, the session is called eBGP, which is the case here: the cluster is AS 65001 and the router is AS 65000. These numbers are in the range reserved for private use, 64512 to 65534 (RFC 6996). For BGP on the cloud and enterprise side, the guide Hybrid connectivity: VPN, dedicated interconnects and BGP (in French) gives the context.

The diagram shows the result. Follow the three thick lines: each node opens its own session with the router and announces two things to it, the range of addresses of its Pods and the address of the Service. The dotted line is the path of a router client to the Service: with the default policy of the Service (externalTrafficPolicy: Cluster, detailed below), the router knows three nodes that announce the same address, and it can go through any of them.

Three Cilium cluster nodes (AS 65001), net-cp 10.10.50.14, net-w1 10.10.50.15 and net-w2 10.10.50.16, each open a BGP session with an FRR router (AS 65000, 10.10.50.200) outside the cluster. Each node announces the range of its Pods and the address 172.30.0.0/32 of the web Service. From the router, a wget to 172.30.0.0 can go through all three nodes.BGP sessionBGP sessionBGP sessionwget: three possible pathsnet-cp10.10.50.14announces its Podsand 172.30.0.0/32net-w110.10.50.15announces its Podsand 172.30.0.0/32net-w210.10.50.16announces its Podsand 172.30.0.0/32​     FRR router, AS 65000​     10.10.50.200, outside the clusterService webaddress 172.30.0.0Cilium cluster, AS 65001
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

For this result to exist, you need a BGP peer to declare, addresses to distribute, and a choice of the nodes and Services that take part. The following sections set them up in this order: the router, enabling the feature, the configuration objects.

How do you prepare a router outside the cluster?

To see an announcement arrive, you need a router that listens for it. The demonstration uses FRR, an open source routing suite, in a container. This choice is a demonstration device: on your side, the peer is your router or your firewall, and you have nothing to start. The container is attached to the node network by a Docker macvlan network, which gives it its own address on that network without touching the routes of the workstation. This setup assumes a Linux workstation on the same network as the nodes: it does not work with Docker Desktop. In that case, run FRR in a fourth VM on the node network.

On the workstation, first create a working folder with mkdir frr: the two following files, frr.conf and daemons, go in this frr/ folder, since the docker run command below mounts them from frr/daemons and frr/frr.conf.

The FRR configuration declares the AS of the router, its identifier, and the three nodes as neighbors of AS 65001. It fits in frr.conf:

frr defaults traditional
hostname routeur-frr
log stdout informational
!
router bgp 65000
bgp router-id 10.10.50.200
no bgp ebgp-requires-policy
neighbor CLUSTER peer-group
neighbor CLUSTER remote-as 65001
neighbor 10.10.50.14 peer-group CLUSTER
neighbor 10.10.50.15 peer-group CLUSTER
neighbor 10.10.50.16 peer-group CLUSTER
!
address-family ipv4 unicast
neighbor CLUSTER activate
exit-address-family
!

The peer-group CLUSTER avoids repeating the remote AS for each neighbor. The no bgp ebgp-requires-policy line is the one that matters for the demonstration: without it, FRR demands a filtering policy before exchanging routes with an eBGP neighbor, and the demonstration does not write one. In production, you write that policy instead of removing the requirement.

The FRR daemons file enables the two useful programs, bgpd (BGP) and zebra (which installs the routes):

bgpd=yes
zebra=yes
vtysh_enable=yes
zebra_options=" -A 127.0.0.1 -s 90000000"
bgpd_options=" -A 127.0.0.1"

You create the macvlan network, then start the container with the FRR image pinned by its digest and the two files mounted read-only. Both commands run on the workstation (adapt parent=virbr-k8s, the subnet and the gateway to your network):

Terminal window
docker network create -d macvlan --subnet=10.10.50.0/24 --gateway=10.10.50.1 -o parent=virbr-k8s ckne-frr
docker run -d --name ckne-frr --network ckne-frr --ip 10.10.50.200 --privileged \
-v "$PWD/frr/daemons:/etc/frr/daemons:ro" -v "$PWD/frr/frr.conf:/etc/frr/frr.conf:ro" \
quay.io/frrouting/frr:10.6.2@sha256:89e5e1ec8b17c5dffaf57dbac58a29ebeb3731a84e5bc09dad1662adff2ba7f5
406fcd29226109d37f345c3cef72b519e970d19ce96b661af30e35aad39bc862
Unable to find image 'quay.io/frrouting/frr:10.6.2@sha256:89e5e1ec8b17c5dffaf57dbac58a29ebeb3731a84e5bc09dad1662adff2ba7f5' locally
quay.io/frrouting/frr@sha256:89e5e1ec8b17c5dffaf57dbac58a29ebeb3731a84e5bc09dad1662adff2ba7f5: Pulling from frrouting/frr
…
Digest: sha256:89e5e1ec8b17c5dffaf57dbac58a29ebeb3731a84e5bc09dad1662adff2ba7f5
Status: Downloaded newer image for quay.io/frrouting/frr@sha256:89e5e1ec8b17c5dffaf57dbac58a29ebeb3731a84e5bc09dad1662adff2ba7f5
83539d549f5a870b2fad84bd11a826bbdc9186027c28914daa275e553ad6e257

The first line is the network identifier, the last one the container identifier. You query FRR through vtysh, its command shell. Here is its version:

Terminal window
docker exec ckne-frr vtysh -c 'show version' | head -3
% Can't open configuration file /etc/frr/vtysh.conf due to 'No such file or directory'.
Configuration file[/etc/frr/frr.conf] processing failure: 11
FRRouting 10.6.2_git (83539d549f5a) on Linux(6.8.0-149-generic).

The first two lines will come back in front of every vtysh output. The first says that the vtysh.conf file does not exist in the container: it is optional, and the demonstration does not provide one. The second goes with the first. These two lines have no consequence: the version is displayed, the commands answer and the sessions come up. The following outputs replace them with … to keep only the answer.

From net-cp, the router answers a ping, which proves that the node network reaches it:

Terminal window
ping -c 2 -W 2 10.10.50.200
PING 10.10.50.200 (10.10.50.200) 56(84) bytes of data.
64 bytes from 10.10.50.200: icmp_seq=1 ttl=64 time=0.111 ms
64 bytes from 10.10.50.200: icmp_seq=2 ttl=64 time=0.140 ms
--- 10.10.50.200 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1040ms
rtt min/avg/max/mdev = 0.111/0.125/0.140/0.014 ms

Before Cilium speaks BGP, the router waits for its three neighbors and sees none of them:

Terminal window
docker exec ckne-frr vtysh -c 'show bgp summary'
% Can't open configuration file /etc/frr/vtysh.conf due to 'No such file or directory'.
Configuration file[/etc/frr/frr.conf] processing failure: 11
IPv4 Unicast Summary:
BGP router identifier 10.10.50.200, local AS number 65000 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 3, using 50 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
10.10.50.14 4 65001 0 0 0 0 0 never Active 0 N/A
10.10.50.15 4 65001 0 0 0 0 0 never Active 0 N/A
10.10.50.16 4 65001 0 0 0 0 0 never Active 0 N/A
Total number of neighbors 3

Each line is a neighbor. The columns that matter are Up/Down and State/PfxRcd. Up/Down gives the time elapsed since the last state change of the session, whatever that state is: never means that no session has ever been established. State/PfxRcd shows the state as long as the session is not up (Active: the router is trying to connect), then, once the session is established, the number of routes received. Only a number in State/PfxRcd proves an established session, not the duration in Up/Down: the ASN failure, further down, shows 00:00:30 in Up/Down with Active in State/PfxRcd. The router is ready.

How do you enable the Cilium BGP control plane?

The BGP control plane is off by default. You enable it with Helm, keeping all the other settings (--reuse-values). This command runs on a cluster node:

Terminal window
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \
-n kube-system --version 1.20.5 --reuse-values --set bgpControlPlane.enabled=true
Release "cilium" has been upgraded. Happy Helming!
NAME: cilium
LAST DEPLOYED: Tue Nov 17 18:13:43 2026
NAMESPACE: kube-system
STATUS: deployed
REVISION: 9

This output is cut to its first six lines. Helm has updated the configuration, but the Cilium agents, one per node and carried by the cilium DaemonSet, are not yet replaced. You must wait for the end of the rollout, that is, for the Pods of the old version to be replaced by those of the new one. The Cilium documentation only asks for this restart of the agents. The demonstration also restarts the operator, the Cilium component that works at the scale of the cluster, but the documentation does not ask for it.

Terminal window
kubectl -n kube-system rollout status ds/cilium --timeout=300s
kubectl -n kube-system rollout restart deploy/cilium-operator
kubectl -n kube-system rollout status deploy/cilium-operator --timeout=180s
Waiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...
Waiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...
Waiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...
Waiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...
Waiting for daemon set "cilium" rollout to finish: 2 of 3 updated pods are available...
daemon set "cilium" successfully rolled out
deployment.apps/cilium-operator restarted
Waiting for deployment spec update to be observed...
Waiting for deployment "cilium-operator" rollout to finish: 1 out of 2 new replicas have been updated...
Waiting for deployment "cilium-operator" rollout to finish: 1 out of 2 new replicas have been updated...
Waiting for deployment "cilium-operator" rollout to finish: 1 out of 2 new replicas have been updated...
Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...
Waiting for deployment "cilium-operator" rollout to finish: 1 of 2 updated replicas are available...
Waiting for deployment "cilium-operator" rollout to finish: 1 of 2 updated replicas are available...
deployment "cilium-operator" successfully rolled out

The two successfully rolled out sentences say that the agents, then the operator, are replaced. You then check that the BGP resource definitions exist:

Terminal window
kubectl get crd | grep -i bgp
ciliumbgpadvertisements.cilium.io Cluster v2(storage),v2alpha1 2026-11-17T18:13:49Z
ciliumbgpclusterconfigs.cilium.io Cluster v2(storage),v2alpha1 2026-11-17T18:13:48Z
ciliumbgpnodeconfigoverrides.cilium.io Cluster v2(storage),v2alpha1 2026-11-17T18:13:52Z
ciliumbgpnodeconfigs.cilium.io Cluster v2(storage),v2alpha1 2026-11-17T18:13:51Z
ciliumbgppeerconfigs.cilium.io Cluster v2(storage),v2alpha1 2026-11-17T18:13:50Z

Five definitions exist, all in version v2 for storage and without a namespace (Cluster). None is called ciliumbgppeeringpolicies: that old object no longer exists, see below.

Which objects do you declare, and how do you choose the nodes?

The BGP control plane is driven by four cilium.io/v2 objects, each answering one question. CiliumBGPClusterConfig says which nodes speak BGP, with which local ASN and toward which peers. CiliumBGPPeerConfig says how to talk to a peer, and links the peer to the announcements. CiliumBGPAdvertisement says what to announce. CiliumLoadBalancerIPPool says which addresses to give to the Services. Here are those of the demonstration, in a single file:

apiVersion: cilium.io/v2
kind: CiliumBGPClusterConfig
metadata:
name: vers-routeur-frr
spec:
nodeSelector:
matchLabels:
bgp: actif
bgpInstances:
- name: instance-65001
localASN: 65001
peers:
- name: routeur-frr
peerASN: 65000
peerAddress: 10.10.50.200
peerConfigRef:
name: pair-frr
---
apiVersion: cilium.io/v2
kind: CiliumBGPPeerConfig
metadata:
name: pair-frr
spec:
families:
- afi: ipv4
safi: unicast
advertisements:
matchLabels:
annonce: frr
---
apiVersion: cilium.io/v2
kind: CiliumBGPAdvertisement
metadata:
name: annonces-frr
labels:
annonce: frr
spec:
advertisements:
- advertisementType: PodCIDR
- advertisementType: Service
service:
addresses:
- LoadBalancerIP
selector:
matchLabels:
annonce-bgp: oui
---
apiVersion: cilium.io/v2
kind: CiliumLoadBalancerIPPool
metadata:
name: pool-bgp
spec:
blocks:
- cidr: 172.30.0.0/28

The objects hold together through labels that you must copy exactly: a mistyped label cuts the link between two objects. The diagram follows the references from one object to the next: a solid line refers by name, a dotted line refers by label. The dotted line that leaves the pool is not a reference: the pool names no Service, and a LoadBalancer Service without an address draws one from the pool that covers it. The nodeSelector of the CiliumBGPClusterConfig selects the nodes that carry the label bgp: actif. Its peerConfigRef refers to the CiliumBGPPeerConfig named pair-frr. The latter selects the announcements whose label is annonce: frr, the one carried by the CiliumBGPAdvertisement. Finally the announcement selects the Services whose label is annonce-bgp: oui.

The Cilium BGP configuration objects and their references. The CiliumBGPClusterConfig selects the nodes labeled bgp: actif through its nodeSelector and refers by name to the CiliumBGPPeerConfig pair-frr. The latter selects by label (annonce: frr) the CiliumBGPAdvertisement annonces-frr, which in turn selects by label (annonce-bgp: oui) the web Service. The CiliumLoadBalancerIPPool pool-bgp gives an address to the Service without going through these references.Nodeslabel bgp: actifCiliumBGPClusterConfigvers-routeur-frr nodeSelector: bgp: actif CiliumBGPPeerConfigpair-frr peerConfigRef: pair-frr CiliumBGPAdvertisementannonces-frrlabel annonce: frr advertisements: annonce: frr Service weblabel annonce-bgp: oui selector: annonce-bgp: oui CiliumLoadBalancerIPPoolpool-bgp, 172.30.0.0/28 address drawn from the pool, no reference 
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

The CiliumBGPAdvertisement announces two things. PodCIDR announces the range of Pod addresses of each node. Service announces the LoadBalancerIP address of the Services that the selector selects, here those that carry the label annonce-bgp: oui. The pool, for its part, gives its addresses to all the LoadBalancer Services it covers, announced or not (a serviceSelector on the pool can limit the ones it covers). Announcing is therefore a separate choice, made by the label of the Service.

You apply the file (here bgp.yaml), then label the three nodes, which activates them:

Terminal window
kubectl apply -f bgp.yaml
kubectl label node net-cp.lab net-w1.lab net-w2.lab bgp=actif --overwrite
ciliumbgpclusterconfig.cilium.io/vers-routeur-frr created
ciliumbgppeerconfig.cilium.io/pair-frr created
ciliumbgpadvertisement.cilium.io/annonces-frr created
ciliumloadbalancerippool.cilium.io/pool-bgp created
node/net-cp.lab labeled
node/net-w1.lab labeled
node/net-w2.lab labeled

The four objects are created. The label on the nodes is the trigger: as long as a node does not carry it, it opens no session. To make only some nodes speak BGP, for example those of one rack, you label only those.

How do you check that the sessions are established?

A session is checked on both sides, because each side may see something different. On the router, show bgp summary shows the state of each neighbor:

Terminal window
docker exec ckne-frr vtysh -c 'show bgp summary'
…
IPv4 Unicast Summary:
BGP router identifier 10.10.50.200, local AS number 65000 VRF default vrf-id 0
BGP table version 3
RIB entries 5, using 760 bytes of memory
Peers 3, using 50 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
10.10.50.14 4 65001 3 6 3 0 0 00:00:12 1 3 N/A
10.10.50.15 4 65001 3 6 3 0 0 00:00:12 1 3 N/A
10.10.50.16 4 65001 3 6 3 0 0 00:00:12 1 3 N/A
Total number of neighbors 3

In State/PfxRcd, the three neighbors show 1 instead of a state: the session is established, and the router has received one route from each node. Up/Down (00:00:12) only says since when. PfxSnt is 3: the router sends three to each.

On the cluster side, two commands give the state of the sessions, and they do not show the same scope. The first runs in the Cilium agent of a node and describes only the sessions of that node:

Terminal window
kubectl -n kube-system exec ds/cilium -c cilium-agent -- cilium-dbg shell -- bgp/peers
Instance Peer Session State Uptime Family Received Accepted Advertised
instance-65001 routeur-frr established 19s ipv4-unicast 4 0 2

This output was captured with Cilium 1.20.5 in the lab of this lesson, once the Service was announced: the node announces two routes (the range of its Pods and the address of the Service) and receives the four that its router sends it. The values of Received and Advertised therefore depend on what the router sends and on what is already announced, not only on the session.

The Session State column is established: the session is up, as the router says on its side. Accepted is 0 because the cluster announces its routes and imports nothing from the router. The form without -- (cilium-dbg shell bgp/peers) gives the same table. With a space instead of the slash, cilium-dbg shell -- bgp peers fails with unknown command: write bgp/peers exactly.

The second command comes from the cilium CLI (v0.20.3), run from the workstation that drives the cluster. It queries all the nodes and lists them at once:

Terminal window
cilium bgp peers
Node Local AS Peer AS Peer Address Session State Uptime Family Received Advertised
net-cp.lab 65001 65000 10.10.50.200 established 28s ipv4/unicast 4 2
net-w1.lab 65001 65000 10.10.50.200 established 28s ipv4/unicast 4 2
net-w2.lab 65001 65000 10.10.50.200 established 28s ipv4/unicast 4 2

This output was captured in the same lab. Three lines, one per node, with the same established session to 10.10.50.200: this is the table to look at to check that each node has brought up its session, where the agent command shows only one.

The old cilium-dbg bgp peers command still works in Cilium 1.20, but it is deprecated: cilium-dbg bgp --help describes it as Access to BGP control plane (deprecated), and every call starts with the warning Command "peers" is deprecated, Use the subcommand: "shell bgp/peers". Here is its output captured with the deprecated form on 1.20.4, before any Service was announced:

Command "peers" is deprecated, Use the subcommand: "shell bgp/peers"
Local AS Peer AS Peer Address Session Uptime Family Received Advertised
65001 65000 10.10.50.200:179 established 13s ipv4/unicast 3 1

It says the same thing as the router: the session with 10.10.50.200:179 is established, for 13 seconds. Advertised is 1, like the PfxRcd of 1 on the router side: the node announces a single route, the range of its Pods, since no Service is announced yet.

Cilium also creates one object per node that carries the label, the CiliumBGPNodeConfig. It is a simple check: there are as many as active nodes.

Terminal window
kubectl get ciliumbgpnodeconfigs -o wide
NAME AGE
net-cp.lab 14s
net-w1.lab 14s
net-w2.lab 14s

How do you read the routes the router received?

Once the session is established, the router has received the Pod range of each node. show bgp ipv4 unicast displays the BGP table, that is, everything the router has learned, before it chooses what to install:

Terminal window
docker exec ckne-frr vtysh -c 'show bgp ipv4 unicast'
…
BGP table version is 3, local router ID is 10.10.50.200, vrf id 0
Default local pref 100, local AS 65000
Status codes: s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.244.0.0/24 10.10.50.16 0 65001 i
*> 10.244.1.0/24 10.10.50.15 0 65001 i
*> 10.244.2.0/24 10.10.50.14 0 65001 i
Displayed 3 routes and 3 total paths

Each line is a route. Network is the announced range, Next Hop the node that knows how to reach it, and Path the AS path: 65001 alone means that the route comes directly from the cluster. The *> codes at the start are read with the legend: * valid route, > best route. Each Pod range has a single node behind it here.

You confirm these ranges against what Cilium knows about each node:

Terminal window
kubectl get ciliumnodes -o custom-columns=NOEUD:.metadata.name,PODCIDR:.spec.ipam.podCIDRs
NOEUD PODCIDR
net-cp.lab [10.244.2.0/24]
net-w1.lab [10.244.1.0/24]
net-w2.lab [10.244.0.0/24]

net-cp holds 10.244.2.0/24 and the router reaches it through 10.10.50.14, the address of net-cp: the two lists agree. The Pod range of a node depends on the order in which the nodes joined the cluster: compare with your own kubectl get ciliumnodes, your ranges will probably be assigned differently. The router's routing table, for its part, contains only the routes that FRR has kept and installed:

Terminal window
docker exec ckne-frr vtysh -c 'show ip route bgp'
…
Codes: K - kernel route, C - connected, L - local, S - static,
R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric, t - Table-Direct,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
IPv4 unicast VRF default:
B>* 10.244.0.0/24 [20/0] via 10.10.50.16, eth0, weight 1, 00:00:13
B>* 10.244.1.0/24 [20/0] via 10.10.50.15, eth0, weight 1, 00:00:13
B>* 10.244.2.0/24 [20/0] via 10.10.50.14, eth0, weight 1, 00:00:13

The B marks a route learned by BGP, the > the selected route and the * the one that is installed in the system routing table. The 20 in square brackets is the administrative distance of an eBGP route, the priority the router gives to this type of route: the lower it is, the more the route is preferred. The router therefore knows how to reach the cluster Pods through their nodes.

How do you announce the address of a LoadBalancer Service?

The Service remains. You create an application, expose it as a LoadBalancer, and add the label that the CiliumBGPAdvertisement expects. Without this label, the Service would receive an address from the pool, but the selector of the announcement would not select it.

Terminal window
kubectl create namespace bgp-demo
kubectl -n bgp-demo create deployment web --image=nginx:1.27@sha256:6784fb0834aa7dbbe12e3d7471e69c290df3e6ba810dc38b34ae33d3c1c05f7d
kubectl -n bgp-demo expose deployment web --port=80 --type=LoadBalancer
kubectl -n bgp-demo label service web annonce-bgp=oui
kubectl -n bgp-demo rollout status deployment/web --timeout=120s
namespace/bgp-demo created
deployment.apps/web created
service/web exposed
service/web labeled
Waiting for deployment "web" rollout to finish: 0 of 1 updated replicas are available...
deployment "web" successfully rolled out

The Service now has an external address, drawn from the pool:

Terminal window
kubectl -n bgp-demo get service web
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
web LoadBalancer 10.103.118.220 172.30.0.0 80:31317/TCP 26s

The EXTERNAL-IP column no longer says <pending>: it is 172.30.0.0. This is the first address of the block 172.30.0.0/28, the one usually called the network address. Cilium assigned it without difficulty in the demonstration, and wget got an answer from it. The pool's spec.allowFirstLastIPs field decides this: absent or set to Yes, the first and last addresses of a cidr block can be assigned, hence 172.30.0.0 here. Set to No, Cilium reserves them, and the field is ignored for a /31 or /32 block. If a device on your network refuses the network address of a block, set allowFirstLastIPs: "No" in the pool. This setting comes from the Cilium 1.20.4 LB IPAM documentation and was not replayed.

On the router side, the BGP table now contains the Service address:

Terminal window
docker exec ckne-frr vtysh -c 'show bgp ipv4 unicast'
…
BGP table version is 6, local router ID is 10.10.50.200, vrf id 0
Default local pref 100, local AS 65000
Status codes: s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.244.0.0/24 10.10.50.16 0 65001 i
*> 10.244.1.0/24 10.10.50.15 0 65001 i
*> 10.244.2.0/24 10.10.50.14 0 65001 i
*> 172.30.0.0/32 10.10.50.15 0 65001 i
*= 10.10.50.14 0 65001 i
*= 10.10.50.16 0 65001 i
Displayed 4 routes and 6 total paths

Two things to read. The Service is announced as a /32: a route that designates a single address, instead of the /28 block of the pool. And it arrives from all three nodes: Displayed 4 routes and 6 total paths counts four routes and six paths, the three Pod ranges with one path each, and 172.30.0.0/32 with three paths. The *> marks the best path, through 10.10.50.15, and the two *= equivalent paths, which the router can use in parallel. The routing table confirms this use:

Terminal window
docker exec ckne-frr vtysh -c 'show ip route 172.30.0.0'
…
Routing entry for 172.30.0.0/32
Known via "bgp", distance 20, metric 0, best
Last update 00:00:25 ago
Flags: Selected
Status: Installed
* 10.10.50.14, via eth0, weight 1
* 10.10.50.15, via eth0, weight 1
* 10.10.50.16, via eth0, weight 1

The route is Installed with the three nodes as paths. The proof that matters to the user remains: reaching the Service. From the router, which is outside the cluster, you request the application page through the announced address:

Terminal window
docker exec ckne-frr sh -c 'wget -qO- -T 5 http://172.30.0.0/ | grep -o "<title>.*</title>"'
<title>Welcome to nginx!</title>

The title of the nginx home page comes back: a client outside the cluster reaches the Service through the address that BGP announced, without going through the NodePort and without a cloud provider.

The demonstration uses the default policy of a Service, externalTrafficPolicy: Cluster, and that is what explains the three paths: the address is announced from all the nodes that the CiliumBGPClusterConfig selects. With externalTrafficPolicy: Local, according to the Cilium 1.20 documentation, the address is announced only from the nodes that carry a Pod of the Service, and the announcement stops when there are none left. This second policy was not measured in the demonstration.

What happens when the ASN is wrong?

A classic failure is an AS number that does not match on both sides. You provoke it by changing the peerASN of the configuration object to 65099, while the router is AS 65000:

Terminal window
kubectl patch ciliumbgpclusterconfig vers-routeur-frr --type=json \
-p='[{"op":"replace","path":"/spec/bgpInstances/0/peers/0/peerASN","value":65099}]'
kubectl -n kube-system exec ds/cilium -c cilium-agent -- cilium-dbg bgp peers
ciliumbgpclusterconfig.cilium.io/vers-routeur-frr patched
Command "peers" is deprecated, Use the subcommand: "shell bgp/peers"
Local AS Peer AS Peer Address Session Uptime Family Received Advertised
65001 65099 10.10.50.200:179 active 0s ipv4/unicast 0 0

This output was captured with the deprecated form cilium-dbg bgp peers on 1.20.4; the current command, cilium-dbg shell -- bgp/peers, reads the same state. The node shows Peer AS 65099 and an active session: it is not established, the node is trying to connect. Received and Advertised have dropped to 0. The router sees the same thing:

Terminal window
docker exec ckne-frr vtysh -c 'show bgp summary'
…
IPv4 Unicast Summary:
BGP router identifier 10.10.50.200, local AS number 65000 VRF default vrf-id 0
BGP table version 10
RIB entries 0, using 0 bytes of memory
Peers 3, using 50 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
10.10.50.14 4 65001 7 8 0 0 0 00:00:30 Active 0 N/A
10.10.50.15 4 65001 7 8 0 0 0 00:00:30 Active 0 N/A
10.10.50.16 4 65001 7 8 0 0 0 00:00:30 Active 0 N/A
Total number of neighbors 3

The three neighbors are Active and RIB entries is 0: the router has lost all the cluster routes, including that of the Service. Nothing in this table indicates the cause.

The FRR container log does not help either in the demonstration: searching for the words notification, bad peer as or open message finds no line in it. The reason is the frr defaults traditional profile in the frr.conf file, which does not log neighbor state changes; bgp log-neighbor-changes is on by default only with the datacenter profile. FRR does keep the reason for the last disconnection, though: look at show bgp neighbors 10.10.50.14, the "Last reset" lines and the notification received (this output was not captured in the demonstration). To have these changes written to the log, add bgp log-neighbor-changes under router bgp 65000 in frr.conf.

The cause is read on the Cilium side, in the log of the agent of one node (kubectl -n kube-system logs <pod cilium> -c cilium-agent). Here are the three messages of one agent, in order:

time=2026-11-17T18:15:01.916875721Z level=info msg="sent notification" module=agent.controlplane.bgp-control-plane instance=instance-65001 component=gobgp-server asn=65001 Topic=Peer Key=10.10.50.200 State=BGP_FSM_ESTABLISHED Code=6 Subcode=3 Data=""
time=2026-11-17T18:15:03.760446368Z level=info msg="sent notification" module=agent.controlplane.bgp-control-plane instance=instance-65001 component=gobgp-server asn=65001 Topic=Peer Key=10.10.50.200 State=BGP_FSM_ACTIVE Code=2 Subcode=2 Data=""
time=2026-11-17T18:15:05.690341603Z level=info msg="sent notification" module=agent.controlplane.bgp-control-plane instance=instance-65001 component=gobgp-server asn=65001 Topic=Peer Key=10.10.50.200 State=BGP_FSM_ACTIVE Code=2 Subcode=2 Data=""

The first message, Code=6 Subcode=3, is sent the instant the established session is cut because the peer configuration has changed: it is the "Cease" code, "Peer De-configured" subcode (RFC 4486).

The following messages, Code=2 Subcode=2, repeat about every two seconds. The node tries to reopen the session, the router answers with an AS different from the configured one, and the node refuses. In the BGP error codes, code 2 is an error in the session open message, and its subcode 2 signals an unexpected peer AS. A repeating Code=2 Subcode=2 pair is the signature of a wrong ASN.

You put the right value back, and the sessions come back up on their own:

Terminal window
kubectl patch ciliumbgpclusterconfig vers-routeur-frr --type=json \
-p='[{"op":"replace","path":"/spec/bgpInstances/0/peers/0/peerASN","value":65000}]'
docker exec ckne-frr vtysh -c 'show bgp summary'
ciliumbgpclusterconfig.cilium.io/vers-routeur-frr patched
…
IPv4 Unicast Summary:
BGP router identifier 10.10.50.200, local AS number 65000 VRF default vrf-id 0
BGP table version 15
RIB entries 7, using 1064 bytes of memory
Peers 3, using 50 KiB of memory
Peer groups 1, using 64 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
10.10.50.14 4 65001 10 14 15 0 0 00:00:29 2 4 N/A
10.10.50.15 4 65001 10 14 15 0 0 00:00:29 2 4 N/A
10.10.50.16 4 65001 10 14 15 0 0 00:00:29 2 4 N/A
Total number of neighbors 3

The session came back without touching the router. Each neighbor now sends 2 routes (the Pod range and the Service address): PfxRcd went from 1 to 2 since the initial state, because the Service is announced.

What happened to CiliumBGPPeeringPolicy?

Guides and online answers written before Cilium 1.19 declare BGP with a CiliumBGPPeeringPolicy object. This object has been removed since Cilium 1.19: the 1.19 release notes say that this resource definition and its control plane were removed. It is not merely deprecated. The list of resource definitions seen above does not contain it either. In 1.20.5, you use the four objects of this lesson, and a manifest copied from an old guide fails.

What risks does BGP announcement open?

Announcing addresses to a corporate router gives the cluster a power, and you must decide who can exercise it. Anyone who can label a Service with annonce-bgp: oui publishes that Service on the network: this label is a right to protect with RBAC, and the pool is limited by its serviceSelector to the Services it is allowed to serve.

The PodCIDR announcement makes the Pods directly reachable from the router. The demonstration announces it to show the node routes; to expose only Services, you can do without it by removing PodCIDR from the CiliumBGPAdvertisement.

On the router side, filter what it accepts from the cluster: a prefix-list limited to the pool block and the Pod range prevents an unexpected announcement from being installed. neighbor maximum-prefix also exists, but it cuts the session when the limit is exceeded, and the FRR documentation considers a prefix-list generally preferable.

Finally, authenticate the session. The authSecretRef field of the CiliumBGPPeerConfig designates a Secret that carries a password key, in the namespace of the BGP secrets: kube-system by default with the chart, adjustable with bgpControlPlane.secretNamespace.name. The demonstration did not replay it. The --privileged flag of the FRR container is also a demonstration shortcut, not to be reproduced on a real router.

Troubleshooting

Start by comparing the two sides: show bgp summary on the router and cilium-dbg shell -- bgp/peers in the agent of one node (or cilium bgp peers for all nodes). An Active or active state on both sides is a session problem. An established session that does not bring the expected route is an announcement problem. The table rows on nodes without a label, on resource definitions absent or present, on the Service in <pending> and on the missing /32 route describe cases that the demonstration did not replay.

SymptomLikely causeFix
The router shows Active and the node active, and Peer AS shows the wrong ASN on the node sideThe ASN declared in peerASN does not match the AS of the routerRead the agent log: Code=2 Subcode=2 in a loop. Fix peerASN in the CiliumBGPClusterConfig
The FRR log is empty for a session that does not come upThe frr defaults traditional profile does not log neighbor state changesLook for the cause on the Cilium side (sent notification in the agent log), or read show bgp neighbors <ip> on the router. Adding bgp log-neighbor-changes to frr.conf makes these changes appear in the log
All sessions stay in the waiting state, no node has a CiliumBGPNodeConfig objectThe nodes do not carry the label of the nodeSelectorkubectl get nodes --show-labels, then kubectl label node <node> bgp=actif
kubectl get crd | grep -i bgp returns nothingbgpControlPlane.enabled=true is not enabled, or the agents have not finished restartingRedo the helm upgrade, then wait for the end of the rollout with kubectl -n kube-system rollout status ds/cilium
The BGP definitions are present, but no session comes upPresent definitions do not prove that BGP is active: disabling bgpControlPlane.enabled through Helm does not remove themRead the enable-bgp-control-plane key of the cilium-config ConfigMap: it is true when the BGP control plane is enabled. Otherwise, redo the helm upgrade
The Service stays in <pending>No enabled CiliumLoadBalancerIPPool matches the Service. LB IPAM writes it in the conditions of the Service: io.cilium/lb-ipam-request-satisfied, reason no_pool ("There are no enabled CiliumLoadBalancerIPPools that match this service")kubectl get svc <name> -o jsonpath='{.status.conditions}' to read the condition, then kubectl get ciliumloadbalancerippools: a pool must exist, be enabled, cover the Service and have free addresses
The Service has an address but the router does not have the /32 routeThe Service does not carry the label of the announcement selector, or the label of the announcement does not match the one in the CiliumBGPPeerConfigkubectl get service --show-labels, then compare with the selector of the announcement and the advertisements.matchLabels of the peer
Every vtysh command prints Can't open configuration file /etc/frr/vtysh.confThe optional vtysh.conf file does not exist in the containerNone. The message is harmless in the demonstration
cilium-dbg bgp peers prints Command "peers" is deprecatedThe command is deprecated in favor of shell bgp/peersThe command still answers. Use cilium-dbg shell -- bgp/peers in your scripts

Put it into practice

The lab starts from a three-node Cilium cluster without kube-proxy and an FRR router placed outside the cluster (AS 65000, the cluster being AS 65001). You must enable the BGP control plane, peer the three nodes with the router, announce the Pod networks and the LoadBalancer address of the web Service, then reach this Service from the router's network. The validation reads the cluster (BGP control plane enabled, a pool address on the Service) and above all the router: three established sessions, the Pod networks learned, a /32 route for the Service in the 172.30.0.0/28 block, and an HTTP request that succeeds through this route.

Outside the lab, redo the walkthrough on a three-node Cilium cluster, with an FRR router of your own (a VM or a container) as the BGP peer. You have succeeded when these four checks hold:

  1. kubectl get crd | grep -i bgp lists the five definitions, and show bgp summary shows your three neighbors with a number of received routes in place of a state.
  2. show bgp ipv4 unicast contains the three Pod ranges, each behind the right node.
  3. A LoadBalancer Service labeled annonce-bgp: oui gets an address from the pool, and the router has a /32 route to it.
  4. A wget run from the router to this address returns the application page.

To go further than the replay, try this variant: create a second LoadBalancer Service without the annonce-bgp label, and prove that it gets an address from the pool but that no /32 route for this address appears in show bgp ipv4 unicast on the router. You will have shown that the pool gives the address and that the label decides the announcement. This variant was not replayed in the demonstration.

To clean up, delete the test namespace, the four objects and the label on the nodes, then stop the router. These commands were not replayed. The bgpControlPlane.enabled setting stays active in Cilium: this cleanup does not disable it. Disabling it through Helm would not remove the five BGP resource definitions either, because the operator creates them on activation and does not remove them (a finding of the lab, after a Helm rollback). kubectl get crd | grep -i bgp therefore still lists them after the cleanup.

Terminal window
kubectl delete namespace bgp-demo
kubectl delete ciliumbgpclusterconfig vers-routeur-frr
kubectl delete ciliumbgppeerconfig pair-frr
kubectl delete ciliumbgpadvertisement annonces-frr
kubectl delete ciliumloadbalancerippool pool-bgp
kubectl label node net-cp.lab net-w1.lab net-w2.lab bgp-
docker rm -f ckne-frr
docker network rm ckne-frr

To check that nothing remains, the following command must answer No resources found (expected answer, not replayed). It checks the objects, not the resource definitions, which remain:

Terminal window
kubectl get ciliumbgpclusterconfigs,ciliumbgppeerconfigs,ciliumbgpadvertisements,ciliumloadbalancerippools,ciliumbgpnodeconfigs

Key points

  • Outside a cloud, a LoadBalancer Service needs two things: an address and an announcement to the network by BGP. The address comes from a CiliumLoadBalancerIPPool, which gives it to all the Services it covers; it is the label of the Service that decides whether it is announced.
  • The Cilium BGP control plane is enabled with bgpControlPlane.enabled=true, then you wait for the end of the rollout of the Cilium agents. Present BGP resource definitions do not prove that it is active, because Helm does not remove them on deactivation: the enable-bgp-control-plane key of cilium-config tells.
  • Four cilium.io/v2 objects carry the configuration: CiliumBGPClusterConfig (nodes, local ASN, peers), CiliumBGPPeerConfig (the peer and its announcements), CiliumBGPAdvertisement (what to announce) and CiliumLoadBalancerIPPool (the addresses). Nodes speak BGP only if they carry the label of the nodeSelector, and the objects link through labels that you must copy exactly.
  • A session is checked on both sides: show bgp summary on the router, cilium-dbg shell -- bgp/peers in the agent of one node, which sees only its own sessions (the cilium-dbg bgp peers form is deprecated), or cilium bgp peers for all nodes at once. Only the number in State/PfxRcd proves an established session, not the duration in Up/Down.
  • The Service is announced as a /32, from each node with the default externalTrafficPolicy: Cluster policy (with Local, only from the nodes that carry a Pod of the Service); the proof is a wget run from the router to the announced address.
  • A wrong ASN leaves the session in active, and the Cilium agent log shows Code=2 Subcode=2 in a loop; the FRR log is empty with the traditional profile, but show bgp neighbors keeps the reason for the last disconnection.
  • The announcement label is a right to protect, and the announcement is filtered on the router side and authenticated with authSecretRef.
  • CiliumBGPPeeringPolicy has been removed since Cilium 1.19: a manifest from an old guide no longer applies.

Knowledge check

Eight questions drawn from eleven: the need for an announcement, enabling, the objects, reading the sessions, the routes, the /32 route of the Service, the wrong ASN, the FRR log, the announcement label, externalTrafficPolicy and the removed object.

Knowledge check

Check what you have learned with this interactive quiz

8 questions
8 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer