ARISTA - BGP Commands
Configuring BGP on Arista EOS
To start configuring BGP, you need to enter global configuration mode and enable BGP for a specific Autonomous System (AS).
router bgp [AS_NUMBER]
Example:
router bgp 65001
BGP Neighbors Configuration
You can define BGP neighbors, which are other BGP routers with which your device will exchange routing information.
- Add a Neighbor
neighbor [IP_ADDRESS] remote-as [AS_NUMBER]
Example:
neighbor 192.168.1.1 remote-as 65002
- Specify the Neighbor’s Address Family
address-family [ipv4 | ipv6] unicast
Example:
address-family ipv4 unicast
- Configure the Neighbor's Update Source
neighbor [IP_ADDRESS] update-source [INTERFACE_NAME]
Example:
neighbor 192.168.1.1 update-source Ethernet1
- Configure BGP Peer Group
You can also configure peer groups to simplify neighbor configurations.
neighbor [PEER_GROUP_NAME] peer-group neighbor [PEER_GROUP_NAME] remote-as [AS_NUMBER]
Example:
neighbor PeerGroup1 peer-group neighbor PeerGroup1 remote-as 65002
BGP Address Family Configuration
You can configure BGP for different address families (IPv4, IPv6) using the address-family command.
- IPv4 Unicast Address Family
address-family ipv4 unicast
Example:
router bgp 65001 address-family ipv4 unicast
- IPv6 Unicast Address Family
address-family ipv6 unicast
Example:
router bgp 65001 address-family ipv6 unicast
BGP Path Attributes Configuration
BGP supports multiple path attributes to control route selection and advertisement. Below are some common attributes that can be configured.
- Configure Local Preference
Local preference is used to prefer a particular route within an AS.
bgp bestpath local-preference [VALUE]
Example:
bgp bestpath local-preference 200
- Configure MED (Multi-Exit Discriminator)
MED is used to influence the route selection across different ASes.
bgp bestpath med [VALUE]
Example:
bgp bestpath med 50
- Configure Weight
Weight is a Cisco-specific attribute that influences route preference. It is local to the router and does not propagate to other routers.
neighbor [IP_ADDRESS] weight [VALUE]
Example:
neighbor 192.168.1.1 weight 100
BGP Route Filtering
BGP allows filtering of incoming and outgoing routes to control the routing table and BGP advertisements.
- Prefix List
You can use prefix lists to filter specific IP prefixes.
ip prefix-list [PREFIX_LIST_NAME] permit|deny [NETWORK/MASK]
Example:
ip prefix-list myFilter permit 192.168.0.0/16
- Route Map
Route maps can be used for more advanced filtering and route manipulation.
route-map [MAP_NAME] permit|deny [SEQUENCE_NUMBER]
Example:
route-map MyRouteMap permit 10
- Apply a Route Map to a BGP Neighbor
neighbor [IP_ADDRESS] route-map [MAP_NAME] in|out
Example:
neighbor 192.168.1.1 route-map MyRouteMap in
- Distribute List
A distribute list can be used to filter routes based on access lists.
neighbor [IP_ADDRESS] distribute-list [ACCESS_LIST_NAME] in|out
Example:
neighbor 192.168.1.1 distribute-list MyAccessList out
BGP Route Advertisement
- Advertise Networks
You can advertise networks into BGP using the `network` command.
network [NETWORK/MASK]
Example:
network 10.0.0.0/24
- Advertise Aggregate Address
You can advertise a summarized or aggregate address.
aggregate-address [NETWORK/MASK]
Example:
aggregate-address 10.0.0.0/16
BGP Timers and Parameters
BGP allows configuration of timers for various BGP operations, including keepalive and hold timers.
- Configure Keepalive and Hold Timers
neighbor [IP_ADDRESS] timers [KEEPALIVE_INTERVAL] [HOLD_TIME]
Example:
neighbor 192.168.1.1 timers 30 90
- Configure BGP Maximum Prefix Limit
neighbor [IP_ADDRESS] maximum-prefix [MAX_PREFIXES]
Example:
neighbor 192.168.1.1 maximum-prefix 5000
BGP Show Commands
Once BGP is configured, there are several show commands to verify and troubleshoot BGP.
- Show BGP Summary
show ip bgp summary
This will display the BGP neighbors, state, and prefix counts.
- Show BGP Route
show ip bgp
This will display the BGP routing table.
- Show BGP Neighbor Information
show ip bgp neighbors [IP_ADDRESS]
This will display detailed information about a specific BGP neighbor.
- Show BGP Advertised Routes
show ip bgp neighbors [IP_ADDRESS] advertised-routes
This will display the routes advertised to a specific BGP neighbor.
Troubleshooting BGP
- BGP Debugging Commands
You can enable debugging to capture BGP activity.
debug ip bgp
This command will show live BGP updates, state changes, and route advertisements.
- Display BGP Events
show logging | include BGP
This will filter the log for BGP-specific events and errors.
Useful Links
- [Arista EOS Documentation](https://www.arista.com/en/support/eos)
- [RFC 4271 - BGPv4 Specification](https://tools.ietf.org/html/rfc4271)
- [Arista BGP Configuration Guide](https://www.arista.com/en/support/bgp)
- [Cisco BGP Command Reference](https://www.cisco.com/c/en/us/td/docs/iosxr/ncs5500/bgp/bgp-command-reference-650/b-bgp-cg/b-bgp-cg_chapter_010.html)
