Re: could you explain to me about bgp Regular expression

From: Bit Gossip (bit.gossip@chello.nl)
Date: Fri Jul 06 2007 - 04:43:43 ART


R1 has the full table but it doesn't seem to work very well; it matches
only paths with one AS:

r1#show ip bgp regexp ^([0-9]+)(_\1)*$
BGP table version is 3482153157, local router ID is 2.2.2.2
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
*>i4.0.0.0/9 1.1.1.1 0 250 0 3356 i
*>i4.0.0.0 1.1.1.1 0 250 0 3356 i
*>i4.128.0.0/9 1.1.1.1 0 250 0 3356 i
*>i8.0.0.0/9 1.1.1.1 0 250 0 3356 i
*>i8.0.0.0 1.1.1.1 0 250 0 3356 i
*>i8.128.0.0/9 1.1.1.1 0 250 0 3356 i
*>i13.16.0.0/16 1.1.1.1 0 250 0 1273 i
*>i13.20.0.0/14 1.1.1.1 0 250 0 702 i
*>i17.255.248.0/23 1.1.1.1 0 250 0 2686 i
*>i20.137.0.0/16 1.1.1.1 0 250 0 3549 i
*>i20.138.0.0/16 1.1.1.1 0 250 0 3549 i
*>i20.139.0.0/16 1.1.1.1 0 250 0 3549 i
*>i24.56.170.0/23 1.1.1.1 0 250 0 2828 i
*>i24.56.172.0/22 1.1.1.1 0 250 0 2828 i
*>i24.56.188.0/23 1.1.1.1 0 250 0 2828 i
*>i24.236.50.0/23 1.1.1.1 0 250 0 2828 i
*>i24.238.0.0/24 1.1.1.1 0 250 0 174 i
*>i24.238.1.0/24 1.1.1.1 0 250 0 174 i
*>i25.85.0.0/16 1.1.1.1 0 250 0 1273 i
*>i32.0.0.0 1.1.1.1 0 250 0 2686 i
*>i32.112.0.0/15 1.1.1.1 0 250 0 2686 i
*>i34.253.128.0/22 1.1.1.1 0 250 0 3292 i
*>i38.0.0.0 1.1.1.1 0 250 0 174 i
*>i38.99.134.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.176.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.177.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.180.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.181.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.182.0/24 1.1.1.1 0 250 0 174 ?
*>i38.99.183.0/24 1.1.1.1 0 250 0 174 ?
*>i38.103.130.0/24 1.1.1.1 0 250 0 174 i
*>i40.252.8.0/24 1.1.1.1 0 250 0 3320 ?
*>i40.252.48.0/24 1.1.1.1 5 250 0 8220 i
*>i40.252.72.0/24 1.1.1.1 0 250 0 3320 ?
*>i40.252.80.0/24 1.1.1.1 0 250 0 3320 ?
*>i41.204.128.0/19 1.1.1.1 0 250 0 5400 i
*>i41.206.160.0/19 1.1.1.1 0 250 0 6453 i
*>i41.207.34.0/24 1.1.1.1 0 250 0 5400 i
*>i41.207.35.0/24 1.1.1.1 0 250 0 5400 i
*>i41.207.128.0/19 1.1.1.1 10 250 0 8928 ?
*>i41.211.64.0/19 1.1.1.1 10 250 0 8928 ?
*>i41.221.32.0/24 1.1.1.1 0 250 0 6453 i
*>i41.221.33.0/24 1.1.1.1 0 250 0 6453 i
*>i61.14.31.0/24 1.1.1.1 0 250 0 3300 i
*>i62.4.64.0/19 1.1.1.1 0 250 0 6461 i
...
...

On Wed, 2007-07-04 at 09:26 +0000, Marko Milivojevic wrote:
> > I didn't know below regular expression.
> > Pls. explain to me for example...
> >
> > ip as-path access-list 101 permit ^([0-9]+)(_\1)*$
>
> It matches any AS path that consists of the same AS repeated twice (1111
> 1111; 65000 65000; etc).
>
> I also didn't know that one could use backtracking (\1) in regex engine in
> IOS. You learn something new every day :-)
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html



This archive was generated by hypermail 2.1.4 : Sat Aug 18 2007 - 08:17:40 ART