Bgp – Junos AS-PATH regex

bgpjuniper-junos

I'm looking for a particular AS-PATH regex that match the following case:
"accept ONLY neighbour and it's direct peers".

i.e., my neighbour is AS 20, and has 101, 102 as direct peers.

the as-path "20+ .?" correctly matches the following:

20
20 101
20 102
20 20 20 101

but it does not work if AS 101 is doing AS-prepending (i.e. 20 101 101 101).

Is there a way to achieve that? (if I remember well, in Cisco IOS I can use the \1)

thanks
stefano

Best Answer

This is not possible on JunOS as the AS-Path regular expressions do not support back references (Inserting (part of) a matched expression back into the regular expression itself).

Related Topic