Configuring Actions of Local PBR
Context
When configuring actions of local PBR, note the following:
If two next hops are configured in PBR, the two next hops load balance traffic when forwarding packets.
If two outbound interfaces are configured in PBR, the two outbound interfaces load balance traffic when forwarding packets.
If two next hops and two outbound interfaces are configured in PBR, only the two outbound interfaces load balance traffic when forwarding packets.
Procedure
- Run system-view
The system view is displayed.
- Run policy-based-route policy-name { deny | permit } node node-id
A policy and a PBR node are created. If a PBR node exists, the local PBR view is displayed.
By default, no policy or PBR node is created for the local PBR.
- Configure actions of the local PBR. A PBR node contains at least one apply clauses.
- Run apply output-interface interface-type interface-number
An outbound interface is configured.
By default, no outbound interface is configured in the local PBR.
Locally generated packets matching the PBR node are sent from the specified outbound interface.
- The outbound interface cannot be a broadcast interface, for example, an Ethernet interface.
- If you configure an outbound interface while two outbound interfaces have been configured using the apply output-interface interface-type interface-number command, the new outbound interface configuration overwrites the first outbound interface configuration, not the second outbound interface configuration.
- Run apply ip-address next-hop ip-address1 [ ip-address2 ]
A next hop is configured.
By default, no next hop to which packets are forwarded is configured in the local PBR.
When no outbound interface is configured for a PBR node, locally generated packets matching the PBR node are forwarded to the specified next hop.
- The next hop cannot be the local IP address.
- If you configure a next hop while two next hops have been configured using the apply ip-address next-hop ip-address1 [ ip-address2 ] command, the new next hop configuration overwrites the first next hop configuration, not the second next hop configuration.
- Run apply ip-address next-hop { ip-address1 track ip-route ip-address2 { mask | mask-length } } &<1-2>
Association between next hop and route is configured in local PBR.
By default, association between next hop and route is not configured in local PBR.
- Run apply ip-address backup-nexthop ip-address
A backup next-hop IP address is specified for packet forwarding in local PBR.
By default, no backup next hop is configured for packet forwarding in local PBR.
- Run apply default output-interface interface-type interface-number
A default outbound interface is configured.
By default, no default outbound interface is configured in the local PBR.
When no outbound interface or next hop is configured for a PBR node and locally generated packets fail to be sent by searching for routes based on destination addresses of packets, the packets are sent from the default outbound interface.
The default outbound interface cannot be a broadcast interface, for example, an Ethernet interface.
- Run apply ip-address default next-hop ip-address1 [ ip-address2 ]
A default next hop of packets is configured.
By default, no default next hop is configured in local PBR.
The default next hop cannot be a local IP address. - Run apply access-vpn vpn-instance vpn-instance-name &<1-6>
A VPN instance for forwarding packets is configured.
By default, no VPN instance is configured for forwarding packets in local PBR.
- Run ip policy-based-route refresh-time [ refreshtime-value ]
The interval at which local PBR updates LSPs is configured.
By default, the interval at which local PBR updates LSPs is 5000 ms.
Run apply ip-precedence precedence
The priority of packets is configured.
By default, the priority of IP packets is not configured in local PBR.
After the configuration is complete, a router sets the priority of locally generated packets that match the PBR node based on the priority configuration.
The value of precedence ranges from 0 to 7. You can replace the value of precedence with a keyword. Table 12-2 shows the mappings between the values and keywords.
- Run apply output-interface interface-type interface-number