5000 Series Layer 2/3 Managed Data Center Switch CLI Reference Guide
686
To prepend one or more AS numbers to the AS-PATH in a BGP route, use the set as-path command in
Route Map Configuration mode. This command is normally used to insert one or more instances of the
local AS number at the beginning of the AS_PATH attribute of a BGP route. Doing so increases the AS-
PATH length of the route. The AS-PATH length has a strong influence on BGP route selection. Changing
the AS-PATH length can influence route selection on the local router or on routers to which the route is
advertised.
When prepending an inbound route, if the first segment in the AS_PATH of the received route is an
AS_SEQUENCE,
as-path-string
is inserted at the beginning of the sequence. If the first segment is an
AS_SET,
as-path-string
is added as a new segment with type AS_SEQUENCE at the beginning of the
AS-PATH. When prepending an outbound route to an external peer,
as-path-string
follows the local AS
number, which is always the first ASN.
No
command removes a
set
command from a route map.
set as-path prepend as-path-string
no set as-path prepend as-path-string
Parameters
as-path-string
List of AS-PATH numbers to insert at the beginning of the AS_PATH
attribute of matching BGP routes. To prepend more than one AS
number, separate the ASNs with a space and enclose the string in
quotes. Up to ten AS numbers may be prepended.
Default
The default is None.
Command Mode
Route Map Config
Example
The following example prepends three instances an external peer’s AS number to paths received from
that peer, making routes learned from this peer less likely to be chosen as the best path.
(Routing)#config
(Routing)#route-map ppAsPath
(Routing)#set as-path prepend “2 2 2”
(Routing)#exit
(Routing)#router bgp 1
(Routing)#neighbor 172.20.1.2 remote-as 2
(Routing)#neighbor 172.20.1.2 route-map ppAsPath in
7-63
set comm-list delete
To remove BGP communities from an inbound or outbound UPDATE message, use the
set comm-list
delete
command in Route Map Configuration mode. A route map with this
set
command can be used to
remove selected communities from inbound and outbound routes. When a community list is applied to a
route for this purpose, each of the route’s communities is submitted to the community list one at a time.
Communities permitted by the list are removed from the route. Because communities are processed