Monday, August 3, 2020

JUNOS BGP Route-Map

Forgive me, I'm from Cisco land, and I'm bashing my head into my desk trying to make this work.

I have 2 datacenters, each with 1 circuit to a vendor, and configured with BGP. I'm trying to advertise routes from DC A primary out of DC A, and prepend routes from DC B, and vice versa. On a Cisco router I'd do this with a route-map, that route-map would have 2 steps, first step would match prefix list with DC A subnet, and second step would match DC B prefix list and then set an AS prepend. I have all the routes in my routing-instance from OSPF already.

Here is what I had originally on my Juniper SRX when only advertising DC A.

set policy-options policy-statement routes-out term primary-out from protocol ospf set policy-options policy-statement routes-out term primary-out from prefix-list primary-out set policy-options policy-statement routes-out term primary-out then accept set routing-instances datacenter protocols bgp group dc-out neighbor Z.Z.Z.Z export routes-out

Worked great long time and everyone was happy. Then I added another term

set policy-options policy-statement routes-out term secondary-out from protocol ospf set policy-options policy-statement routes-out term secondary-out from prefix-list secondary-out set policy-options policy-statement routes-out term secondary-out then as-path-prepend "100 100" set policy-options policy-statement routes-out term secondary-out then accept

And that would not work. So I added this before the secondary-out term

set policy-options policy-statement routes-out term primary-out then next term

Still wouldn't work. I created another policy statement and applied that to the BGP neighbor and that didn't work. I'm honestly pulling my hair out at this point. I'm sure this is way simple, I just can't figure out how the JUNOS syntax needs this formatted.



No comments:

Post a Comment