0% found this document useful (0 votes)
1 views

eos.arista.com-BGP AS path prepend using last-as keyword

The document discusses the enhancement of the 'set as-path prepend' command in route-map configuration with the 'last-as' keyword, which allows for prepending the last AS number in the AS path a specified number of times. This feature enables better path preference configuration by allowing switches to favor shorter paths. The document also outlines the command syntax, configuration examples, and limitations of this feature in BGP routing.

Uploaded by

jarekscribd23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

eos.arista.com-BGP AS path prepend using last-as keyword

The document discusses the enhancement of the 'set as-path prepend' command in route-map configuration with the 'last-as' keyword, which allows for prepending the last AS number in the AS path a specified number of times. This feature enables better path preference configuration by allowing switches to favor shorter paths. The document also outlines the command syntax, configuration examples, and limitations of this feature in BGP routing.

Uploaded by

jarekscribd23
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

BGP AS path prepend using “last-as” keyword

eos.arista.com/eos-4-18-0f/bgp-as-path-prepend-using-last-as-keyword

The “set as-path prepend” clause in route-map configuration mode has been enhanced with
the addition of the “last-as” keyword, which will prepend the AS path with the specified
number of instances of the last AS number in the AS path. Currently, the command only
accepts an explicit list of AS numbers to prepend to the AS path. This list may also include
one or more “auto” keywords in place of AS numbers, which are replaced by the peer AS
number for inbound routes, and the local AS number for outbound routes.

By extending some AS paths, this feature enables customers to configure their switches to
prefer some paths over other paths which have been extended by prepending the last AS
number. This causes the switch to route traffic via the shorter path (when those routes are
available).

The “last-as” keyword has been introduced in EOS-4.18.0F

Configuration
The following command is configured in route-map configuration mode to enable this
feature.

route-map Test permit 10

set as-path prepend last-as ?

<1-15> The number of times to prepend the last AS number

Feature Summary
If a route-map containing a “set as-path prepend last-as” clause is applied (inbound
or outbound) to an eBGP neighbor, the last AS number in the current AS path
will be prepended to the AS path the specified number of times. On outbound,
this prepending is done before the local AS number is prepended.
If a route-map containing this clause is applied inbound from an iBGP neighbour, the
clause will be ignored. However, the clause will be applied outbound to an iBGP
neighbour. This is in line with the existing AS path prepend behavior.
If the AS path is empty (such as with a locally originated route), the “set as-path
prepend last-as” clause will not change the AS path.
If the first segment of the AS path is an unordered set of AS numbers (such as with
an aggregated route), the “set as-path prepend last-as” clause will not change the
AS path.
Both the “set as-path prepend” and “set as-path prepend last-as” clauses can be
specified in the same route-map sequence. In this case, the “set as-path prepend
last-as” clause will be evaluated before the “set as-path prepend” clause, regardless
of the order in which the clauses were entered in the CLI.
1/3
If the “set as-path prepend” and “set as-path match all replacement” clauses are
specified in the same route-map sequence, the “set as-path match all replacement”
clause takes precedence and the “set as-path prepend” clause is effectively ignored.

Arista#show ip bgp neighbors 172.168.1.2 advertised-routes


BGP routing table information for VRF default
Router identifier 192.172.1.1, local AS number 20
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E -
ECMP head, e - ECMP
S - Stale, c - Contributing to ECMP, b - backup, L - labeled-unicast, q - Queued
for advertisement
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link
Local Nexthop

Network Next Hop Metric LocPref Weight Path


* > 1.20.215.0/24 172.168.1.1 - - - 20 4294967294 596 9241 4651 9737 23969 i
* > 1.20.216.0/24 172.168.1.1 - - - 20 4294967294 596 6453 4651 9737 23969 i
* > 1.20.217.0/24 172.168.1.1 - - - 20 4294967294 596 9241 4651 9737 23969 i
* > 1.20.218.0/24 172.168.1.1 - - - 20 4294967294 596 9241 4651 9737 23969 i
* > 1.20.219.0/24 172.168.1.1 - - - 20 4294967294 596 9241 4651 9737 23969 i
* > 1.20.220.0/23 172.168.1.1 - - - 20 4294967294 596 9241 4651 9737 23969 i
* > 1.21.0.0/16 172.168.1.1 - - - 20 4294967294 596 2914 2519 i
Arista#conf t
Arista(config)#route-map rm1 permit 10
Arista(config-route-map-rm1)#set as-path prepend last-as 3
Arista(config-route-map-rm1)#exit
Arista(config)#router bgp 20
Arista(config-router-bgp)#neighbor 172.168.1.2 route-map rm1 out
Arista(config-router-bgp)#end
Arista#show ip bgp neighbors 172.168.1.2 advertised-routes
BGP routing table information for VRF default
Router identifier 192.172.1.1, local AS number 20
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E -
ECMP head, e - ECMP
S - Stale, c - Contributing to ECMP, b - backup, L - labeled-unicast, q - Queued
for advertisement
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link
Local Nexthop

Network Next Hop Metric LocPref Weight Path


* > 1.20.215.0/24 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 9241 4651 9737 23969 i
* > 1.20.216.0/24 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 6453 4651 9737 23969 i
* > 1.20.217.0/24 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 9241 4651 9737 23969 i
* > 1.20.218.0/24 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 9241 4651 9737 23969 i
* > 1.20.219.0/24 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 9241 4651 9737 23969 i
* > 1.20.220.0/23 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 9241 4651 9737 23969 i
* > 1.21.0.0/16 172.168.1.1 - - - 20 4294967294 4294967294 4294967294 4294967294
596 2914 2519 i
2/3
Limitations
When evaluating a route-map chain (where multiple route-map sequences are
combined using the “continue” or “sub-route-map” keywords), a maximum of 64 AS
numbers can be prepended to the AS path. Once this limit is reached, further
prepend clauses within the route-map chain are ignored.

3/3

You might also like