Associating Track with PBR

PBR uses user-defined policies (based on criteria, such as the source address and packet length) to route packets. You can specify parameters to guide the forwarding of the packets that match specific ACLs or have specific lengths. The parameters include the VPN instance, packet priority, output interface, next hop, default output interface, and default next hop. For more information about PBR, see Layer 3—IP Routing Configuration Guide.

PBR cannot detect the availability of any action taken on packets. When an action is not available, packets processed by the action might be discarded. For example, if the output interface specified for PBR fails, PBR cannot detect the failure, and continues to forward matching packets out of the interface.

To enable PBR to detect topology changes and improve the flexibility of the PBR application, configure Track-PBR-detection module collaboration.

After you associate a track entry with an apply clause, the detection module associated with the track entry sends Track the detection result of the availability of the tracked object.

The following objects can be associated with a track entry:

Configuration prerequisites

Before you associate Track with PBR, create a policy or a policy node, and configure the match criteria.

Configuration procedure

To associate Track with PBR:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Create a policy or policy node and enter PBR policy node view.

policy-based-route policy-name [ deny | permit ] node node-number

N/A

3. Define a match criterion.

  • Define a packet length match criterion:if-match packet-length min-len max-len

  • Define an ACL match criterion:if-match acl { acl-number | name acl-name }

By default, no match criterion exists.

4. Associate Track with PBR.

  • Set the output interface, and associate it with a track entry:apply output-interface { interface-type interface-number [ track track-entry-number ] }&<1-n>

  • Set the next hop, and associate it with a track entry:apply next-hop [ vpn-instance vpn-instance-name | inbound-vpn ] { ip-address [ direct ] [ track track-entry-number ] }&<1-n>

  • Set the default output interface, and associate it with a track entry:apply default-output-interface { interface-type interface-number [ track track-entry-number ] }&<1-n>

  • Set the default next hop, and associate it with a track entry:apply default-next-hop [ vpn-instance vpn-instance-name | inbound-vpn ] { ip-address [ direct ] [ track track-entry-number ] }&<1-n>

Use at least one of the commands.

To associate Track with IPv6 PBR:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Create a policy or policy node and enter PBR policy node view.

ipv6 policy-based-route policy-name [ deny | permit ] node node-number

N/A

3. Define a match criterion.

  • Define an IPv6 packet length match criterion:if-match packet-length min-len max-len

  • Define an ACL match criterion:if-match acl { ipv6-acl-number | name ipv6-acl-name }

By default, no match criterion exists.

4. Associate Track with IPv6 PBR.

  • Set the output interface, and associate it with a track entry:apply output-interface { interface-type interface-number [ track track-entry-number ] }&<1-n>

  • Set the next hop, and associate it with a track entry:apply next-hop [ vpn-instance vpn-instance-name | inbound-vpn ] { ipv6-address [ direct ] [ track track-entry-number ] }&<1-n>

  • Set the default output interface, and associate it with a track entry:apply default-output-interface { interface-type interface-number [ track track-entry-number ] }&<1-n>

  • Set the default next hop, and associate it with a track entry:apply default-next-hop [ vpn-instance vpn-instance-name | inbound-vpn ] { ipv6-address [ direct ] [ track track-entry-number ] }&<1-n>

Use at least one of the commands.