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

protocol (Rewrite Rules)

date_range 11-Mar-25

Syntax

content_copy zoom_out_map
protocol protocol-types;

Hierarchy Level

content_copy zoom_out_map
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules exp rewrite-name],
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules dscp rewrite-name],
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules dscp-ipv6 rewrite-name],
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules inet-precedence rewrite-name]
[edit class-of-service interfaces interface-name unit logical-unit-number rewrite-rules inet6-precedence rewrite-name]

Description

Apply a rewrite rule to MPLS packets only, and write the CoS value to MPLS headers only; or apply a rewrite rule to MPLS and IPv4 or IPv6 packets, and write the CoS value to MPLS and IPv4 or IPv6 headers.

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

protocol-types can be one of the following:

  • mpls-any—Apply a rewrite rule to MPLS packets and write the CoS value to MPLS headers only.

  • 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.

Option for dscp and inet-prec introduced in Junos OS Release 8.4.

Option for dscp-ipv6 introduced in Junos OS Release 10.4R2.

footer-navigation