ARISTA - BGP Commands

From IT-Arts.net
Revision as of 06:39, 16 December 2025 by Admin (talk | contribs) (Created page with "Category:Wiki == 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). <nowiki> router bgp [AS_NUMBER]</nowiki> Example: <nowiki> router bgp 65001</nowiki> == BGP Neighbors Configuration == You can define BGP neighbors, which are other BGP routers with which your device will exchange routing information. ### Add a Neighbor <nowiki> neighbor [IP_ADDRESS] r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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.

      1. Add a Neighbor
neighbor [IP_ADDRESS] remote-as [AS_NUMBER]

Example:

neighbor 192.168.1.1 remote-as 65002
      1. Specify the Neighbor’s Address Family
address-family [ipv4 | ipv6] unicast

Example:

address-family ipv4 unicast
      1. Configure the Neighbor's Update Source
neighbor [IP_ADDRESS] update-source [INTERFACE_NAME]

Example:

neighbor 192.168.1.1 update-source Ethernet1
      1. 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.

      1. IPv4 Unicast Address Family
address-family ipv4 unicast

Example:

router bgp 65001
address-family ipv4 unicast
      1. 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.

      1. 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
      1. 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
      1. 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.

      1. 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
      1. 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
      1. 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
      1. 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

      1. Advertise Networks

You can advertise networks into BGP using the `network` command.

network [NETWORK/MASK]

Example:

network 10.0.0.0/24
      1. 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.

      1. Configure Keepalive and Hold Timers
neighbor [IP_ADDRESS] timers [KEEPALIVE_INTERVAL] [HOLD_TIME]

Example:

neighbor 192.168.1.1 timers 30 90
      1. 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.

      1. Show BGP Summary
show ip bgp summary

This will display the BGP neighbors, state, and prefix counts.

      1. Show BGP Route
show ip bgp

This will display the BGP routing table.

      1. Show BGP Neighbor Information
show ip bgp neighbors [IP_ADDRESS]

This will display detailed information about a specific BGP neighbor.

      1. 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

      1. 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.

      1. Display BGP Events
show logging | include BGP

This will filter the log for BGP-specific events and errors.