> For the complete documentation index, see [llms.txt](https://hamidsec.gitbook.io/cisco/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hamidsec.gitbook.io/cisco/policy-based-routing.md).

# Policy-based routing

![](/files/-LN6dA34qF4XpSH0_fKz)

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
```
