Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
{ "lCode": "en_US", "lName": "English", "folder": "en_US" }
English
 

Configure a Simple Routing Policy

date_range 11-Mar-19

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:

  1. In configuration mode, go to the following hierarchy level:

    content_copy zoom_out_map
    [edit]
    user@host# edit routing-options
  2. Configure a static route for redistribution to other autonomous systems:

    content_copy zoom_out_map
    [edit routing-options]
    user@host# set static route destination/24 reject
  3. Configure 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 exact
    user@host# set policy-statement policy-nameterm term-name then accept
  4. Apply 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-name
  5. Verify and commit the configuration:

    content_copy zoom_out_map
    user@host# show
    content_copy zoom_out_map
    user@host# commit

Sample Output

content_copy zoom_out_map
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.

footer-navigation