Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

exp (Rewrite rules)

date_range 11-Mar-25

Syntax

content_copy zoom_out_map
exp (rewrite-name | default) protocol protocol-types;

Hierarchy Level

content_copy zoom_out_map
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules]

Description

Apply an MPLS experimental (EXP) rewrite rule.

On segment routing LSPs, applying an EXP rewrite rule to the egress interface on the ingress (provider edge) router of a segment-routing network imposes the rewrite rule to all transport labels in the stack. As a result, you don't need to configure rewrite rules on every segment in the LSP.

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 applies to rewrite rules you configure for MPLS packets with IPv4 payloads on provider edge (PE) routers only. On transit routers (P), we do not alter the inner IPv4 headers and payloads while setting EXP bits in the outer MPLS header.

Options

rewrite-name

Name of a rewrite-rules mapping configured at the [edit class-of-service rewrite-rules exp] hierarchy level.

default

The default mapping.

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 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 interface-name unit logical-unit-number rewrite-rules exp rewrite-rule-name protocol] hierarchy level. The IP precedence rewrite rules explanation does not apply to ACX Series Universal Metro routers.

On interfaces configured on Modular Port Concentrators (MPCs) and Modular Interface Cards (MICs) on MX Series 5G Universal Routing Platforms and EX Series switches, we highly recommend that you configure the default option when you configure a behavior aggregate (BA) classifier that does not include a specific rewrite rule for MPLS packets. Doing so ensures that MPLS exp value is rewritten according to the BA classifier rules configured for forwarding or packet loss priority. This does not apply to ACX Series Universal Metro routers.

protocol-types

Specify one or more protocol matching criteria:

  • mpls-any—Applies the rewrite rule to MPLS packets and writes the CoS value to MPLS headers.

  • mpls-inet-both—Applies the CoS value to the MPLS and IPv4 headers of VPN packets on provider edge (PE) routers. On core routers, this option rewrites only the MPLS header and does not rewrite CoS bits in the inner IPv4 payload.

  • mpls-inet-both-non-vpn—Applies the CoS value to the MPLS and IPv4 headers of non-VPN packets on provider edge (PE) routers. On core routers, this option rewrites only the MPLS header and does not rewrite CoS bits in the inner IPv4 payload.

Junos OS Evolved supports only the mpls-any option. Devices running Junos OS Evolved do not support different rewrite rules for VPN and non-VPN traffic.

Required Privilege Level

interface—To view this statement in the configuration.

interface-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

Support for PTX platforms running Junos OS Evolved added with Junos OS Evolved Release 22.4.

footer-navigation