Hi,
Let's assume there are two routing instances: R_VRF (vrf type instance) and S_FWD which is a Forwarding type instance. R_VRF imports routes from bgp and export from static and direct.
In doing Source Based Routing I'm using S_FWD and I need to set a default route where next-hop belongs to R_VRF remote end and learned via bgp.
Here is a simple configuration which might work for creating rib consisting of direct interfaces but not sure whether it will work when I want to specify a next-hop in S_FWD which is one of the bgp imported route under R_VRF.
Please find the topology attached.
root@JUNOS> show configuration routing-instances S_FWD
instance-type forwarding;
routing-options {
static {
route 0.0.0.0/0 next-hop 1.1.0.1;
}
}
root@JUNOS>
root@JUNOS> show configuration routing-instances R_VRF
instance-type vrf;
interface em0.0;
interface em1.0;
interface lo0.0;
route-distinguisher 65000:91;
vrf-import R_VRF-import;
vrf-export R_VRF-export;
routing-options {
interface-routes {
rib-group inet r2s-rib;
}
static {
route 0.0.0.0/0 next-hop 2.2.0.1;
}
}
forwarding-options {
family inet {
filter {
input r2s-filter;
}
}
}
root@JUNOS> show configuration routing-options
rib-groups {
mixed-rib {
import-rib [ R_VRF.inet.0 S_FWD.inet.0 ];
}
}
forwarding-table {
export pplb;
}
root@JUNOS> show configuration policy-options
policy-statement R_VRF-export {
from protocol [ static direct ];
then {
community add R_VRF;
accept;
}
}
policy-statement R_VRF-import {
from {
protocol bgp;
community R_VRF;
}
then accept;
}
policy-statement pplb {
then {
load-balance per-packet;
}
}
community R_VRF members target:65000:91;
root@JUNOS>
root@JUNOS> show configuration firewall
filter r2s-filter {
term A {
from {
source-address {
3.3.0.0/24;
}
}
then {
count entering_fbf;
routing-instance S_FWD;
}
}
term B {
then {
count entering_vrf;
accept;
}
}
}