Related Documentation
- J Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- M Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- PTX Series
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- SRX Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- T Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
Example: Grouping Source and Destination Prefixes into a Forwarding Class
This example shows how to group source and destination prefixes into a forwarding class.
Requirements
Before you begin, configure router interfaces and configure routing protocols, as explained in Routing Policies Configuration Overview.
Overview
In this example, you configure a routing policy called policy1and a corresponding routing term called term1. Within the term, you configure the route filter to include source routes greater than or equal to 10.210.0.0/16 and destination routes greater than or equal to 10.215.0.0/16. Then you group the source and destination prefixes into a forwarding class called forwarding-class1 and apply policy1 to the forwarding table. The routing policy is evaluated when routes are being exported from the routing table into the forwarding table. Only the active routes are exported from the routing table.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Step-by-Step Procedure
The following example requires you to navigate various
levels in the configuration hierarchy. For instructions on how to
do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide
.
To group source and destination prefixes in a forwarding class:
Create the routing policy.
[edit]user@host# edit policy-options policy-statement policy1Create the routing term.
[edit policy-options policy-statement policy1]user@host# edit term term1Specify the source routes to include in the route filter.
[edit policy-options policy-statement policy1 term term1]user@host# set from route-filter 10.210.0.0/16 orlongerSpecify the destination routes to include in the route filter.
[edit policy-options policy-statement policy1 term term1]user@host# set from route-filter 10.215.0.0/16 orlongerGroup the source and destination prefixes into the forwarding class.
[edit policy-options policy-statement policy1 term term1]user@host# set then forwarding-class forwarding-class1Apply the routing policy to the forwarding table.
[edit]user@host# set routing-options forwarding-table export policy1
Note: You can refer to the same routing policy one or more times in the same or different export statement.
Results
Confirm your configuration by entering the show policy-options and show routing-options commands from configuration mode. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.
If you are done configuring the device, enter commit from configuration mode.
Verification
To confirm that the configuration is working properly, perform these tasks:
Verifying the Forwarding Class
Purpose
Verify that the forwarding table is applied to the routing policy.
Action
From operational mode, enter the show routing-options command.
Verifying the Routing Policy
Purpose
Verify that the policy and term are configured on the device with the appropriate routes included in the forwarding class.
Action
From operational mode, enter the show policy-options command.
Related Documentation
- J Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- M Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- PTX Series
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- SRX Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes
- T Series
- Routing Policies Configuration Overview
- Route-Based Match Conditions
- Example: Rejecting Known Invalid Routes