Configuring an AS Regular Expression

You can configure regular expressions that can be matched and used to deny or allow addresses from an AS.

AS Regular Expression Configuration

RTB advertises these routes:

RTC advertises these routes:

To check the routes on router RTA, use the show bgp ipv6 unicast command.

On RTA:
RTA> show bgp ipv6 unicast
BGP table version is 4, local router ID is 10.0.1.2
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 

Network

Next Hop

Metric

LocPrf

Weight

Path

To configure AS regular expressions on RTA and deny all routes originated in AS100:

router bgp 200
: neighbor 10.0.1.1 remote-as 100
: neighbor 10.0.1.1 update-source X2
: neighbor 2004::1 remote-as 100
: neighbor 2004::1 update-source X2
!
address-family ipv6
: neighbor 10.0.1.1 activate
: neighbor 10.0.1.1 filter-list 1 in
: neighbor 2004::1 activate
exit-address-family
 
ip as-path access-list 1 deny ^100$
ip as-path access-list 1 permit .*
 

To check the routes on router RTA, use the show bgp ipv6 unicast command.

On RTA:
RTA> show bgp ipv6 unicast
BGP table version is 4, local router ID is 10.0.1.2
Status codes: s suppressed, d damped, h history, * valid, > best,
i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 

Network

Next Hop

Metric

LocPrf

Weight

Path

Total number of prefixes 3

To modify the AS path to deny all routes learned from the AS100:

On RTA:
router bgp 200
: neighbor 10.0.1.1 remote-as 100
: neighbor 10.0.1.1 update-source X2
: neighbor 2004::1 remote-as 100
: neighbor 2004::1 update-source X2
!
address-family ipv6
: neighbor 10.0.1.1 activate
: neighbor 10.0.1.1 filter-list 1 in
: neighbor 2004::1 activate
exit-address-family
 
ip as-path access-list 1 deny _100_
ip as-path access-list 1 permit .*

To check the routes on router RTA, use the show bgp ipv6 unicast command.

On RTA:
RTA> show bgp ipv6 unicast