CNT · Series · Routing for the modern cloud · Part 2 of 3

Why learn BGP on a router before you use it in Cilium

Cilium doesn't invent a new BGP: it inherits the classic one. If you learn it on a router first, the YAML reads itself and troubleshooting stops being blind.

Engineer with headphones focused on his laptop
Unsplash · Wes Hicks

BGP is more than "the protocol of the internet." It's the route control language that today connects data centers, cloud providers and, now, Kubernetes clusters. Cilium brings it to the world of containers, and with it comes a temptation: skip the fundamentals and copy a YAML file.

In this second part, I explain why it pays to go the other way around: learn BGP on a traditional router, like a Cisco one, and then take that knowledge to Cilium.

What does Cilium inherit from classic BGP?

Everything that matters. Cilium doesn't invent a new BGP: it implements the same protocol, with the same rules, on top of GoBGP. The neighbor relationship forms with the same states, it exchanges the same messages and path selection uses the same attributes: AS_PATH, LOCAL_PREF, ORIGIN or MED, and on Cisco also WEIGHT.

The only thing that changes is how you configure it. On a router, you type commands; in Cilium, you declare Kubernetes resources. If you know what each piece means, the YAML reads itself.

Rack of network equipment with lit cabling in a data center
The control plane is the same, whether it lives on a router or on a Kubernetes node. Photo: Tyler on Unsplash.

What do you gain by learning traditional BGP first?

You understand the why, not just the how

From setting up the TCP session to the states and message types, through the attributes and filtering policies, everything has a reason. Once you know it, each field in a Cilium resource stops being a magic value.

You master the control plane

On a router, you learn how BGP chooses the best route and why. In Cilium, you just apply that judgment to Kubernetes networking: which ranges to advertise, to which neighbors and with what policy.

You troubleshoot less blindly

If something fails in Cilium BGP, knowing BGP lets you read the state of the sessions, the advertised prefixes and the applied policies. Without that foundation, all you can do is delete the YAML and apply it again.

You see the full hybrid network

The local network, the cloud, Kubernetes and Cilium use the same BGP in different environments. If you understand it in one place, you understand it everywhere.

What does the same BGP look like in both worlds?

Picture a cluster whose nodes (AS 65000) speak BGP with the network router (AS 65100). On the router side, it's an eBGP neighbor relationship like any other:

R-TOR(config)# router bgp 65100
R-TOR(config-router)# neighbor 172.18.0.11 remote-as 65000
R-TOR(config-router)# neighbor 172.18.0.11 description k8s-worker-1
R-TOR(config-router)# address-family ipv4 unicast
R-TOR(config-router-af)# neighbor 172.18.0.11 activate

On the Cilium side, you declare the same neighbor relationship with a Kubernetes resource:

apiVersion: cilium.io/v2
kind: CiliumBGPClusterConfig
metadata:
  name: thor-bgp
spec:
  nodeSelector:
    matchLabels:
      bgp: enabled
  bgpInstances:
    - name: as65000
      localASN: 65000
      peers:
        - name: router-tor
          peerASN: 65100
          peerAddress: 172.18.0.250
          peerConfigRef:
            name: thor-peer

Notice that the concepts are identical: local AS, remote AS and neighbor address. The timers, the address families and what to advertise (pod ranges or service IPs) are defined in two other resources, CiliumBGPPeerConfig and CiliumBGPAdvertisement. You'll find them step by step in the Cilium chapter on cluster access.

To verify it, on the router you use show ip bgp summary; in the cluster, cilium bgp peers and cilium bgp routes. Two different commands to read exactly the same information.

What's the recommended path?

  1. BGP fundamentals: iBGP and eBGP, neighbor relationships, route selection and attributes.
  2. BGP in real networks (Cisco): policies, route-maps and filtering; integration with MPLS, VRF and the data center.
  3. BGP in the cloud: hybrid connectivity and route exchange with the providers' VPCs and VNets.
  4. Cilium and BGP: the BGP Control Plane, advertising services and pod ranges, and clean integration between Kubernetes and the physical network.

When you understand BGP from the root, Cilium stops looking like magic and becomes engineering.

Two people working on laptops at a long office table
First the router, then the cluster: the order speeds up learning. Photo: Croissant on Unsplash.

Key takeaways

  • Cilium implements the same classic BGP: same states, messages and attributes.
  • Learning it first on a router gives you the why and control of the routing plane.
  • A neighbor relationship is the same in IOS and in YAML: local AS, remote AS and neighbor address.
  • The path: fundamentals, real networks, the cloud and, last, Cilium.

In the last part: what CCNA OSPF has to do with the modern cloud.

Want to master BGP before you get to Cilium?

At The House of Routing, we go with you from the fundamentals to advanced scenarios, with more practice than isolated theory, packet analysis with Wireshark and guidance from an instructor with more than 20 years of experience in Cisco networks. And when you get to Kubernetes, the full summary of the Cilium book is waiting for you on the Modern cloud path.

Read the Cilium chapter on BGP

Sources

Photos from Unsplash, with each author's name in the caption. Text adapted from Jesús Espinoza's LinkedIn posts, expanded with AI assistance and reviewed by him.

↑ Start of the article