[Contents] [Prev] [Next] [Index] [Report an Error]


3. 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 Figure 4, 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:
  2. [edit]
    
    user@host# edit routing-options
    
    
    
  3. Configure a static route for redistribution to other autonomous systems:
  4. [edit routing-options]
    
    user@host# set static route destination/24 reject
    
    
    
  5. Configure a routing policy that matches and accepts the configured static routes into BGP updates:
  6. [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-name term term-name then accept
    
    
    
  7. Apply the policy created in Step 3 to all BGP neighbors:
  8. [edit]
    
    user@host# edit protocols bgp
    
    
    
    [edit protocols bgp]
    
    user@host# set export policy-name
    
    
    
  9. Verify and commit the configuration:
  10. user@host# show
    
    user@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

What It Means

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.


[Contents] [Prev] [Next] [Index] [Report an Error]