mpls te affinity-attribute

Use mpls te affinity-attribute to set an affinity for a tunnel.

Use undo mpls te affinity-attribute to restore the default.

Syntax

mpls te affinity-attribute attribute-value [ mask mask-value ]

undo mpls te affinity-attribute

Default

The affinity is 0x00000000, and the mask is 0x00000000. That is, a tunnel can use any link.

Views

Tunnel interface view

Predefined user roles

network-admin

Parameters

attribute-value: Specifies the affinity value, a hexadecimal number in the range of 0 to ffffffff. An affinity is a 32-bit binary number. Each bit of the affinity represents an attribute, which takes a value of 0 or 1.

mask mask-value: Specifies the mask of the affinity bits, a hexadecimal number in the range of 0 to ffffffff. A mask is a 32-bit binary number. Each bit of the mask determines whether to check the corresponding bit of the link attribute. If the mask bit is 1, the corresponding link attribute bit must be checked with the affinity bit. The link can be used by the tunnel only when the link attribute bit meets certain requirements. If the mask bit is 0, the corresponding link attribute bit is not checked.

Usage guidelines

Affinity determines which links a tunnel can use. The affinity attribute and its mask, and the link attribute are all 32-bit long. A link is available for a tunnel if the link attribute meets the following requirements:

The link attribute bits corresponding to the 0 bits in the affinity mask are not checked.

For example, if the affinity is 0xfffffff0 and the mask is 0x0000ffff, a link is available for the tunnel when its attribute bits meet the following requirements:

Examples

# Set the tunnel affinity to 0x101 and mask to 0x303. Then, a link is available for the tunnel only when the link attribute bits (from left to right) meet the following requirements:

<Sysname> system-view
[Sysname] interface tunnel 0 mode mpls-te
[Sysname-Tunnel0] mpls te affinity-attribute 101 mask 303

Related commands

display mpls te tunnel-interface

mpls te link-attribute