[c-nsp] Counting a confederation AS path length

Arnaud Le Taillanter alt at fr.clara.net
Thu Dec 14 11:54:51 EST 2006


Hello,

I need to count (in a route map) how many confederation AS a BGP prefix has gone through.
For example, I need to recognize that there are two confederation AS in the AS path "(333 222) 111".

I thought of using some AS path access lists (201 will match one confederation AS,
202 will match two and 299 will match three or more):

ip as-path access-list 201 permit \([0-9]+\)
ip as-path access-list 202 permit \([0-9]+ [0-9]+\)
ip as-path access-list 299 permit \([0-9]+ [0-9]+ [0-9]+_.*\)

I've tested this on 120-26.S6 and 122-25.S9.

Do you think this solution is right for any IOS version? I fear that the litteral
matching of parenthesis is a bit special and perhaps some IOS versions don't use
parenthesis to mark a confederation AS path anyway?

Perhaps someone has a better/different solution to achieve the same result?

Thanks for any idea!

Arnaud



More information about the cisco-nsp mailing list