Configure Policy Based routing (PBR) based on source IP
![Configure Policy Based routing (PBR) based on source IP](https://learnduty.com/wp-content/uploads/2022/02/image-24.png?v=1647900192)
Check: Configure Policy Based routing (PBR) [step by step]
Topology:
![](https://learnduty.com/wp-content/uploads/2022/02/image-24.png)
We will configure PBR on R1 in order to make the traffic sourced from PC1 (172.16.88.10/24) go through R2 and the traffic sourced from the rest of the networks which include PC2 (172.16.89.10/24) go through R3.
Configuration:
R1:
interface Ethernet0/0
ip address 172.16.88.1 255.255.255.0
ip policy route-map GOTO-R3
half-duplex
!
interface Ethernet0/3
ip address 172.16.89.1 255.255.255.0
ip policy route-map GOTO-R2
half-duplex
!
ip access-list extended Match-UDP
permit udp any any
access-list 110 permit ip 172.16.89.0 0.0.0.255 any
no cdp log mismatch duplex
!
route-map GOTO-R2 permit 10
match ip address 110
set ip next-hop 10.10.1.2
!
route-map GOTO-R3 permit 10
match ip address Match-UDP
set ip next-hop 10.10.2.2
Verification:
- We will perform a traceroute from PC1 and PC2:
![](https://learnduty.com/wp-content/uploads/2022/02/image-28.png)
![](https://learnduty.com/wp-content/uploads/2022/02/image-31.png)
- We can see that the route route-map have matched:
![](https://learnduty.com/wp-content/uploads/2022/02/image-30.png)
![](https://learnduty.com/wp-content/uploads/2022/02/image-32.png)
Cr: Bilel