Configure a Simple Routing Policy
Purpose
Routing policy allows you to control the information shared with BGP neighbors and provides the opportunity to filter and modify the information you receive. Typically, a network is injected into BGP using a policy. This may also be done through a static route. In the network in BGP Network Topology, a static route export policy is used to inject routes into BGP.
Action
To configure a simple routing policy, follow these steps:
In configuration mode, go to the following hierarchy level:
content_copy zoom_out_map[edit]user@host# edit routing-optionsConfigure a static route for redistribution to other autonomous systems:
content_copy zoom_out_map[edit routing-options]user@host# set static route destination/24 rejectConfigure a routing policy that matches and accepts the configured static routes into BGP updates:
content_copy zoom_out_map[edit]user@host# edit policy-options[edit policy-options]user@host# set policy-statement policy-name term term-name from route-filter address exactuser@host# set policy-statement policy-nameterm term-name then acceptApply the policy created in Step 3 to all BGP neighbors:
content_copy zoom_out_map[edit]user@host# edit protocols bgp[edit protocols bgp]user@host# set export policy-nameVerify and commit the configuration:
content_copy zoom_out_mapuser@host# showcontent_copy zoom_out_mapuser@host# commit
Sample Output
user@R1> edit Entering configuration mode [edit] user@R1# edit routing-options [edit routing-options] user@R1# set static route 100.100.1.0/24 reject [edit routing-options] user@R1# show [...Output truncated...] route 100.100.1.0/24 reject; } router-id 10.0.0.1; autonomous-system 65432; [edit routing-options] user@R1# top [edit] user@R1# edit policy-options [edit policy-options] user@R1# set policy-statement send-statics term statics from route-filter 100.100.1.0/24 exact [edit policy-options] user@R1# set policy-statement send-statics term statics then accept [edit policy-options] user@R1# top [edit] user@R1# edit protocols bgp [edit protocols bgp] user@R1# set export send-statics [edit protocols bgp] user@R1# show export send-statics; group internal { type internal; local-address 10.0.0.1; neighbor 10.0.0.2; neighbor 10.0.0.3; neighbor 10.0.0.5; neighbor 10.0.0.4; neighbor 10.0.0.6; } [edit protocols bgp] user@R1# commit commit complete
Meaning
The sample output shows that routing policy send-statics is configured on the router. The routing policy matches and accepts the configured static routes into the routing table and injects the routes into BGP updates. Typically, a routing policy is applied at the group level, although it can be applied at the global level, as shown in this example.