cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
540
Views
0
Helpful
5
Replies

Policy based routing

Hi

Iam trying to configure Policy based routing.

But it dosen't work.

what i will like:

To have all traffic from 10.10.10.0/29 routet though 20.20.20.20, where my default gateway is 30.30.30.30

Configuration dump:

interface Vlan2000
ip address 10.10.10.1 255.255.255.248
ip pim sparse-mode
ip route-cache same-interface
ip policy route-map Test

!

access-list 100 permit ip 10.10.10.1 0.0.0.7 any

route-map test permit 10
match ip address 100
set ip next-hop 10.10.10.1
!

But traffic is still routet though 30.30.30.30

What iam doing wrong?

I get 30.30.30.30, from OSPF. On the other router i got it from BGP, I don't know if that give me some problems?

Regards Kenneth Dalbjerg

5 Replies 5

devils_advocate
Level 7
Level 7

You have set the next hop to be 10.10.10.1 which is the clients default gateway anyway.

If you want the next hop to be 20.20.20.20, you need to state this in the route map:

route-map test permit 10
match ip address 100
set ip next-hop 20.20.20.20

The packets arrive at 10.10.10.1 as this is the clients default gateway and if you want to use PBR, you need to tell them where to go next otherwise the router will just look at the global routing table and make a decision based on this. 

Edit - Also, I believe that route maps are case sensitive. You have called it 'test' in the route map command and 'Test' in the interface config. 

Sorry, it was because the ip address, was not what is in my config, it's not the reals ip address. 

I have justed look, i have type:  20.20.20.20, in my config, so it's not that :)

Did you see the last sentence of my previous post? About the case sensitive bit. 

Hi

That could be it.

I will just test it, thx.

Regards Kenneth

It was not that.

But i have found out, that if it something on my test devices.
It routing to wrong router. I have type the correct gateway in.

If i tested it from a debian machine, everything is working fine.

Thx for yours time.

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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco