Overview of PBR
Definition
PBR is a mechanism that makes routing selection based on user-defined policies.
- The main differences between PBR and routing policy are as follows:
- PBR implements routing based on data packets. It routes data packets based on user-defined policies instead of following the routes in the existing routing table.
- Routing policies implement routing based on routing information. Routing policies are used to filter routes and set route attributes. You can change route attributes (including reachability) to change a route over which network traffic is transmitted.
Purpose
Traditionally, to determine the routes used to forward packets, a device searches its IP routing table based on the destination address carried in the packets. Currently, more users require that devices route packets based on self-defined policies. PBR allows network administrators to make user-defined policies to change packet routes based on source addresses, packet size, and link quality in addition to destination addresses.
Benefits
PBR has the following advantages:
- Allows network administrators to define policies for routing packets, improving flexibility and controllability of route selection.
- Enables different data flows to be forwarded on different links, increasing link usage.
- Allows cost-effective links to be used for transmitting service data without affecting service quality, reducing the cost of enterprise data services.
Implementation
PBR applies only to forwarded packets, but not to locally generated packets such as local ping packets. PBR is valid only for IP packets.
The device does not support PBR-based tracert. When the device receives a tracert packet, it discards the packet if it has only PBR but not a routing entry for the destination IP address of the packet.
PBR is implemented based on the redirection action configured in a traffic behavior and takes effect only on incoming packets of interfaces. By default, a device forwards packets to the next hop found in its routing table. If PBR is configured, the device forwards packets to the next hop specified by PBR. You can also specify a low priority for a policy-based route to enable the device to forward packets matching PBR to the next hop/outbound interface of the specific route in its routing table. When the specific route becomes invalid, the device forwards packets to the next hop/outbound interface specified by PBR. When both the next hop of the specific route and next hop specified by PBR become invalid, and the routing table has default routes, the device continues forwarding packets according to the matching default route.
When the device forwards packets to the next hop specified by PBR, the device triggers ARP learning if it has no ARP entry corresponding to the IP address of the specified next hop. If the device cannot learn this ARP entry, it forwards packets to the next hop found in the routing table. If the device has this ARP entry, it forwards packets to the next hop specified by PBR.