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

Cooky

Golden Member
Apr 2, 2002
1,408
0
76
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?
 

mcmilljb

Platinum Member
May 17, 2005
2,144
2
81
I haven't done regular expressions in bgp before, but I do recall seeing that cntrl+v is an escape sequence that allows you to enter a question mark after releasing the 2 keys.

I just tried it, and it worked for me. When I press cntrl+v and release then hold shift and press the ? key, I get a question mark on the command line. So it is an escape sequence for getting a question mark, and I assume possible other characters.

I also thought about something. Check your terminal program to see if it does anything funky with cntrl-v. Also considering typing it in notepad and then pasting into the command-line. I believe that should work as well.