Rewriting MPLS and IPv4 Packet Headers
You can apply a rewrite rule to MPLS and IPv4 packet headers simultaneously. This allows you to initialize MPLS EXP and IP precedence bits at LSP ingress. You can configure different rewrite rules depending on whether the traffic is VPN or non-VPN.
To rewrite MPLS and IPv4 packet headers, include the
protocolstatement at the[edit class-of-service interfacesinterface-nameunitlogical-unit-numberrewrite-rules exprewrite-rule-name]hierarchy level:[edit class-of-service interfacesinterface-nameunitlogical-unit-numberrewrite-rules exprewrite-rule-name]protocoltypes;Use the
protocolstatement to specify the types of MPLS packets and packet headers to which to apply the rewrite rule. The MPLS packet can be a standard MPLS packet or an MPLS packet with an IPv4 payload. Specify the type of MPLS packet by using the following options:
mpls-any—Applies the rewrite rule to MPLS packets and writes the code point value to MPLS headers.mpls-inet-both—Applies the rewrite rule to VPN MPLS packets with IPv4 payloads. Writes the code point value to the MPLS and IPv4 headers in T-series and M320 routers. On M-Series routing platforms, except the M320, thempls-inet-bothoption causes all ingress MPLS LSP packets with IPv4 payloads to be initialized with 000 code points for IP precedence and MPLS EXP values.mpls-inet-both-non-vpn—Applies the rewrite rule to any non-VPN MPLS packets with IPv4 payloads. Writes the code point value to the MPLS and IPv4 headers in T-series and M320 routers. On M-Series routing platforms, except the M320, thempls-inet-both-non-vpnoption causes all ingress MPLS LSP packets with IPv4 payloads to be initialized with 000 code points for IP precedence and MPLS EXP values.For a detailed example on how to configure rewrite rules for MPLS and IPv4 packets and for more information about how to configure class of service, see the JUNOS Network Interfaces and Class of Service Configuration Guide.