Hi Team,
I am migrating a Cisco router to a Juniper MX-480 and here is the part i am stuck at. I have a Route-Map in Cisco which has 4 policy statement-
route-map RM-1 permit 10
match ip address prefix-list PL-1 PL-2 PL-3 PL-4
set local-preference 140
!
route-map RM-1 permit 20
match ip address prefix-list PL-5
match as-path 100
set local-preference 140
!
route-map RM-1 permit 25
match ip address prefix-list PL_6 PL_7
match as-path 55
set local-preference 140
!
route-map RM-1 permit 30
!
Essentially, we have 4 statements
1. Matches 4 PL in Logical OR
2. Matches 1 PL and 1 AS Path in Logical AND and applies Local Pref
3. Matches 2 PL in OR and then matches the result of them to a AS Path in a Logical AND and applies local pref
4. Matches everything else
I am not sure how to convert it into Juniper Code. By Juniper's own documentation, any time we use PL in a Policay stetment, then all the statements in that term become Logical OR.
To do Logical AND, we would need to use next policy action and create new policy. So essentially my code would look something like this -
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-1
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-2
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-3
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-4
set policy-options policy-statement RM-1 term term-PL1 then local-preference 140
set policy-options policy-statement RM-1 term term-PL1 then accept
set policy-options policy-statement RM-2 term term-PL2 from policy PL-5
set policy-options policy-statement RM-2 term term-PL2 then next-policy
set policy-options policy-statement RM-3 term term-PL1 from policy ap-100
set policy-options policy-statement RM-3 term term-PL1 then local-preference 140
set policy-options policy-statement RM-3 term term-PL1 then accept
set policy-options policy-statement RM-4 term term-1 from PL-6
set policy-options policy-statement RM-4 term term-1 then next policy
set policy-options policy-statement RM-5 term term-PL1 from policy ap-55
set policy-options policy-statement RM-5 term term-PL1 then local-preference 140
set policy-options policy-statement RM-5 term term-PL1 then accept
set policy-options policy-statement RM-6 term term-1 from PL-7
set policy-options policy-statement RM-6 term term-1 then next policy
set policy-options policy-statement RM-7 term term-PL1 from policy ap-50
set policy-options policy-statement RM-7 term term-PL1 then local-preference 140
set policy-options policy-statement RM-7 term term-PL1 then accept
But i will now have to apply 7 Export statements under BGP neighbour where i want to apply this. And that too in proper AND and OR manner.
Another way i can think of is to have one master Policy option with multiple terms branching out using next policy option set. For Eg -
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-1
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-2
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-3
set policy-options policy-statement RM-1 term term-PL1 from prefix-list PL-4
set policy-options policy-statement RM-1 term term-PL1 then local-preference 140
set policy-options policy-statement RM-1 term term-PL1 then accept
set policy-options policy-statement RM-1 term term-PL2 from policy PL-5
set policy-options policy-statement RM-1 term term-PL2 then next-policy
set policy-options policy-statement RM-3 term term-PL1 from policy ap-100
set policy-options policy-statement RM-3 term term-PL1 then local-preference 140
set policy-options policy-statement RM-3 term term-PL1 then accept
set policy-options policy-statement RM-1 term term-PL3 from PL-6
set policy-options policy-statement RM-1 term term-PL3 then next policy
set policy-options policy-statement RM-5 term term-PL1 from policy ap-55
set policy-options policy-statement RM-5 term term-PL1 then local-preference 140
set policy-options policy-statement RM-5 term term-PL1 then accept
set policy-options policy-statement RM-1 term term-PL4 from PL-7
set policy-options policy-statement RM-1 term term-PL4 then next policy
set policy-options policy-statement RM-7 term term-PL1 from policy ap-50
set policy-options policy-statement RM-7 term term-PL1 then local-preference 140
set policy-options policy-statement RM-7 term term-PL1 then accept
and i just apply RM1 to the Export statement under BGP neighbour. BUt i am not sure if once branching out using next policy statement, it would go back to the next term in the previous policy statement.
Any help in this owuld be highly appreciated.
I also have a TAC case open and intend to spin up a lab to test as well, but want to see if anyone of you have any suggestions.