I have a customer VRF with two connections to the customer's HQ using BGP (customer is advertising default route on both). I would like to be able to decide which branch site's traffic that should chose which BGP connection - in direction towards the HQ.
For example, in the picture attached, customer traffic from PE3 and PE4 should use BGP connection on PE1 as primary. And customer traffic from PE5 should use the BGP session on PE2 as primary. I guess some kind of source based forwarding or similar. Is this possible?
One solution would be:
1/ on each route-originating PE, add a standard community to the advertised routes, do it in VRF-EXPORT policy:
## PE-1 example:
set policy-options community std-iam-from-pe1 members 64512:301
set policy-options community rt-cust-vrf members target:64512:3000
set policy-options policy-statement pe1-vrf-export term 1 from <match conditions go here>
set policy-options policy-statement pe1-vrf-export term 1 then community add std-iam-from-pe1
set policy-options policy-statement pe1-vrf-export term 1 then community add rt-cust-vrf
set policy-options policy-statement pe1-3vrf-export term 1 then acceptset routing-instances CUST-VRF vrf-export pe1-vrf-export
2/ on each route-receiving PE, match on the community && increase Local Preference, do it in VRF-IMPORT policy
## PE-3 example
set policy-options community iam-from-pe1 members [ 64512:301 target:64512:3000 ]
set policy-options community iam-from-pe2 members [ 64512:302 target:64512:3000 ]
set policy-options policy-statement pe3-vrf-import term 1 from community iam-from-pe1
set policy-options policy-statement pe3-vrf-import term 1 then local-preference 200
set policy-options policy-statement pe3-3vrf-import term 1 then accept
set policy-options policy-statement pe3-vrf-import term 2 then community iam-from-pe2
set policy-options policy-statement pe3-3vrf-import term 2 then acceptset routing-instances CUST-VRF vrf-import pe3-vrf-import
This is exactly what I was looking for. Thanks a lot for the help!!