SOURCECODEBD.NET

Live Experience

Juniper Create Routing Policy with Filtering Long Prefixes
 
If you want to install IP address prefixes longer than 172.18.20.0/19 in the routing table.
Create a filter that identifies the long prefixes:
[edit policy-options policy-statement prefixes-to-exclude term 1]
# set from route-filter 172.18.20.0/19 longer 
# set then accept
 
[If you want to match prefixes from /19 to /30 that is "orlonger"]
[edit policy-options policy-statement prefixes-to-exclude term 1]
# set from route-filter 172.18.20.0/19 orlonger
# set then accept
 
[If you want to match prefixes from /19 to /24. This is "upto"]
[edit policy-options policy-statement prefixes-to-exclude term 1]
# set route-filter 172.18.20.0/19 upto /24
# set then accept 
[The above command matches prefixes 172.18.20.0/19, 172.18.20.0/18, and so on, up to 172.18.20.0/24.]
 
 
The final keyword is "prefix-length-range":
[edit policy-options policy-statement prefixes-to-exclude term 1]
# set route-filter 0.0.0.0/0 prefix-length-range /25-/30
# set then accept
[The above command matches IP prefixes in the range 0.0.0.0/25, 0.0.0.0/26, 0.0.0.0/27, 0.0.0.0/28, 0.0.0.0/29, and 0.0.0.0/30 only.
Route lists can also match exactly one prefix, just as prefix lists can]
 
If you want to match prefixe exactly what you want, "exact"
[edit policy-options policy-statement long-prefixes  term 1 ]
# set route-filter 172.18.20.0/24 exact 
# set then accept
[The above command matches exactly the prefix 172.18.20.0/24]
 
When you create a policy you must apply it to your configured protocol. Because you create a policy and you must call this policy. Like:
# set protocols bgp group external-group import "PolicyName"

 

You are here: Home / Firewall & Policy / Filtering Long Prefixes