Arista BGP Implementation and Optimization
Arista Peering Foundations
BGP on Arista EOS
Arista's Extensible Operating System (EOS) treats routing protocols differently than traditional network operating systems. Instead of a single, monolithic process handling all routing information, EOS uses a where each protocol, including BGP, runs as a separate, isolated process. These agents then communicate with the Routing Information Base Daemon (Ribd) to program the forwarding plane.
This design significantly improves stability and performance. If the BGP agent encounters an issue, it can be restarted without affecting OSPF or the underlying hardware forwarding. It also allows Arista to develop and update features for specific protocols without requiring a full system-wide software upgrade.
Basic Configuration
Starting the BGP process on an Arista switch is straightforward. You define the BGP autonomous system (AS) number and immediately take explicit control over which address families are active.
switch(config)# router bgp 65001
switch(config-router-bgp)# no bgp default ipv4-unicast
The command no bgp default ipv4-unicast is crucial. By default, older BGP implementations would automatically start trying to negotiate IPv4 unicast sessions with every configured neighbor. Disabling this forces you to be deliberate. You must explicitly activate the IPv4 or IPv6 address family for each neighbor, which prevents accidental route exchanges and makes the configuration clearer and more secure.
Next, you need a stable BGP Router-ID. This is a 32-bit number, usually formatted like an IPv4 address, that uniquely identifies the router within the BGP domain. If you don't set one, EOS will choose one for you, typically from the highest IP address on a loopback interface, or the highest IP on a physical interface if no loopbacks exist. Relying on a physical interface is risky; if that interface goes down, the Router-ID can change, causing all BGP sessions to reset. The best practice is to manually configure a dedicated loopback interface and use its IP address.
# Configure a loopback interface
switch(config)# interface loopback 0
switch(config-if-Lo0)# ip address 192.168.0.1/32
# Configure the BGP router-id
switch(config)# router bgp 65001
switch(config-router-bgp)# router-id 192.168.0.1
Configuring Neighbors
With the BGP process running, you can define your neighbors. The configuration differs slightly for external BGP (eBGP) peers, which are in a different AS, and internal BGP (iBGP) peers, which are in the same AS.
switch(config)# router bgp 65001
# eBGP neighbor in another AS
switch(config-router-bgp)# neighbor 10.0.0.2 remote-as 65002
switch(config-router-bgp)# neighbor 10.0.0.2 password 7 01010A1A1117
# iBGP neighbor in the same AS
switch(config-router-bgp)# neighbor 192.168.0.2 remote-as 65001
switch(config-router-bgp)# neighbor 192.168.0.2 update-source loopback 0
Notice the update-source command for the iBGP neighbor. Because iBGP peers often connect using their stable loopback addresses, you must tell BGP which source IP to use for its TCP connection. For eBGP, this is typically not needed as peers are usually directly connected.
As you add more neighbors with similar configurations, repeating the same commands becomes tedious and error-prone. Arista EOS supports BGP Peer Groups to solve this. You create a group, define the shared configuration once, and then simply assign neighbors to that group. This makes the configuration cleaner and more scalable.
# Create an iBGP peer group
switch(config)# router bgp 65001
switch(config-router-bgp)# neighbor IBGP-PEERS peer group
switch(config-router-bgp)# neighbor IBGP-PEERS remote-as 65001
switch(config-router-bgp)# neighbor IBGP-PEERS update-source loopback 0
# Assign neighbors to the group
switch(config-router-bgp)# neighbor 192.168.0.2 peer group IBGP-PEERS
switch(config-router-bgp)# neighbor 192.168.0.3 peer group IBGP-PEERS
Activating Routes and Checking State
Simply configuring a neighbor isn't enough. Because we used no bgp default ipv4-unicast, no routes will be exchanged until we explicitly activate an address family. This is done within the neighbor or peer group configuration.
switch(config)# router bgp 65001
# Activate IPv4 and IPv6 for the iBGP peer group
switch(config-router-bgp)# neighbor IBGP-PEERS peer group
switch(config-router-bgp)# neighbor IBGP-PEERS activate
switch(config-router-bgp-af)# address-family ipv4
switch(config-router-bgp-af-ipv4)# neighbor IBGP-PEERS activate
switch(config-router-bgp-af-ipv4)# exit
switch(config-router-bgp-af)# address-family ipv6
switch(config-router-bgp-af-ipv6)# neighbor IBGP-PEERS activate
Once activated, the BGP process will attempt to establish a session with the neighbor. This process follows a state machine. In EOS, the key states you'll see are:
| State | Description |
|---|---|
| Idle | The initial state. BGP is waiting to start the connection process. It will stay here if there's no valid route to the neighbor. |
| Active | The router is actively trying to establish a TCP connection with the peer. If it fails, it will fall back to an idle state for a period before trying again. Seeing a session flapping between Idle and Active often indicates a connectivity or firewall issue. |
| OpenSent | A TCP connection is established, and an OPEN message has been sent. The router is waiting for an OPEN message from its peer. |
| OpenConfirm | An OPEN message has been received from the peer. The router is waiting for a KEEPALIVE or NOTIFICATION message. |
| Established | The session is fully up! The peers have exchanged OPEN messages, accepted the parameters, and can now exchange UPDATE messages containing route information. |
You can check the status of your BGP neighbors with the show ip bgp summary command. An established session is the goal, and any other state indicates a specific point of failure in the connection process.
How does Arista EOS's architectural design for routing protocols like BGP differ from traditional network operating systems?
What is the primary effect of using the no bgp default ipv4-unicast command when configuring BGP on an Arista switch?
With these building blocks, you can create stable and scalable BGP peerings on Arista EOS, forming the foundation for more advanced routing policies.