Routing policy is the generic term for all the mechanisms under policy-options in JUNOS.
Policy Based Routing is usually and more accurately known within Juniper as Filter Based Forwarding.
Routing policy is the generic term for all the mechanisms under policy-options in JUNOS. These Routing Policy allows you to modify the routes that are advertised to or accepted from a neighbor while using any of the supported routing protocols. This is usually applied using the import / export statements in each of the protocols. It affects control plane, route updates, advertisements etc.
Configuration Sample:
root# show interfaces ge-0/1/0
unit 6 {
family inet {
address 1.1.1.6/30;
}
}
root# show protocols
bgp {
group internal-peers {
type internal;
local-address 12.18.0.4;
export send-direct;
neighbor 12.13.6.4;
}
}
root# show policy-options
policy-statement send-direct {
term 2 {
from protocol direct;
then accept;
}
}
Policy Based Routing (PBR) is Filter Based Forwarding(FBF). It is an approach where you override some of the fundamental rules of destination based routing and forward packets based on other characteristics of the incoming packets. This is achieved by writing firewall filters that match the relevant characteristics of the incoming packet (src ip, dst ip, src port, dst port, protocol, packet size, etc) and modify the next-hop based on that match. The packet is then forwarded to that next-hop rather than using the next-hop associated with the destination ip address alone. It affects the data plane L3 forwarding function.Note: When searching the Technical Documentation for Policy Based Routing (PBR) configuration, search for: filter-based forwarding.
Configuration sample:
firewall {
filter filter1 {
term t1 {
from {
source-address {
10.1.1.3/32;
}
}
then {
next-interface {
xe-0/1/0.1;
routing-instance rins1;
}
}
}
term t2 {
from {
source-address {
10.1.1.4/32;
}
}
then {
next-interface {
xe-0/1/0.2;
routing-instance rins2;
}
}
}
}
}
routing-instances {
rins1 {
instance-type virtual-router;
interface xe-0/1/0.1;
}
rins2 {
instance-type virtual-router;
interface xe-0/1/0.2;
}
}
2020-08-19: Added configuration sample for Routing Policy and Policy Based Routing. Removed EOS platforms.