Hello,
Here You go.
1. I modeled full table with folowing 7 routes:
0.0.0.0/3
32.0.0.0/3
64.0.0.0/3
96.0.0.0/3
128.0.0.0/3
160.0.0.0/3
192.0.0.0/3
2. Please see below the example configuration for 2 customer VRF (aptly named "CUST1" and "CUST2"), I'll let You extend this to 4 Yourself. I also let you do the transport part (IGP, MPLS and MP-BGP).
interfaces {
ge-0/0/6 {
description "inside CUST1 VRF";
unit 0 {
family inet {
address 198.15.6.1/30;
}
}
}
ge-0/0/7 {
description "inside CUST2 VRF";
unit 0 {
family inet {
address 198.15.7.1/30;
}
}
}
}
policy-options {
policy-statement CUST1-EXP {
term 1 {
from protocol [ static direct bgp ];
then {
community add CUST1-RT;
accept;
}
}
}
policy-statement CUST1-IMP {
term cust1 {
from community CUST1-RT;
then accept;
}
term cust2 {
from community CUST2-RT;
then accept;
}
term prov1 {
from community PROV1-RT;
then accept;
}
}
policy-statement CUST2-EXP {
term 1 {
from protocol [ static direct bgp ];
then {
community add CUST2-RT;
accept;
}
}
}
policy-statement CUST2-IMP {
term cust1 {
from community CUST1-RT;
then accept;
}
term cust2 {
from community CUST2-RT;
then accept;
}
term prov1 {
from community PROV2-RT;
then accept;
}
}
policy-statement LOAD-BALANCE {
term 1 {
then {
load-balance per-packet;
}
}
then {
load-balance per-packet;
}
}
community CUST1-RT members target:203:1;
community CUST2-RT members target:203:2;
community PROV1-RT members target:203:100;
community PROV2-RT members target:203:200;
}
routing-instances {
CUST1 {
instance-type vrf;
interface ge-0/0/6.0;
route-distinguisher 203.0.113.3:1;
vrf-import CUST1-IMP;
vrf-export CUST1-EXP;
vrf-table-label;
routing-options {
static {
route 0.0.0.0/0 next-table CUST2.inet.0;
}
auto-export;
}
}
CUST2 {
instance-type vrf;
interface ge-0/0/7.0;
route-distinguisher 203.0.113.3:2;
vrf-import CUST2-IMP;
vrf-export CUST2-EXP;
vrf-table-label;
routing-options {
auto-export;
}
}
}
3. Verification printouts are given below:
regress@R3> show route table CUST1
CUST1.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:06:20
to table CUST2.inet.0 <======== NEXT BEST ROUTE IN CASE PROV1 0.0.0.0/1 AND 128.0.0.0/1 ARE NOT IN TABLLE
0.0.0.0/1 *[BGP/170] 00:14:00, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 17
128.0.0.0/1 *[BGP/170] 00:14:00, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 17
169.254.8.0/31 *[BGP/170] 00:14:00, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 17
198.15.6.0/30 *[Direct/0] 00:04:20
> via ge-0/0/6.0
198.15.6.1/32 *[Local/0] 00:04:20
Local via ge-0/0/6.0
198.15.7.0/30 *[Direct/0] 00:04:20 <========= LEAKED FROM CUST2 VRF
> via ge-0/0/7.0
regress@R3> show route table CUST2
CUST2.inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:04:23
to table CUST2.inet.0
0.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
32.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
64.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
96.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
128.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
160.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
169.254.9.0/31 *[BGP/170] 00:11:55, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
192.0.0.0/3 *[BGP/170] 00:07:10, localpref 600, from 203.0.113.6
AS path: I, validation-state: unverified
> to 169.254.13.0 via ae0.0, Push 18
198.15.6.0/30 *[Direct/0] 00:04:23 <========= LEAKED FROM CUST1 VRF
> via ge-0/0/6.0
198.15.7.0/30 *[Direct/0] 00:04:23
> via ge-0/0/7.0
198.15.7.1/32 *[Local/0] 00:04:23
Local via ge-0/0/7.0
HTH
Thx
Alex