Policy-based routing (PBR) allows switches to select routes based on user-defined policies, and it takes precedence over direct routes, static routes, and routes generated by dynamic routing protocols. After PBR is configured on the device, if the received packets (including Layer 2 packets) match PBR rules, the device forwards the packets according to the rules. If the packets do not match PBR rules, the device forwards the packets according to the destination address of the packets.
Traditionally, to determine the routes used to forward packets, a switch searches its IP routing table based on the destination address carried in the packets. To allow switches to route packets based on user-defined policies, PRB can be configured.
PBR has the following advantages: