Applying Default Rewrite Rules
By default, rewrite rules are not usually applied to interfaces. If you want to apply a rewrite rule, you can either design your own rule and apply it to an interface, or you can apply a default rewrite rule.
![]() | Note: The lone exception is that non-MPC MPLS-enabled interfaces use the default EXP rewrite rule, even if not configured. |
To apply default rewrite rules, include one or more of the following statements at the [edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules] hierarchy level:
Table 1 shows the default rewrite rule mappings. These are based on the default bit definitions of DSCP, DSCP IPv6, EXP, IEEE, and IP CoS values, as shown in Default CoS Values, and the default forwarding classes shown in Default Forwarding Classes.
When the software detects packets whose CoS values match the forwarding class and PLP values in the first two columns in Table 1, the software maps the header bits of those packets to the code-point aliases in the last column in Table 1. The code-point aliases in the last column map to the CoS bits shown in Default CoS Values.
Table 1: Default Packet Header Rewrite Mappings
Map from Forwarding Class | PLP Value | Map to DSCP/DSCP IPv6/ EXP/IEEE/IP |
---|---|---|
expedited-forwarding | low | ef |
expedited-forwarding | high | ef |
assured-forwarding | low | af11 |
assured-forwarding | high | af12 (DSCP/DSCP IPv6/EXP) |
best-effort | low | be |
best-effort | high | be |
network-control | low | nc1/cs6 |
network-control | high | nc2/cs7 |
In the following example, the ge-1/2/3.0 interface is assigned the default DSCP rewrite rule. One result of this configuration is that each packet exiting the interface with the expedited-forwarding forwarding class and the high or low loss priority has its DSCP bits rewritten to the DSCP ef code-point alias. Default CoS Values shows that this code-point alias maps to the 101110 bits.
Another result of this configuration is that all packets exiting the interface with the best-effort forwarding class and the high or low loss priority have their EXP bits rewritten to the EXP be code-point alias.Default CoS Values shows that this code-point alias maps to the 000 bits.
To evaluate all the implications of this example, see Default CoS Values and Table 1.