Related Documentation
- J Series
- Forwarding Classes Overview
- Example: Assigning a Forwarding Class to an Interface
- Example: Configuring Forwarding Classes
- SRX Series
- Forwarding Classes Overview
- Example: Assigning a Forwarding Class to an Interface
- Example: Configuring Forwarding Classes
- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices

Example: Assigning Forwarding Classes to Output Queues
This example shows how to assign forwarding classes to output queues.
Requirements
Before you begin, determine the MF classifier. See Example: Configuring and Applying a Firewall Filter for a Multifield Classifier.
Overview
In this example, you configure class of service and assign best-effort traffic to queue 0 as be-class, expedited forwarding traffic to queue 1 as ef-class, assured forwarding traffic to queue 2 as af-class, and network control traffic to queue 3 as nc-class.
You must assign the forwarding classes established by the MF classifier to output queues. Table 1 shows how this example assigns output queues.
Table 1: Sample Output Queue Assignments for mf-classifier Forwarding Queues
mf-classifier Forwarding Class | For Traffic Type | Output Queue |
|---|---|---|
be-class | Best-effort traffic | Queue 0 |
ef-class | Expedited forwarding traffic | Queue 1 |
af-class | Assured forwarding traffic | Queue 2 |
nc-class | Network control traffic | Queue 3 |
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 assign forwarding classes to output queues:
- Configure class of service.[edit]user@host# edit class-of-service forwarding-classes
- Assign best-effort traffic to queue 0.[edit class-of-service forwarding-classes]user@host# set queue 0 be-class
- Assign expedited forwarding traffic to queue 1.[edit class-of-service forwarding-classes]user@host# set queue 1 ef-class
- Assign assured forwarding traffic to queue 2.[edit class-of-service forwarding-classes]user@host# set queue 2 af-class
- Assign network control traffic to queue 3.[edit class-of-service forwarding-classes]user@host# set queue 3 nc-class
Results
From configuration mode, confirm your configuration by entering the show class-of-service command. 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.
![]() | Note: You cannot commit a configuration that assigns the same forwarding class to two different queues. |
Verification
Confirm that the configuration is working properly.
Verifying Forwarding Classes Are Assigned to Output Queues
Purpose
Verify that the forwarding classes are properly assigned to output queues.
Action
From configuration mode, enter the show class-of-service command.
Related Documentation
- J Series
- Forwarding Classes Overview
- Example: Assigning a Forwarding Class to an Interface
- Example: Configuring Forwarding Classes
- SRX Series
- Forwarding Classes Overview
- Example: Assigning a Forwarding Class to an Interface
- Example: Configuring Forwarding Classes
- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices



