Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Class of Service User Guide for Routers
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Apply MPLS EXP Classifiers to Routing Instances

date_range 09-Apr-25

This topic shows how to apply MPLS EXP classifiers to routing instances.

When you enable VRF table labels and you do not explicitly apply a classifier configuration to the routing instance, Junos applies the default MPLS EXP classifier to the routing instance. For detailed information about VRF table labels, see the Junos OS VPNs Library for Routing Devices.

Table 1 show the default MPLS EXP classification table.

Table 1: Default MPLS EXP Classifier

MPLS EXP Bits

Forwarding Class

Loss Priority

000

best-effort

low

001

best-effort

high

010

expedited-forwarding

low

011

expedited-forwarding

high

100

assured-forwarding

low

101

assured-forwarding

high

110

network-control

low

111

network-control

high

Note:

At times, you might need to maintain the original classifier—for example with bridge domains, where you neither want to configure a custom classifier for the routing instance nor accept the default classifier. You can maintain the original MPLS EXP classifier. To do so, apply the no-default option for the routing instance. For example:

content_copy zoom_out_map
[edit class-of-service]
routing-instances routing-instance-name {
    classifiers {
        no-default;
    }
}

Configure and Apply Custom MPLS EXP Classifiers to Routing Instances

For routing instances with VRF table labels enabled, you can override the default MPLS EXP classifier and apply a custom classifier to a routing instance.

The following procedure requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To apply a custom classifier to a routing instance:

  1. Filter traffic based on the IP header.
    content_copy zoom_out_map
    [edit]
    user@host# edit routing-instances routing-instance-name
    user@host# set vrf-table-label
    
  2. Configure the custom MPLS EXP classifier.
    content_copy zoom_out_map
    [edit]
    user@host# edit class-of-service
    user@host# set classifiers exp classifier-name import classifier-name forwarding-class class-name loss-priority level code-points (aliases | bit-patterns)
    user@host# set forwarding-classes queue queue-number class-name priority (high | low)
    
  3. Apply the custom MPLS EXP classifier to the routing instance.
    content_copy zoom_out_map
    [edit class-of-service routing-instances routing-instance-name classifiers]
    user@host# set exp classifier-name;
    
  4. Commit and confirm your configuration.
    content_copy zoom_out_map
    [edit]
    user@host# show class-of-service routing-instances
    

Apply Global Classifiers and Wildcard Routing Instances

To apply a classifier to all routing instances:

  • Specify that the MPLS EXP classifier is for all routing instances.

    content_copy zoom_out_map
    [edit class-of-service ]
    user@host# set routing-instances all classifiers exp classifier-name
    

For routing instances you associate with specific classifiers, Junos ignores the global configuration.

To use a wildcard to apply a classifier to all routing instances:

  • Include an asterisk (*) in the name of the routing instance.

    content_copy zoom_out_map
    [edit]]
    user@host# edit class-of-service routing-instances routing-instance-name*
    user@host# set classifiers exp classifier-name
    

The wildcard configuration follows the longest match. If you include a specific configuration, it has precedence over the wildcard configuration.

Note:

Junos supports the wildcard * and the all keyword at the [edit class-of-service routing-instances] hierarchy level but not at the [edit routing-instances] hierarchy level.

If you configure a routing instance at the [edit routing-instances] hierarchy level with, for example, the name vpn*, Junos treats vpn* as a valid and distinct routing instance name. If you then try to apply a classifier to the vpn* routing instance at the [edit class-of-service routing-instances] hierarchy level, Junos treats the vpn* routing instance name as a wildcard. Thus all routing instances that start with vpn and do not have a specific classifier applied receive the classifier associated with vpn*.

This same behavior applies with the all keyword.

Note that the * wildcard must be appended to an instance name at these configuration levels. The * wildcard is not a stand-alone substitute for the all keyword.

Apply Global MPLS EXP Classifiers to Routing Instances

This example shows how to apply a global classifier to all routing instances and then override the global classifier for a specific routing instance. For this example, we have three routing instances: vpn1, vpn2, and vpn3, each with VRF table label enabled. The classifier exp-classifier-global is applied to vpn1 and vpn2 (that is, all but vpn3, which is listed separately). The classifier exp-classifier-3 is applied to vpn3.

The following procedure requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure a global classifier for all routing instances and override the global classifier for a specific routing instance:

  1. Enable the VRF table label for all three routing instances.
    content_copy zoom_out_map
    [edit routing-instances]
    user@host#  set vpn1 vrf-table-label
    user@host#  set vpn2 vrf-table-label
    user@host#  set vpn3 vrf-table-label
    
  2. Apply the EXP classifier exp-classifier-global to all routing instances.
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# set all classifiers exp exp-classifier-global
    
  3. Apply the EXP classifier exp-classifier-3 to only the routing-instance vpn3.
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# set vpn3 classifiers exp exp-classifier-3
    
  4. Confirm your configuration.
    content_copy zoom_out_map
    [edit routing-instances]
    user@host# show
    
    content_copy zoom_out_map
    vpn1 {
        vrf-table-label;
    }
    vpn2 {
        vrf-table-label;
    }
    vpn3 {
        vrf-table-label;
    }
    
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# show
    
    content_copy zoom_out_map
    all {
        classifiers {
            exp exp-classifier-global;
        }
    }
    vpn3 {
        classifiers {
            exp exp-classifier-3;
        }
    }

Apply Classifiers by Using Wildcard Routing Instances

Configure a wildcard routing instance and override the wildcard with a specific routing instance. For this example, we have three routing instances: vpn-red, vpn-yellow, and vpn-green, each with VRF table label enabled. The classifier exp-class-wildcard is applied to vpn-yellow and vpn-green. The classifier exp-class-red is applied to vpn-red.

The following procedure requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure a wildcard routing instance and override the wildcard with a specific routing instance:

  1. Enable the VRF table label for all three routing instances.
    content_copy zoom_out_map
    [edit routing-instances]
    user@host#  set vpn-red vrf-table-label
    user@host#  set vpn-yellow vrf-table-label
    user@host#  set vpn-green vrf-table-label
    
  2. Apply the EXP classifier exp-class-wildcard to all routing instances by using a wildcard.
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# set vpn* classifiers exp exp-class-wildcard
    
  3. Apply the EXP classifier exp-class-red to only the routing-instance vpn-red.
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# set vpn-red classifiers exp exp-class-red
    
  4. Commit and confirm your configuration.
    content_copy zoom_out_map
    [edit routing-instances]
    user@host# show
    
    content_copy zoom_out_map
    vpn-red {
        vrf-table-label;
    }
    vpn-yellow {
        vrf-table-label;
    }
    vpn-green {
        vrf-table-label;
    }
    
    content_copy zoom_out_map
    [edit class-of-service routing-instances]
    user@host# show
    
    content_copy zoom_out_map
    vpn* {
        classifiers {
            exp exp-class-wildcard;
        }
    }
    vpn-red {
        classifiers {
            exp exp-class-red;
        }
    }

Verify the Classifiers Associated with Routing Instances

Purpose

Display the MPLS EXP classifiers associated with two routing instances:

Action

To verify the MPLS EXP classifiers associated with two routing instances, enter the following Junos CLI operational mode command:

content_copy zoom_out_map
user@host> show class-of-service routing-instances
  Routing Instance : vpn1
    Object            Name                   Type                    Index
    Classifier        exp-default            exp                         8
 
  Routing Instance : vpn2
    Object            Name                   Type                    Index
    Classifier        class2                 exp                     57507

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
16.1
Starting with Junos OS Release 16.1, on MX Series devices only, you can maintain the original MPLS EXP classifier.
footer-navigation