Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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.

    set policy-options policy-statement policy1 term term1 from route-filter 10.210.0.0/16 orlonger set policy-options policy-statement policy1 term term1 from route-filter 10.215.0.0/16 orlonger set policy-options policy-statement policy1 term term1 then forwarding-class forwarding-class1set routing-options forwarding-table export policy1

    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 PDF Document.

    To group source and destination prefixes in a forwarding class:

    1. Create the routing policy.

      [edit]user@host# edit policy-options policy-statement policy1
    2. Create the routing term.

      [edit policy-options policy-statement policy1]user@host# edit term term1
    3. Specify 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 orlonger
    4. Specify 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 orlonger
    5. Group the source and destination prefixes into the forwarding class.

      [edit policy-options policy-statement policy1 term term1]user@host# set then forwarding-class forwarding-class1
    6. Apply 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.

    user@host# show policy-optionspolicy-statement policy1 {term term1 {from {route-filter 10.210.0.0/16 orlonger;route-filter 10.215.0.0/16 orlonger;}then forwarding-class forwarding-class1;}}
    user@host# show routing-optionsforwarding-table {export policy1;}

    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.

    Published: 2012-06-29