Recently I was writing a policy to prevent all ASN prefixes behind my neighbouring ASN (directly connected peer) 64512, from being redistributed into OSPF an interface on the router in AS64513. This proved to be challenging for me and JTAC engineers to write the correct regexp. Which turned out to be:-
as-path testregexp 64512.*
Even using the Juniper documentation on this topic with the use of spaces, exclamation marks, and other various combinations to get to the above was difficult. Therefor does any one know where to locate clear explaination, whitepaper that would help my next efforts ?
colin@r1> show configuration policy-options policy-statement regexp-aspath-filter
term filter-AS64512-routes {
from {
protocol bgp;
as-path testregexp;
}
then reject;
}
term redistribute-bgp {
from protocol bgp;
then {
metric 50;
accept;
}
}