cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
585
Views
0
Helpful
1
Replies

BGP Regular Expressions

sudhir_ralli
Level 1
Level 1

This is one of the CCIE Flash Cards Q, whats the difference between A and D ?

What is the difference between the regular expressions _200_ and _200$?

A.) The first expression refers to routes that have the substring 200 in their AS paths; the second

expression refers only to routes that originated in AS 200.

B.) The first expression refers to routes that have the substring 200 in their AS paths; the second

expression refers only to routes that are directly connected to AS 200.

C.) The first expression refers to routes that are directly connected to AS 200; the second expression

refers to routes that originated in AS 200.

D.) The first expression refers to routes that go through AS 200; the second expression refers to routes

that originated in AS 200.

As I understand,

_40$ means the Originating AS is 40.

^40$ means ..only AS 40 which is directly connected and is the originator also.

_40_ means 40 can be anywhere on the AS_PATH.

http://www.cisco.com/en/US/customer/tech/tk365/technologies_tech_note09186a0080094a92.shtml says

ip as-path access-list 1 permit ^4_[0-9]*$ will allow Networks Originated from AS 4, and ASs Directly Attached to AS 4

How?

The ^ means the routes are being received from AS 4, and not being originated from AS4 ?

1 Reply 1

pkhatri
Level 11
Level 11

In answer to your first question, option A refers to the substring 200 whereas D refers to AS 200. In the context of an AS-PATH, a substring of 200 means that the number 200 appears somewhere within an AS e.g. 22000, 2005 and so on. So the regular expression to match the substring is '200', without any anchors, which would match 2200, 5200, 32001 and so on. On the other hand, _200_ matches only 200 within an AS-PATh.

For the second part of your query, ^4_[0-9]*$ will also match an AS-PATH containing just the AS 4 (routes originated in AS 4). This is because, in the case of only a single AS in the path, the regexp does a match on ^4_$. The _ also matches the null character, so it will match an AS-PATH of 4.

HTH,

Paresh

Review Cisco Networking for a $25 gift card