cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
948
Views
15
Helpful
5
Replies

creating policy for certain ip to use different default route on a router

baselzind
Level 6
Level 6

i need to let a group of ip to use a different default route than the one already configured on the router but im afraid all other traffic not matching the access list will be dropped , is that true? also do i apply the policy on the interface which is the gateway for the subnet?

 

int vlan 10

ip address 10.1.1.1 255.255.255.0

ip policy-map new-gateway

 

route-map new-gateway permit 10

match ip address 10

set ip default next-hop x.x.x.x

 

access-list 10 permit 10.1.1.0 0.0.0.255

 

 

1 Accepted Solution

Accepted Solutions

Here is the PBR Principle :

 

Policy based routing offers the possibility to forward traffic based on defined criteria without verifying the IP routing table. The constructed policy is applied to interface. Every packet coming on this interface is verified against the policy and only traffic conforming (matching) the rule is subject to policy route. The entire local origin kind of traffic and everything that policy doesn’t match is still routed according to routing table based on normal destination rules.

 

 

So match only required IP for PBR to route, test will go to defualt routing. hope Make sense ?

 

BB

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

How to Ask The Cisco Community for Help

View solution in original post

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

If you looking Policy based routing, yes with your example everything will be routed to x.x.x.x

 

if i understand your requirement you looking some IP address route to nexy hop Y , others to next hop Z

if this is correct here is example : (tweak as per your requirement)

 

access-list 10 permit 10.1.1.5
access-list 11 permit 10.1.1.6

!

interface vlan 1
ip policy route-map bb_map
!
route-map bb_map permit 10
match ip address 10
set ip next-hop 20.20.20.1
!
route-map Texas permit 11
match ip address 11
set ip next-hop 30.30.30.1

BB

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

How to Ask The Cisco Community for Help

the problem is i want to divert like couple of ip of the 10.1.1.0/24 subnet to default route Y and the rest of the subnet to default route Z , can i do it like this so it matches the group of ip i need first then the whole subnet?

access-list 10 permit 10.1.1.5
access-list 10 permit 10.1.1.6
access-list 11 permit 10.1.1.0 0.0.0.255

Here is the PBR Principle :

 

Policy based routing offers the possibility to forward traffic based on defined criteria without verifying the IP routing table. The constructed policy is applied to interface. Every packet coming on this interface is verified against the policy and only traffic conforming (matching) the rule is subject to policy route. The entire local origin kind of traffic and everything that policy doesn’t match is still routed according to routing table based on normal destination rules.

 

 

So match only required IP for PBR to route, test will go to defualt routing. hope Make sense ?

 

BB

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

How to Ask The Cisco Community for Help

Hello


@balaji.bandi wrote: 
So match only required IP for PBR to route, test will go to defualt routing. hope Make sense ?

Just like to add - When PBR is specifying a Default ip/interface command in-line with a router using a static/dynamic default route  This will have the effect that PBR will ignore the default route in the rib and as such any defined traffic in the PBR will be routed by the PBR set command first.

 

Meaning if there is ONLY a default route is in the rib and no other specific route exists this is basically the same as using the PBR set ip/interface command which doesn’t check the rib at all when pbr is intitated.

 

 

 

 

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

@paul driver

 

That is what i was in line with that.. if no PBR ACL matches, it take default path to exit out.

BB

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

How to Ask The Cisco Community for Help

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card