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

policy-map (Class of Service)

date_range 16-Dec-24

Syntax

content_copy zoom_out_map
policy-map policy-map-name {
    inet-precedence proto-ip code-point [alias | bits];
    inet-precedence proto-mpls code-point [alias | bits];
    inet-precedence proto-all code-point [alias | bits];
    inet6-precedence proto-ip code-point [alias | bits];
    inet6-precedence proto-mpls code-point [alias | bits];
    dscp proto-ip code-point [alias | bits];
    dscp proto-mpls code-point [alias | bits];
    dscp proto-all code-point [alias | bits];
    dscp-ipv6 proto-ip code-point [alias | bits];
    dscp-ipv6 proto-mpls code-point [alias | bits];
    dscp-ipv6 proto-all code-point [alias | bits];
    exp all-label code-point [alias | bits];
    exp outer-label code-point [alias | bits];
    ieee-802.1 outer code-point [alias | bits];
    ieee-802.1 outer-and-inner code-point [alias | bits];
    ieee-802.1ad outer code-point [alias | bits];
    ieee-802.1ad outer-and-inner code-point [alias | bits];
    user-attribute integer; 
}

Hierarchy Level

content_copy zoom_out_map
[edit class-of-service]

Description

Define the packet-marking scheme (rewrite rules) for a customer. Traditionally, packet marking in Junos uses the forwarding class and loss priority determined from a behavior aggregate (BA) classifier or multifield classifier. This approach does not allow rewrite rules to be directly assigned for each customer because of the limited number of combinations of forwarding class and loss priority. policy-map enables you to define rewrite rules on a per-customer basis.

Note:

To enable the policy map feature:

  • On most devices, enable enhanced-ip, enhanced-ethernet, or enhanced-mode under [edit chassis network-services].

  • On PTX10002-36QDD routers, enable policy-map-marking on each egress logical interface that you want to do policy map marking. You enable policy-map-marking at the [edit class-of-service interfaces interface-name unit unit-number] hierarchy level.

Note:

Policy maps have the following configuration restrictions:

  • When configuring both proto-ip and proto-mpls options for inet-precedence, inet6-precedence, dscp, or dscp-ipv6, you must configure both options with the same code point or code point alias.

  • You cannot configure inet-precedence and dscp in the same policy map.

  • You cannot configure inet6-precedence and dscp-ipv6 in the same policy map.

  • In case of MPLS SWAP/PUSH operation, only the new labels are marked on all label-switching routers (LSRs), except the penultimate hop case where if it exposes the next label in the stack, then the exposed label is marked. Therefore, with the penultimate hop, the service label is changed.

  • You cannot configure ieee-802.1 and ieee-802.1ad in the same policy map.

  • You cannot configure both outer and outer-and-inner options for ieee-802.1 and ieee-802.1ad code points in the same policy map.

  • For IEEE 802.1ad with the outer-and-inner option, the discard eligibility (DE) bit is marked only for the outer VLAN header. For the inner VLAN header, only the three CoS Bits are marked.

You assign the policy map to a customer through a firewall action on an ingress or egress firewall filter (where the match conditions identify the customer). Alternatively, you can also assign a policy map to an ingress interface or a routing instance. A policy map is executed on a packet just before it is queued, so it overrides any other packet-marking scheme that was previously applied to the packet.

Options

alias

The predefined CoS code point alias on the device.

bits

The bit pattern for the CoS code point.

Required Privilege Level

interface—To view this statement in the configuration.

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

Release Information

Statement introduced in Junos OS Release 16.1R1.

inet6-precedence options added in Junos OS Release 24.2R1.

Refer to Feature Explorer for platform and release support information.

footer-navigation