Troubleshooting an Unexpected Rewrite Value
Problem
Description
Traffic from one or more forwarding classes on an egress port is assigned an unexpected rewrite value.
For packets that carry both an inner VLAN tag and an outer VLAN tag, the rewrite rules rewrite only the outer VLAN tag.
Cause
If you configure a rewrite rule for a forwarding class on an egress port, but you do not configure a rewrite rule for every forwarding class on that egress port, then the forwarding classes that do not have a configured rewrite rule are assigned random rewrite values.
For example:
Configure forwarding classes
fc1
,fc2
, andfc3
.Configure rewrite rules for forwarding classes
fc1
andfc2
, but not for forwarding classfc3
.Assign forwarding classes
fc1
,fc2
, andfc3
to a port.
When traffic for these forwarding classes flows through the port, traffic for forwarding classes fc1
and fc2
is rewritten correctly. However, traffic for forwarding class fc3
is assigned a random rewrite value.
Solution
If any forwarding class on an egress port has a configured rewrite rule, then all forwarding classes on that egress port must have a configured rewrite rule. Configuring a rewrite rule for any forwarding class that is assigned a random rewrite value solves the problem.
If you want the forwarding class to use the same code point value assigned to it by the ingress classifier, specify that value as the rewrite rule value. For example, if a forwarding class has the IEEE 802.1 ingress classifier code point value 011
, configure a rewrite rule for that forwarding class that uses the IEEE 802.1p code point value 011
.
There are no default rewrite rules. You can bind one rewrite rule for DSCP traffic and one rewrite rule for IEEE 802.1p traffic to an interface. A rewrite rule can contain multiple forwarding-class-to-rewrite-value mappings.
To assign a rewrite value to a forwarding class, add the new rewrite value to the same rewrite rule as the other forwarding classes on the port:
[edit class-of-service rewrite-rules] user@switch# set (dscp | ieee-802.1) rewrite-name forwarding-class class-name loss-priority priority code-point (alias | bits)
For example, if the other forwarding classes on the port use rewrite values defined in the rewrite rule
custom-rw
, the forwarding classbe2
is being randomly rewritten, and you want to use IEEE 802.1 code point002
for thebe2
forwarding class:[edit class-of-service rewrite-rules] user@switch# set ieee-802.1 custom-rw forwarding-class be2 loss-priority low code-point 002
Enable the rewrite rule on an interface if it is not already enabled on the desired interface:
[edit] user@switch# set class-of-service interfaces interface-name unit unit rewrite-rules (dscp | ieee-802.1) rewrite-rule-name
For example, to enable the rewrite rule
custom-rw
on interfacexe-0/0/24.0
:[edit] user@switch# set class-of-service interfaces xe-0/0/24 unit 0 rewrite-rules ieee-802.1 custom-rw