cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
594
Views
0
Helpful
4
Replies

BGP Regular Expressions (Originated AS Expressions)

kfarrington
Level 3
Level 3

All,

I am a tad confused with the doc http://www.cisco.com/warp/public/459/26.html

Now, I have the following AS-Path Lists

network 10.0.0.0/8 is in AS 444

The prefix ASP is 222 333 444

I am in AS111.

Now if I want to stop all routes including the 10.0.0.0/8 from being advertised into my AS, do I use the following :-

ip as-path access-list 1 permit ^444$

router bgp 111

neighbor x.x.x.x remote-as 222

neighbor x.x.x.x route-map foo in

route-map foo deny 10

match as-path 1

route-map foo permit 20

---------------OR------------------

ip as-path access-list 1 permit _444$

router bgp 111

neighbor x.x.x.x remote-as 222

neighbor x.x.x.x route-map foo in

route-map foo deny 10

match as-path 1

route-map foo permit 20

What is the difference?

Many thx,

Ken

4 Replies 4

Harold Ritter
Cisco Employee
Cisco Employee

Ken,

The first one would deny as-path containing 444 only (ie: 444 would be denied but 222 333 444 would not)

The second one would deny any as-path ending with 444 (ie: 222 333 444 would be denied)

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

ta dude

mheusinger
Level 10
Level 10

Just a few remarks to what Harold wrote:

With regular expressions the router treats the AS path like a text string.

_ (underscore) searches for space, begin of string, end of string ... anything except numbers

^ means begin of string, so ^4 means an AS path starting with 4 (this includes 4 or 4123)

$ means end of string, so 1$ means f.e. "4321" or "3123 1"

When writing filters keep in mind that the originating AS will be at the end of the AS path and the AS you learn a prefix from will be the first in the AS path. Another thing to keep in mind is that due to AS path prepending any AS number could occur more than once.

Regards

Martin

Thx fella, for the extra comments on from Mr H.

Much apprciated

Review Cisco Networking products for a $25 gift card