From: Ruhann (groupstudy@ru.co.za)
Date: Wed Mar 25 2009 - 04:29:46 ART
just a correction, :/
^(100+)(_\1)*$ would match as-100 and allow prepending
BB3# sh ip bgp regex ^(100+)(_\1)*$
BGP table version is 12, local router ID is 31.3.0.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
*> 174.1.0.0 100.12.1.5 0 0 100 100 100 100
100 100 100 100 ?
On Wed, Mar 25, 2009 at 9:22 AM, Ruhann <groupstudy@ru.co.za> wrote:
> The two filters do a similar thing but are different:
>
> ^100$ - Directly connected to AS 100 (begins and ends in AS 100) 1 ASN
> hop.
> _100& - Originated in AS 100, but could have passed through other AS's.
>
> You will use the first if you want to match only your directly connect AS'
> routes, ie to match routes originated in a connected peering AS,
> the only problem with this approach you are not allowing the peer AS to
> use prepending of his own AS-number, as you only matching a AS-path length
> with 1 hop being 100,
> so in that regard the following would be the better filer: ^(100)+$
> The second filter _100$, also list routes that AS-100 originated, but the
> difference is AS-100 could be directly connected or it could be 10 AS hops
> away, having passed through several AS's.
> This would also allow AS-100 to use prepending. This is not a nice filter
> since it does allow quite alot.
>
> Which to use would entirely depends on what you are trying to match of
> filter.
> imh more strict is always better, but that more real world than exam :)
>
> hth
>
>
> On Sun, Mar 22, 2009 at 7:40 PM, Cisco Fanatic <ebay_products@hotmail.com>wrote:
>
>> Hi All,
>>
>> If we have to learn only those prefixes that Originate in some AS ASXX. We
>> can
>> use ^$ and _XX$. In some workbooks I have seen one or the other being
>> used. I
>> have tested both and both are working (the way it should). Which one is
>> better
>> over the other.
>>
>> For example,
>> !
>> router bgp XX
>> neighbor x.x.x.x filter-list 10 in
>> !
>> ip as-path access-list 10 deny _ASXX$
>> ip as-path access-list 10 permit .*
>> !
>> *******************************************
>> Or/And,
>>
>> !
>>
>> router bgp XX
>>
>> neighbor x.x.x.x filter-list 10 in
>>
>> !
>>
>> ip as-path access-list 10 deny ^ASXX$
>> !
>> *******************************************
>>
>>
>> Yuri
>>
>> _________________________________________________________________
>> Windows Live SkyDrive: Get 25 GB of free online storage.
>> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_skydrive_032009
>>
>>
>> Blogs and organic groups at http://www.ccie.net
>>
>> _______________________________________________________________________
>> Subscription information may be found at:
>> http://www.groupstudy.com/list/CCIELab.html
>>
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> <ruhann>
>
>
-- <ruhann>Blogs and organic groups at http://www.ccie.net
This archive was generated by hypermail 2.1.4 : Mon Apr 06 2009 - 06:44:07 ART