This is Video #5 of our MPLS Traffic Engineering series, which is designed to help viewers gain basic understanding of MPLS Traffic Engineering and how to configure TE tunnels in Cisco routers.

In this video, we will do a lab that demonstrates how to configure affinity and attribute flags for dynamic path selection of the MPLS TE tunnels.



  • Also termed as “link color”.
  • Uses Hexadecimal for Affinity and Attribute flag values.
  • Default of TE tunnel is 0x0/0xFFFF.
  • Default Attribute Flags of TE physical interfaces is 0x0.
  • Works with CSPF to determine the best path through matching affinity to the attribute flags.
  • In the affinity mask, a “1” in the converted hex to binary means match the affinity value.
  • All “1”s in the affinity value must be matched otherwise the command will be accepted. An error similar below will be generated.

% Bits cannot be set in affinity (0x5) if unset in mask (0x3)


interface Tunnel100
 tunnel mpls traffic-eng affinity <0x0 – 0xFFFFFFFF> mask <value>
interface GigabitEthernet0/0
 mpls attribute-flags 0x0 - 0xFFFFFFFF