1.2d Policy Based Routing
Policy based routing (PBR) is a mechanism by which we can route traffic in a manner other than that based on its destination. PBR allows forwarding decision to be based on source, destination, protocol type (FTP, HTTP, etc. ) or incoming interface.
How does it work?
- Traffic criteria defined by a route-map match
- Permit means to policy route
- Deny means to use normal forwarding
- match [interface | ip address | …]
- Action defined by route-map set
- set ip [default] next-hop
- set [default] interface
- Policy can be verified with…
- debug ip policy
PBR can be applied to two types of traffic
- Incoming traffic
- PBR applied at the link level
- ip policy route-map [route-map]
- Locally originated traffic
- PBR applied globally
- ip local policy route-map [route-map]
PBR Caveats
- Most platforms can’t hardware accelerate PBR
- Platforms that do have strict criteria limits
- Outside of this PBR should be used sparingly
Configuration example
Define interesting traffic
ip access-list extended HOSTS8-HOSTS10-SUBNETS-TO-HOSTS9
permit ip 155.1.8.0 0.0.0.255 155.1.9.0 0.0.0.255
permit ip 155.1.10.0 0.0.0.255 155.1.9.0 0.0.0.255
Create route-map and set next-hop (or whatever you want)
route-map HOST8-HOST10-PBR permit 10
match ip address HOSTS8-HOSTS10-SUBNETS-TO-HOSTS9
set ip next-hop 155.1.0.3
Apply policy to appropriate interface
interface GigabitEthernet0/2
ip policy route-map HOST8-HOST10-PBR
Comments
So empty here ... leave a comment!