Configuring Rewrite Rules
You define markers in the rewrite rules section of the CoS configuration hierarchy and reference them in the logical interface configuration. This model supports marking on the DSCP, DSCP IPv6, IP precedence, IPv6 precedence, IEEE 802.1, and MPLS EXP CoS values.
To configure a rewrite-rules mapping and associate it with the appropriate forwarding
class and code-point alias or bit set, include the rewrite-rules
statement at the [edit class-of-service] hierarchy level:
[edit class-of-service] rewrite-rules { (dscp | dscp-ipv6 | exp | ieee-802.1 |ieee-802.1ad | inet-precedence | inet6-precedence) rewrite-name { import (rewrite-name | default); forwarding-class class-name { loss-priority level code-point (alias | bits); } } }
The rewrite rule sets the code-point aliases and bit patterns for a specific forwarding class and packet loss priority (PLP). The inputs for the map are the forwarding class and the PLP. The output of the map is the code-point alias or bit pattern. For more information about how CoS maps work, see Mapping CoS Component Inputs to Outputs.
By default, IP precedence rewrite rules alter the first three bits on the type-of-service
(ToS) byte while leaving the last three bits unchanged. This default behavior is not
configurable. The default behavior applies to rules you configure by including the
inet-precedence statement at the [edit class-of-service
rewrite-rules] hierarchy level. The default behavior also applies to
rewrite rules you configure for MPLS packets with IPv4 payloads. You configure these
types of rewrite rules by including the mpls-inet-both or
mpls-inet-both-non-vpn option at the [edit class-of-service
interfaces interface-name unit
logical-unit-number rewrite-rules exp
rewrite-rule-name protocol] hierarchy level.
The IRB classifiers and rewrite rules are used only for routed packets; in other words, it is for traffic that originated in the Layer 2 domain and is then routed through IRB into the Layer 3 domain, or vice versa. Only IEEE classifiers and IEEE rewrite rules are allowed for pure Layer 2 interfaces within a bridge domain.
The forwarding class and loss priority are determined by ingress classification.
Platform-Specific Rewrite Rules Behavior
Use the following table to review platform-specific behaviors for your platforms.
|
Platform |
Difference |
|---|---|
|
EX Series |
|
|
MX Series |
|
|
PTX Series |
|