SONiC BGP basics: your first BGP session, and how SONiC hands it to FRR

The first lesson of the fabric level of the SONiC course: one BGP session between a leaf and a spine, what the switch command line writes into CONFIG_DB and FRR, one learned route followed to the forwarding plane, on Enterprise SONiC and on community SONiC.
Hand-drawn whiteboard: BGP on SONiC, a leaf in AS 65001 and a spine in AS 65000 joined by one session

On this page

At the end of the first level a static route kept sending traffic to a neighbor that had gone, because a static route has no way of asking. A routing protocol fixes exactly that. Two routers hold a conversation; each tells the other what it can reach, and when the conversation stops, everything learned through it is withdrawn. This post is one such conversation: a single BGP session between a leaf and a spine on SONiC. It is typed in the switch command line and then followed twice: down into the routing software, to see what SONiC wrote, and one learned route all the way to the forwarding plane. The switches run Enterprise SONiC 4.6.0; the same session follows on community SONiC, where it is typed in FRR's own shell.

This is the written deep dive for the first lesson of the fabric level of the SONiC course on the LevelUP I.T. YouTube channel. It runs on the lab built in lesson 1, from the blank lab. Every output below is from the lab as the lesson recorded it.

What you'll find here

  • BGP in one page: configured neighbors, autonomous systems, the AS path, keepalives.
  • Who does the routing on a SONiC switch: FRR's processes in the bgp container.
  • The session, line by line, and how to read the summary, the neighbor detail and BGP's table.
  • What the command line wrote: the BGP tables in CONFIG_DB, and the block generated in FRR.
  • One learned route in five places, from FRR to ASIC_DB.
  • The session shut down, and the route withdrawn with it.
  • Community SONiC: the routing mode, the session in vtysh, no bgp ebgp-requires-policy, and frr.conf.

This post is for paying subscribers only

Subscribe to LevelUp I.T. newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox. It's free!
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!