policy-map (Class of Service)
Syntax
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
[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.
To enable the policy map feature:
-
On most devices, enable
enhanced-ip
,enhanced-ethernet
, orenhanced-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 enablepolicy-map-marking
at the[edit class-of-service interfaces interface-name unit unit-number]
hierarchy level.
Policy maps have the following configuration restrictions:
-
When configuring both
proto-ip
andproto-mpls
options forinet-precedence
,inet6-precedence
,dscp
, ordscp-ipv6
, you must configure both options with the same code point or code point alias. -
You cannot configure
inet-precedence
anddscp
in the same policy map. -
You cannot configure
inet6-precedence
anddscp-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
andieee-802.1ad
in the same policy map. -
You cannot configure both
outer
andouter-and-inner
options forieee-802.1
andieee-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.