Policy-based routing

In this diagram, we're going to map the PC1 traffic to the R1 and ISP1 router and the P2P traffic to the ISP2.

(config)# ip access-list standard PC1
(config-ext-nacl)# permit host 192.168.0.2

(config)# ip access-list extended P2P
(config-ext-nacl)# permit tcp host 192.168.0.0 0.0.0.255 any eq 6881

Now, start writing your route-map based on your access-list:

(config)# route-map HRT permit 10
(config-route-map)# match ip address PC1
(config-route-map)# set ip next-hop 10.1.1.2

Set the P2P service for the ISP2:

(config)# route-map HRT permit 20
(config-route-map)# match ip address P2P
(config-route-map)# set ip next-hop 10.1.2.2

Set the other traffic to the ISP1, so just write the set command without match:

(config)# route-map HRT permit 30
(config)# set ip next-hop 10.1.1.2

Finally, add the policy you've defined in the interface:

(config)# interface GE2/2/23
(config)# ip policy route-map HRT

Last updated