cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
741
Views
30
Helpful
7
Replies

how to create a policy based routing with an existing route?

baselzind
Level 6
Level 6

I need to tell my pc to go to a certain target ip through an existing router interface ip , but according to cisco PBR doc , the PBR will only be used if there no existing specific static route "ex. ip route xxxx xxxx xxxx" which i do have . like for example the target ip is 192.168.10.10 and the existing static ip route is 

ip route 192.168.10.10 255.255.255.255 192.168.2.1

but  I want only my pc 192.168.1.1 to use the below route 

  ip route 192.168.10.10 255.255.255.255 192.168.3.1

7 Replies 7

that wrong, the PBR work if there is route and if not there is route 
the different 
if there is route, the router will use route in RIB as failover (if you use  verify ) or the traffic is not match ACL you use in PBR 
if there is not route, the router will drop packet if next-hop of PBR is down or traffic is not match ACL  you use in PBR.

balaji.bandi
Hall of Fame
Hall of Fame

Not sure what is the goal here.

Are you looking source 192.168.10.10  destiantion - ? (this was not clear)

you man 192.168.10.10 going to 192.168.1.1 to use 192.168.3.1 ?

PBR need source and destination, so that can be changes to different next hop based on the route-map.

what was not worked ?

Policy-Based Routing

Policy-based routing is a process whereby the device puts packets through a route map before routing them. The route map determines which packets are routed to which device next. You might enable policy-based routing if you want certain packets to be routed some way other than the obvious shortest path. Possible applications for policy-based routing are to provide equal access, protocol-sensitive routing, source-sensitive routing, routing based on interactive versus batch traffic, and routing based on dedicated links. Policy-based routing is a more flexible mechanism for routing packets than destination routing.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

see as of now there is an ip route as below on the core for all users 192.168.1.0/24

ip route 192.168.10.10 255.255.255.255 192.168.2.1

I want my pc only with ip 192.168.1.1 to go to 192.168.10.10 through 192.168.3.1 instead of the above 192.168.2.1

how is your network diagram look like.

you can do route map example :

ACL :

access-list 100 permit host 192.168.1.1 host 192.168.10.10
!
mat the ACL :

route-map host_route
match ip address 100
set ip next-hop 192.168.2.1

apply rule to interface :

interface gi0/0 or vlan x
ip policy route-map host_route

Note : this will have only outbound control on this routemap.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

apply PBR to egress with following 

ip access-list extended 100
permit ip host 192.168.1.1 host 192.168.10.10 
!
route-map MHM permit 10
match ip address 100
set ip next-hop 192.168.3.1

interface x
policy route-map MHM 


NOTE:- you CAN use set interface <interface toward 192.168.3.1> OR set ip next-hop192.168.3.1

on which interface do i apply the routemap? on the interface vlan of 192.168.1.0/24 ?

Yes correct