Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[ARCHIVE] QoS rewrite on EX-series switches for switched and routed packets



Article ID: KB13381 KB Last Updated: 24 Aug 2017Version: 3.0
There are differences in the way QoS rewrite takes place between EX-series switches running JUNOS 9.4 and prior versions. This document explains the differences, and provides an example for rewrite of switched frames using code prior to JUNOS 9.4; since the documentation only describes the procedure for rewriting routed packets.
How do I rewrite QoS values (CoS, DSCP or IP-prec) on an EX?
On an EX-series switch using JUNOS prior to version 9.4, a rewrite rule is applied only for routed packets be default. To apply the rewrite for switched frames, we need to apply a firewall filter on the egress VLAN or interface so that the rewrite rule may be applied. However in JUNOS 9.4 and after, rewrite-rules defined under class-of-service stanza apply to both routed and switched packets.

This document assumes that only QoS re-write is taking place on the EX, and there is no classification, queuing, or scheduling taking place.  Such a configuration was purposely omitted from this KB for simplicity and to focus on a working rewrite example. Please consult the EX JUNOS documentation for information on configuring QoS.

Example: Rewriting switched frames with DSCP 46 (EF) to IEEE CoS 6.

The frames are switched from ge-0/0/1 to ge-0/0/0. Using JUNOS  9.3R2.8 on EX, a traffic generator is used to pump IP packets with DSCP 46 in interface ge-0/0/1. Interface ge-0/0/0 can be connected to a PC which can receive tagged frames where a sniffer can show the incoming frames to verify if the remarking or rewriting took place.

EX configuration:

root# show class-of-service
forwarding-classes {
    class voice queue-num 5;
rewrite-rules {
     ieee-802.1 voice {
         forwarding-class voice {
             loss-priority low code-point 110;

root# show firewall
family ethernet-switching {
     filter rewrite-filter {
         term voice {
             from {
                 dscp ef; # any condition could be specified here
             then {
                 forwarding-class voice;
                 loss-priority low;
                 count voice-hits;

root# show interfaces ge-0/0/0
unit 0 {
    family ethernet-switching {
        port-mode trunk;
        vlan {
            members 1;
        filter {
            output rewrite-filter;

Note: The above filter could also be applied to VLAN 1 egress instead.

As seen above, the forwarding class (FC) needs to be defined else the configuration will not commit. The FC however is just a dummy mapped to queue 5 in this case, and it is not actually used since there is no classifier configuration.
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search