Modify OSPF routes based on source criteria and destination interface

Unanswered Question
Apr 16th, 2008

Hopefully someone here can assist with a problem I've been having for a few months now.

We run OSPF. On two of our routers, I would like to have the router analyze the traffic and decide which of two paths to take based on two things:

1) The source IP and precdence of the packet, and

2) The next-hop interface of the packet once the router decides where it will be routed.

Is there a way to have the router examine a list of criteria and then the routing table to find matches, then alter the next-hop route for entries that match this criteria?

I am also open to other suggestions of how to achieve this.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
deschete Wed, 04/16/2008 - 11:45


I have tried using PBR; unfortunately, matching on ip next-hop can only be used for redistribution. PBR can only use match ip and match length.

Because of this I was wondering if I could analyze OSPF routes, modify them based on criteria in a route map, and then redistribute the changes back into the same instance.

I am also open to other suggestions of how this may be done.



Edison Ortiz Wed, 04/16/2008 - 11:49

In OSPF you can't redistribute from OSPF back into OSPF.

Can you please give us a sample scenario that we can follow?

I have a hard time understanding what exactly you want to accomplish.

With PBR, you can change default routing behavior based on the source parameters. From the main posts, it seems that what you wanted.

deschete Wed, 04/16/2008 - 11:56

Sure, let me try to make it a little more clear.

I have two routers in two cities. Between these two routers there are two connections. One is intended for general traffic and is configured to participate in OSPF. The second link is for traffic with priority 5 from a select list of IP addresses, and this link is not participating in OSPF.

Here's where the problem comes in - there are multiple T1 connections coming in to both of these routers also. This means that technically speaking, there are multiple "inbound" interfaces on the router.

If I classify based on source or priority with PBR, I may send traffic that simply needs to go out of another T1 on the router across the WAN to the second router, where it will be sent back and then go over the neighboring T1!

So in short, the easiest way to solve this particular problem would be to analyze all traffic destined to go out of the primary uplink to the other city's router. If it matches a set of criteria, it is re-routed over the secondary link for priority traffic.

I can try to explain in greater detail if this is still unclear.



Edison Ortiz Wed, 04/16/2008 - 12:03

If you want to force traffic (bi-directionally) via a specified T1 based on certain criteria, then you need PBR on both routers.

deschete Wed, 04/16/2008 - 12:08

The problem is that the need to send the traffic hinges on if it was already destined to go over another interface. Because PBR is processed before the routing table is processed, I can't find a way to do this with PBR.

Edison Ortiz Wed, 04/16/2008 - 12:45

You lost me there, sorry - traffic hinges ?

Can you pull up a quick visio diagram and explain the traffic pattern that you want out of this task ?

deschete Thu, 04/17/2008 - 12:49

Attached is a drawing showing the situation that I'm describing.

Item #4 should read "after an inefficient trip through R1," not R4 as on this diagram.

Edison Ortiz Mon, 04/21/2008 - 06:01

Based on your diagram, I believe your requirement can't be accomplished.


This Discussion