The NVIDIA® Cumulus Linux 4.2.0 release introduces a nifty new feature called auto BGP, which makes BGP ASN assignment in a two-tier leaf and spine network configuration a breeze. Auto BGP does the work for you without making changes to standard BGP behavior or configuration so that you don’t have to think about which numbers to allocate to your switches. This helps you build optimal ASN configurations in your data center and avoid suboptimal routing and path hunting, which occurs when you assign the wrong spine ASNs.

If you don’t care about ASNs then this feature is for you. But if you do, you can always configure BGP the traditional way where you have control over which ASN to allocate to your switch. What I like about this feature is that you can mix and match; you don’t have to use auto BGP across all switches in your configuration – you can use it to configure one switch but allocate ASN numbers manually to other switches.

So, how does auto BGP assign ASNs?

We use private 32-bit ASN numbers in the range 4200000000 through 4294967294. This is the private space defined in RFC 6996. Each leaf is assigned a random and unique value in the range 4200000001 through 4294967294 and is based on a hash of the switch MAC address. Each spine is assigned 4200000000; the first number in the range.

And, how do you configure auto BGP?

You use a simple NCLU command with the keyword leaf or spine:
net add bgp auto leaf
net add bgp auto spine

Don’t worry, the auto BGP leaf and spine keywords are only used to configure the ASN. The configuration files and net show commands display the ASN number only.

And that’s it in a nutshell!

If you want to learn more about BGP ASN numbering and path hunting, take a look at BGP in the data center by our very own Dinesh Dutt. For further reading, take a look at the BGP topics on our website.