From: Paresh Khatri (Paresh.Khatri@aapt.com.au)
Date: Wed Jul 20 2005 - 21:13:00 GMT-3
Hi Tom,
The doc at http://www.cisco.com/warp/public/459/26.html is not exactly wrong. I think you are reading it a bit differently to what was intended. The document states that you would use an expression such as ^4_[0-9]*$ to match "networks originated from AS 4 and all directly attached ASs of AS 4". So let's analyze this statement. It is supposed to match on:
1. "networks originated from AS 4"
AND
2. "all directly attached ASs of AS 4"
Consider case 1. Networks that originated from AS4 will have an AS-PATH of '4', which will be matched by ^4_[0-9]*$. The '_[0-9]*' portion of the regexp evaluates to a NULL string in this case. The confusion here is that 4 appears first in the regexp but you've gotta look at what it evaluates to in the end.
Consider case 2. All directly attached ASs of AS 4 will have an AS-PATH of '4_<some AS number>', which will also be matched by ^4_[0-9]*$
So that regexp works just fine.
Going back to your example, if you had a prefix in your BGP table with an AS-PATH of just '600', your regexp of '^600_[0-9]*$' would have matched it.
HTH,
Paresh.
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of
Tom Nooning
Sent: Thursday, 21 July 2005 09:45 AM
To: ccielab@groupstudy.com
Subject: BGP regexp Match on Originating AS
All,
I've searched the archives and read what sparse info Cisco provides, but I
seem to keep coming up with conflicting information. I am fairly confident
that the expression _600$ matches routes that "originated" in AS 600. Now at
http://www.cisco.com/warp/public/459/26.html and in a few posts here I see
^600_[0-9]*$ provided as the expression to match "routes that 'originated' in
AS 600 and are directly connected to AS 600". But '^' matches the beginning
of the string and would match the adjacent AS, right? Are routes seen
differently when being filtered inbound with an AS path access list than when
displayed in 'sh ip bgp n'? I have thoroughly confused myself I know, can
someone set me straight?
R5#s ip bgp reg _600$
BGP table version is 30, local router ID is 5.5.201.1
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.21.0/24 186.5.5.100 0 0 100 400 500 600
i
*> 100.100.22.0/24 186.5.5.100 0 0 100 400 500 600
i
*> 100.100.23.0/24 186.5.5.100 0 0 100 400 500 600
i
R5#s ip bgp reg ^600_[0-9]*$
R5#
This archive was generated by hypermail 2.1.4 : Sun Sep 04 2005 - 17:00:30 GMT-3