Currently Empty: 0.00 €
Networking
Deploying BGP Underlay in Enterprise SONiC: Peer Templates, Authentication, and BFD

In modern data center networks, the Border Gateway Protocol (BGP) has emerged as a preferred routing protocol for building scalable and resilient underlay networks. As someone who’s implemented numerous data center fabrics, I’ve found that BGP’s flexibility and extensive feature set make it particularly well-suited for CLOS architectures. Enterprise SONiC, with its robust BGP implementation, provides network engineers with powerful tools to deploy and manage BGP underlay networks efficiently.
In this article, I’ll explore the key components of deploying a BGP underlay in Enterprise SONiC, focusing on three critical features: peer templates, authentication, and Bidirectional Forwarding Detection (BFD). These features enhance the scalability, security, and reliability of your network infrastructure, making them essential knowledge for anyone working with Enterprise SONiC deployments.
BGP Underlay Design Principles
Before diving into specific features, it’s important to understand the design principles that guide BGP underlay deployments in Enterprise SONiC. The reference architecture follows RFC7938 for BGP underlay design with these key guidelines:
- EBGP is used in the underlay
- A single ASN is used for all Super-spines (in 5-stage CLOS architectures)
- A single ASN is used for all Spines in a POD
- Each Leaf has a unique ASN
This approach creates a clear and predictable hierarchy in the network, simplifying troubleshooting and ensuring proper traffic flow.
BGP Peer Templates
When deploying BGP in a large CLOS fabric, you’ll often find yourself configuring the same parameters across multiple BGP neighbors. This is where peer templates become invaluable.
What Are Peer Templates?
Peer templates allow you to create reusable blocks of BGP configuration that can be applied to multiple BGP neighbors. Instead of repeating the same configuration for each neighbor, you define it once in a template and then apply it to all relevant peers.
Configuring Peer Templates in SONiC
Here’s how to configure a peer template in Enterprise SONiC:
router bgp <as-num-dot> { [ vrf <vrf-name> ] }
peer-group <template-name>
no peer-group [ <template-name> ]
For example, to create a template for spine connections with BFD enabled:
Leaf1(config)# router bgp 65101
Leaf1(config-router-bgp)# peer-group SPINES
Leaf1(config-router-bgp-pg)# remote-as 65000
Leaf1(config-router-bgp-pg)# bfd
Leaf1(config-router-bgp-pg)# exit
To verify the configuration:
show bgp all peer-group
This approach significantly reduces configuration complexity and ensures consistency across all BGP neighbors of the same type.
BGP Authentication
Security is a critical concern in any network deployment. BGP authentication helps protect your BGP sessions from unauthorized access and potential attacks.
Why Use BGP Authentication?
BGP authentication adds an MD5 digest to each TCP segment sent between neighbors. This protects your BGP sessions against: – Unauthorized messages – TCP security attacks – Session hijacking attempts
Implementing BGP Authentication in SONiC
To configure BGP authentication in Enterprise SONiC:
password <String> [ encrypted ]
no password
Here’s an example implementation:
Leaf1(config)# router bgp 65000
Leaf1(config-router-bgp)# neighbor 1.1.1.1
Leaf1(config-router-bgp-neighbor)# password Bro@dcom encrypted
To verify the configuration:
show bgp ipv4 unicast summary
It’s important to note that passwords must match between two neighbors to form a BGP peering relationship. This creates a secure environment for your BGP exchanges.
Bidirectional Forwarding Detection (BFD)
In a data center environment, rapid failure detection is crucial for maintaining high availability. BFD provides fast forwarding path failure detection times for all media types, encapsulations, topologies, and routing protocols.
Understanding BFD
BFD is a detection protocol designed to provide fast forwarding path failure detection. It allows network administrators to: – Use a consistent failure detection method across different protocols – Apply uniform policies regardless of the underlying medium or protocol – Detect failures much faster than native protocol timers
[stordis-picture: Figure 14 Fast failover with BFD - page 42]
Configuring BFD in SONiC
Enterprise SONiC supports both IPv4 and IPv6 BFD implementation. Here’s how to configure BFD:
bfd
peer { <peer_ipv4> | <peer_ipv6> } [ vrf <vrfname> ] [ multihop ] [ local-address { <local_ipv4> | <local_ipv6> } ] [ interface <interfacename> ]
For example:
Leaf1(config)# bfd
Leaf1(conf-bfd)# peer 12.12.12.0 interface Ethernet48
Once configured, you can link BFD to your BGP sessions:
Leaf1(config)# router bgp 65000
Leaf1(config-router-bgp)# neighbor 12.12.12.0
Leaf1(config-router-bgp-neighbor)# bfd
To verify the BFD configuration:
show bfd peers brief
show bfd peer 12.12.12.0 interface Ethernet48
The output will show you the BFD session status, uptime, and configured timers, allowing you to confirm that your failure detection mechanism is working as expected.
Additional BGP Underlay Recommendations
Beyond peer templates, authentication, and BFD, there are several other BGP configurations that are recommended for all implementations:
always-compare-med
This command instructs BGP to always compare the MED on routes, even when they were received from different neighboring ASes:
router bgp 65000
always-compare-med
This setting makes the order of preference of routes more defined and helps eliminate MED-induced oscillations.
max-med on-startup
This command instructs BGP to advertise routes with max MED value on router startup for a given time:
router bgp 65000
max-med on-startup 60
This allows BGP to converge fully on the router before any traffic is forwarded to it, preventing potential traffic loss after startup.
maximum-paths
This command allows BGP to load balance traffic (ECMP) on multiple equal-cost routes:
router bgp 65000
address-family ipv4 unicast
maximum-paths 32
maximum-paths ibgp 32
By default, BGP will only select one path for a destination. Enabling maximum-paths allows you to take full advantage of the multiple paths available in a CLOS architecture.
Conclusion
Deploying a BGP underlay in Enterprise SONiC provides a solid foundation for your data center network. By leveraging peer templates, you can streamline configuration and ensure consistency. Authentication adds a critical security layer to protect your BGP sessions, while BFD enables rapid failure detection and recovery.
These features, combined with the additional recommended configurations, create a robust, secure, and highly available BGP underlay that can support even the most demanding data center workloads. As you continue to explore Enterprise SONiC, you’ll find that these fundamentals serve as building blocks for more advanced features like EVPN overlays and multi-tenancy.
Remember that proper planning and documentation of your BGP design, including ASN allocation and peering relationships, will save you significant time and effort during deployment and troubleshooting. With Enterprise SONiC’s comprehensive BGP implementation, you have all the tools you need to build a world-class data center network.
- CLOS Architecture in Data Centers with Enterprise SONiC
- Host Attachment Models in Enterprise SONiC: Single-homed, Dual-homed, and ECMP
- Basic Configuration and Management of SONiC Devices
- Zero Touch Provisioning in Enterprise SONiC: Automating Network Deployment
- L2 Switching Configuration in SONiC: VLANs and Port Channels – STORDIS GmbH
- DHCP Relay Configuration in Enterprise SONiC