ARISTA - BGP Commands: Difference between revisions

From IT-Arts.net
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..."
Tag: Recreated
 
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' "
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:Wiki]]
[[Category:Wiki]]
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]'''''


== Configuring BGP on Arista EOS ==
== Configuring BGP on Arista EOS ==
Line 16: Line 19:
You can define BGP neighbors, which are other BGP routers with which your device will exchange routing information.
You can define BGP neighbors, which are other BGP routers with which your device will exchange routing information.


### Add a Neighbor
Add a Neighbor


  <nowiki>
  <nowiki>
Line 25: Line 28:
neighbor 192.168.1.1 remote-as 65002</nowiki>
neighbor 192.168.1.1 remote-as 65002</nowiki>


### Specify the Neighbor’s Address Family
Specify the Neighbor’s Address Family


  <nowiki>
  <nowiki>
Line 34: Line 37:
address-family ipv4 unicast</nowiki>
address-family ipv4 unicast</nowiki>


### Configure the Neighbor's Update Source
Configure the Neighbor's Update Source


  <nowiki>
  <nowiki>
Line 43: Line 46:
neighbor 192.168.1.1 update-source Ethernet1</nowiki>
neighbor 192.168.1.1 update-source Ethernet1</nowiki>


### Configure BGP Peer Group
Configure BGP Peer Group


You can also configure peer groups to simplify neighbor configurations.
You can also configure peer groups to simplify neighbor configurations.
Line 60: Line 63:
You can configure BGP for different address families (IPv4, IPv6) using the address-family command.
You can configure BGP for different address families (IPv4, IPv6) using the address-family command.


### IPv4 Unicast Address Family
IPv4 Unicast Address Family


  <nowiki>
  <nowiki>
Line 70: Line 73:
address-family ipv4 unicast</nowiki>
address-family ipv4 unicast</nowiki>


### IPv6 Unicast Address Family
IPv6 Unicast Address Family


  <nowiki>
  <nowiki>
Line 84: Line 87:
BGP supports multiple path attributes to control route selection and advertisement. Below are some common attributes that can be configured.
BGP supports multiple path attributes to control route selection and advertisement. Below are some common attributes that can be configured.


### Configure Local Preference
Configure Local Preference


Local preference is used to prefer a particular route within an AS.
Local preference is used to prefer a particular route within an AS.
Line 95: Line 98:
bgp bestpath local-preference 200</nowiki>
bgp bestpath local-preference 200</nowiki>


### Configure MED (Multi-Exit Discriminator)
Configure MED (Multi-Exit Discriminator)


MED is used to influence the route selection across different ASes.
MED is used to influence the route selection across different ASes.
Line 106: Line 109:
bgp bestpath med 50</nowiki>
bgp bestpath med 50</nowiki>


### Configure Weight
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.
Weight is a Cisco-specific attribute that influences route preference. It is local to the router and does not propagate to other routers.
Line 121: Line 124:
BGP allows filtering of incoming and outgoing routes to control the routing table and BGP advertisements.
BGP allows filtering of incoming and outgoing routes to control the routing table and BGP advertisements.


### Prefix List
Prefix List


You can use prefix lists to filter specific IP prefixes.
You can use prefix lists to filter specific IP prefixes.
Line 132: Line 135:
ip prefix-list myFilter permit 192.168.0.0/16</nowiki>
ip prefix-list myFilter permit 192.168.0.0/16</nowiki>


### Route Map
Route Map


Route maps can be used for more advanced filtering and route manipulation.
Route maps can be used for more advanced filtering and route manipulation.
Line 143: Line 146:
route-map MyRouteMap permit 10</nowiki>
route-map MyRouteMap permit 10</nowiki>


### Apply a Route Map to a BGP Neighbor
Apply a Route Map to a BGP Neighbor


  <nowiki>
  <nowiki>
Line 152: Line 155:
neighbor 192.168.1.1 route-map MyRouteMap in</nowiki>
neighbor 192.168.1.1 route-map MyRouteMap in</nowiki>


### Distribute List
Distribute List


A distribute list can be used to filter routes based on access lists.
A distribute list can be used to filter routes based on access lists.
Line 165: Line 168:
== BGP Route Advertisement ==
== BGP Route Advertisement ==


### Advertise Networks
Advertise Networks


You can advertise networks into BGP using the `network` command.
You can advertise networks into BGP using the `network` command.
Line 176: Line 179:
network 10.0.0.0/24</nowiki>
network 10.0.0.0/24</nowiki>


### Advertise Aggregate Address
Advertise Aggregate Address


You can advertise a summarized or aggregate address.
You can advertise a summarized or aggregate address.
Line 192: Line 195:
BGP allows configuration of timers for various BGP operations, including keepalive and hold timers.
BGP allows configuration of timers for various BGP operations, including keepalive and hold timers.


### Configure Keepalive and Hold Timers
Configure Keepalive and Hold Timers


  <nowiki>
  <nowiki>
Line 201: Line 204:
neighbor 192.168.1.1 timers 30 90</nowiki>
neighbor 192.168.1.1 timers 30 90</nowiki>


### Configure BGP Maximum Prefix Limit
Configure BGP Maximum Prefix Limit


  <nowiki>
  <nowiki>
Line 215: Line 218:
Once BGP is configured, there are several show commands to verify and troubleshoot BGP.
Once BGP is configured, there are several show commands to verify and troubleshoot BGP.


### Show BGP Summary
Show BGP Summary


  <nowiki>
  <nowiki>
Line 222: Line 225:
This will display the BGP neighbors, state, and prefix counts.
This will display the BGP neighbors, state, and prefix counts.


### Show BGP Route
Show BGP Route


  <nowiki>
  <nowiki>
Line 229: Line 232:
This will display the BGP routing table.
This will display the BGP routing table.


### Show BGP Neighbor Information
Show BGP Neighbor Information


  <nowiki>
  <nowiki>
Line 236: Line 239:
This will display detailed information about a specific BGP neighbor.
This will display detailed information about a specific BGP neighbor.


### Show BGP Advertised Routes
Show BGP Advertised Routes


  <nowiki>
  <nowiki>
Line 245: Line 248:
== Troubleshooting BGP ==
== Troubleshooting BGP ==


### BGP Debugging Commands
BGP Debugging Commands


You can enable debugging to capture BGP activity.
You can enable debugging to capture BGP activity.
Line 254: Line 257:
This command will show live BGP updates, state changes, and route advertisements.
This command will show live BGP updates, state changes, and route advertisements.


### Display BGP Events
Display BGP Events


  <nowiki>
  <nowiki>

Latest revision as of 07:20, 17 January 2026


Return to Wiki Index


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.