In the PBR list context, enter ip-rule, followed by the number of the rule, to define a rule for the PBR list. Repeat this command to define additional rules. A rule contains: (i) criteria that is matched against the packet, and (ii) a next hop list. When a packet matches the criteria specified in the rule, the rule’s next hop list determines how the packet is routed. Each PBR list can have up to 1,500 rules. The first rule that matches the packet determines the packet’s routing.
It is important to include a destination address, or range of addresses, in PBR rules to better classify the traffic to be routed. For an illustration, see Policy-based routing application example.
Note:
Leave a gap between rule numbers, in order to leave room for inserting additional rules at a later time. For example, ip-rule 10, ip-rule 20, ip-rule 30.
The following example creates rule 1, which routes packets going to IP address 149.49.43.210 with a DSCP value of 34 according to next hop list 1. The next step explains how to define a next hop list. For additional details about PBR rules, see PBR rules.
Gxxx-001(super-PBR 802)# ip-rule 1
Gxxx-001(super-PBR 802/ip rule 1)# next-hop list 1
Done!
Gxxx-001(super-PBR 802/ip rule 1)# destination-ip host 149.49.43.210
Done!
Gxxx-001(super-PBR 802/ip rule 1)# dscp 43
Done!
Gxxx-001(super-PBR 802/ip rule 1)#
Note:
Rules do not include a default next hop list. Thus, if you do not include a next hop list in the rule, the packet is routed according to destination-based routing, that is, the ordinary routing that would apply without policy-based routing.