AS path manipulations

1.5.d i Local AS, allowas-in, remove private as

local-AS

General information on “BGP local-AS”:

“BGP local-AS” CLI configuration commands:

## Configuring the BGP local-as feature
Router(config)# router bgp <asn>
Router(config-router)# neighbor <ip> local-as <asn>

allowas-in

General information on “BGP allowas-in”:

“BGP allowas-in” CLI configuration commands:

## Configuring the BGP allowas-in feature
Router(config)# router bgp <asn>
Router(config-router)# address-family [ipv4 | ipv6 | vpnv4 | ...]
Router(config-router-af)# neighbor <ip> allowas-in

as-override (not on blueprint)

General information on “BGP as-override”:

“BGP as-override” CLI configuration commands:

## Configuring the BGP as-override feature
Router(config)# router bgp <asn>
Router(config-router)# address-family [ipv4 | ipv6 | vpnv4 | ...]
Router(config-router-af)# neighbor <ip> as-override split-horizon

remove-private-as

General information on “BGP remove-private-as”:

“BGP remove-private-as” CLI configuration commands:

## Configuring the BGP remove-private-as feature
Router(config)# router bgp <asn>
Router(config-router)# address-family [ipv4 | ipv6 | vpnv4 | ...]
Router(config-router-af)# neighbor <ip> remove-private-as

1.5.d ii Prepend

General information on “BGP Prepend”:

“BGP Prepend” CLI configuration commands:

## Configuring a route-map for AS Path prepending
Router(config)# route-map [NAME] permit
Router(config-route-map)# match [argument]
Router(config-route-map)# set as-path [prepend] [asn1 asn2 asn... | last-as]


## Applying the AS Path prepending route-map to a BGP neighbor
Router(config)# router bgp <asn>
Router(config-router)# address-family [ipv4 | ipv6 | vpnv4 | ...]
Router(config-router-af)# neighbor [IP | peer-group] route-map [ROUTE-MAP-NAME] out

1.5.d iii Regexp

General information on “BGP Regexp”:

Regexp characters:

Character Function
^ Start of the string.
$ End of the string.
[ ] Defines a range.
- Used to specify the range.
. Any single character.
? Zero or one instance.
* Zero or more instances.
+ One or more instances.
_ Matches the space between AS numbers or the end of the AS_PATH list.
\\ Escape character. Needed for BGP confederations.

Regexp examples:

String Matches
.* Anything.
^$ Locally originated routes.
^10_ Routes learned from AS 10.
_10_ Routes transiting through AS 10.
^[0-9]+$ Directly connected AS'es.
_10$ Routes originated in AS 10.
^([0-9]+)_10 Routes from AS 10 where AS 10 is behind one of our directly connected AS'es.
^([0-9]+)_10 Routes from peers of the directly connected AS 10.