SOURCECODEBD.NET

Live Experience

Juniper Creating Policy with Term
 
Here I create three terms on a single policy-statement. Policy Statement Name is "Upstream". First term name ISP-1, Second term ISP-2, Third term name is ISP-3 and Finally I make term that is Reject. That mean only those prefixes will advertise and all other are reject.
 
# set policy-options policy-statement Upstream term ISP-1 from route-filter 172.16.0.0/24 exact
# set policy-options policy-statement Upstream term ISP-1 then accept
# set policy-options policy-statement Upstream term ISP-2 from route-filter 192.168.0.0/21 upto /24
# set policy-options policy-statement Upstream term ISP-2 then accept
# set policy-options policy-statement Upstream term ISP-3 from route-filter 10.10.0.0/22 upto /24
# set policy-options policy-statement Upstream term ISP-3 then as-path-prepend "65543 65543"
# set policy-options policy-statement Upstream term ISP-3 then accept
# set policy-options policy-statement Upstream term Reject then reject
[ISP-3 policy I put "as-path-prepend" that you can learn brefly from BGP section.]
 
Here the policy look like:
# show policy-options policy-statement Upstream
term ISP-1 {
    from {
        route-filter 172.16.0.0/24 exact;
    }
    then accept;
term ISP-2 {
    from {
        route-filter 192.168.0.0/21 upto /24;
    }
    then accept;
term ISP-3 {
    from {
        route-filter 10.10.0.0/22 upto /24;
    }
    then {
        as-path-prepend "65543 65543";
        accept;
    }
}
term Reject {
    then reject;
 
 
You are here: Home / Firewall & Policy / Juniper Creating Policy with Term