Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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 Aliases for CoS Value Bit Patterns Overview, 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 Aliases for CoS Value Bit Patterns Overview.

Table 1: Default Packet Header Rewrite Mappings

Map from Forwarding Class

Loss Priority

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

Starting with Junos OS Release 21.1, PTX routers support two forwarding classes and four loss priorities for MPLS EXP default rewrite rules, as Table 2 shows.

Table 2: Default MPLS EXP Rewrite Mapping for PTX Routers

Map from Forwarding Class

Loss Priority

Map to MPLS EXP Bits

best-effort

low

000

best-effort

high

001

best-effort

medium-low

010

best-effort

medium-high

011

network-control

medium-low

100

network-control

medium-high

101

network-control

low

110

network-control

high

111

In the following example, the so-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 Aliases for CoS Value Bit Patterns Overview 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 Aliases for CoS Value Bit Patterns Overview shows that this code-point alias maps to the 000 bits.

To evaluate all the implications of this example, see Default Aliases for CoS Value Bit Patterns Overview and Table 1.