cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
558
Views
4
Helpful
3
Replies

How to do a BGP as-path ACL that only allows partial & default routes?

huangedmc
Level 3
Level 3

My ISP's ASN is 7018.

Is following the correct syntax?

^7018_?[0-9]*$

If so, how the heck do I get the "?" in there?

The 7200 tells me:

"Router(config)#ip as-path access-list 1 permit ?

LINE A regular-expression to match BGP AS paths. Use "ctrl-v ?" to enter "?"

When I do ctrl-v ? though, it gives me "^_" instead of "?".

Anyone have any idea?

3 Replies 3

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Huang,

if you want to match BGP paths originated in AS 7018 you can use

^7018$

if you want match AS paths of AS length 2 with first AS 7018 you can use

^7018_[0-9]+$

I would use a two lines as path ACL is a good tradeoff between complexity and your needs

I know that first digit cannot be zero so a match for first digit would be [1-9] but also there can be no additional digits

Hope to help

Giuseppe

Edison Ortiz
Hall of Fame
Hall of Fame

Hit CTRL-V then enter ? and continue typing the next text.

Rack1R1(config)#ip as-path access-list 1 permit ? ?

LINE

HTH,

__

Edison.

Very helpful, Thanks guys

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: