01-02-2013 08:05 PM - edited 03-04-2019 06:33 PM
Hi,
Can someone please help me with an as-path acl regex?
We are peering with a customer, and accepting one(or more) of there AS's(Example below using AS "1234")
ip as-path access-list 30 permit ^1234(_1234)*$
The customer wants to start advertising a new range to us, and also a new AS (They are peering with there client)
So resultant AS path will be "1234 new_as" (But can be any number of the 2 AS's, so could be "1234 1234 new_as new_as" etc)
Hope someone can assist
Cheers
01-02-2013 08:59 PM
Hi,
Configuration seems ok. Either you can use:
ip as-path access-list 30 permit ^1234(_[0-9]+)+$
http://blog.ine.com/tag/as-path/Abzal
01-11-2013 02:24 PM
Thanks - So to permit AS 1234 and 5678 (And any number of prepends), I could use:
^(_1234)+(_5678)$
01-11-2013 08:25 PM
Hi,
It really depends
if it is learned from AS1234 and next will be AS5678 (plus one or more prepends) then:
^1234(_5678)+$ --> e.g AS 1234 ----- AS 5678 ----- AS 5678(one or more) ---- your AS
^(1234)+(_5678)+$ AS 1234 ---- AS 1234(one or more) ---- AS 5678 ---- AS 5678(one or more) --- your AS
If these ASes located along the path:
^([0-9]+)+(_1234)+(_5678)+$
Above link is very useful have a look on it.
Hope it will help.
Best regards,
Abzal
01-12-2013 03:51 PM
Thanks very much Abzal - much appreciated.
To confirm, the regex:
^(1234)+(_5678)+$
would match AS paths such as:
1234
1234 1234
1234 5678
1234 5678 5678
...
Or would it also require a "_" in front of 1234?(To match one or more "1234") i.e.
^(_1234)+(_5678)+$
01-13-2013 02:58 AM
Hi,
I've just tested it and required result gave only this access-list
^(1234)(_[1-4]+)?(_5678)?(_[5-8]+)?$
it will match
1234
1234 1234
1234 5678
1234 1234 5678
1234 1234 5678 5678
1234 5678 5678
Hope it will help.
Best regards,
Abzal
01-13-2013 06:03 AM
[1-4]+ is not what you want, it matches 11, 111, 1113, 3322 etc. so any number of repetitions of any digits in the 1,2,3,4 interval
I would write
ip as-path access-list 30 permit ^1234(_1234)*(_5678)*$
08-15-2013 05:42 AM
HI,
why do we using as-path attributes ? can anyone explain.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide