DSCP rewrite-rule policy configuration for output traffic

When a DSCP rewrite-rule policy is applied to a subinterface, the policy attempts to match the forwarding class (and optionally the drop-probability) of outbound packets to one of its entries. If there is a match, the DSCP value of the outbound packet is changed to the value specified by the policy. If the forwarding class of the packet does not match a rule of the rewrite-rule policy, the DSCP value is changed to 0.

On 7220 IXR-D2, D3, and D5 or 7220 IXR-H2 and H3 systems, if no DSCP rewrite-rule policy is applied to a subinterface, the incoming packet's DSCP remains unchanged at egress.

Configuring DSCP rewrite-rule policies

The following example creates a rewrite-rule policy:

--{ candidate shared default }--[  ]--
# info qos rewrite-rules
 qos {
        rewrite-rules {
            dscp-policy normalize {
                map fc0 {
                    dscp 1
                map fc0 {
                    dscp 7
                map fc1 {
                    dscp 10
                    drop-probability low {
                        dscp 11
                    }
                    drop-probability high {
                        dscp 13
                map fc2 {
                    dscp 23
                map fc3 {
                    dscp 31
                }
            }
        }
    }

Rewrite-rule policy application to subinterfaces

When a rewrite-rule policy is applied to output traffic on a subinterface, outbound packets are evaluated against the policy. The policy subjects all packets to remarking, with some exceptions. If no rewrite-rule policy is applied to the subinterface, the DSCP marking of the traffic leaving the subinterface is unchanged, unless it is ECN-capable traffic forwarded by a 7250 IXR system or VXLAN traffic originated by a 7220 IXR-D2, D3, and D5 or 7220 IXR-H2 and H3 system. For these exceptions, DSCP may be remarked even in the absence of a rewrite-rule policy applied to the egress subinterface.

On all platforms, rewrite-rule policies do not affect DSCP marking of self-generated traffic.

Applying a rewrite-rule policy to output traffic (7250 IXR)

The following example applies a rewrite-rule policy to outbound IPv4 traffic on a subinterface with a 7250 IXR system:

Note: 7250 IXR systems support separate rewrite policies for IPv4 and IPv6 egress traffic.
--{ candidate shared default }--[  ]--
# info interface ethernet-1/1
    interface ethernet-1/1 {
        subinterface 1 {
            qos {
                output {
                    rewrite-rules {
                        ipv4-dscp new-rule
                    }
                }
            }
        }
    }

Applying a rewrite-rule policy to output traffic (7220 IXR)

The following example applies a rewrite-rule policy to outbound traffic on a subinterface with a 7220 IXR-D2, D3, and D5 or 7220 IXR-H2 and H3 system:

Note: Common rewrite policies that apply to both IPv4 and IPv6 traffic are supported on 7220 IXR-D2, D3, and D5 or 7220 IXR-H2 and H3 systems.
--{ candidate shared default }--[  ]--
# info interface ethernet-1/1
    interface ethernet-1/1 {
        subinterface 1 {
            qos {
                output {
                    rewrite-rules {
                        dscp new-rule
                    }
                }
            }
        }
    }