Hi John,
try to configure by separating them in different terms, 1st is more specific, 2nd is less specific, 3rd is simple reject on site C:
set policy-options community SITE_A_COMM members 1:1
set policy-options community SITE_B_COMM members 2:2
set policy-options community ABC_COMM members target:100:100
set policy-options policy-statement VRF_IMPORT term 1 from protocol bgp
set policy-options policy-statement VRF_IMPORT term 1 from community SITE_A_COMM
set policy-options policy-statement VRF_IMPORT term 1 then local-preference 999
set policy-options policy-statement VRF_IMPORT term 1 then accept
set policy-options policy-statement VRF_IMPORT term 2 from protocol bgp
set policy-options policy-statement VRF_IMPORT term 2 from community ABC_COMM
set policy-options policy-statement VRF_IMPORT term 2 then accept
set policy-options policy-statement VRF_IMPORT term 3 then reject
set routing-instances VRF vrf-import VRF_IMPORT
------------------------------
Regards,
Elchin
------------------------------
Original Message:
Sent: 12-01-2020 02:13
From: John Gerro
Subject: How to filter VPN routes with community in vrf-import policy
Hi, I have a situation that I need to filter out vpn routes based on those routes community, in the vrf-import policy I have to match proper route target community for the routes to be imported from bgp.l3vpn.0 table, how can I further process those routes based on those routes' regular community which is set in remote sites?
For example, I have MPLS VPN sites A, B, C, Site C's vrf imports routes from A and B with route-target "target:100:100" in vrf-import policy, both site A and site B advertises 10.0.0.0/8 but with their own regular BGP community 1:1 and 2:2 respectively -- in addition to extended RT community "target:100:100", now I want to assign higher local preference in site C such that 10.0.0.0/8 route learned with community 1:1 will have high local preference, how can I compose site C's vrf-import policy to achieve what I want?
Thanks,
JG
------------------------------
John Gerro
------------------------------