Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

Manipulating OSPF path selection when two neighbor routers are on same vlan


every of my branch office routers (many hundred routers) is connected over its own vlan to our central site (we bought a metro ethernet cloud).

At the central site there are two bigger routers talking ospf with all the branch office routers. So they have many hundred vlans/sub-interfaces with LLQ-staff defined.

I now want that every traffic of one branch office goes all the time over the same central router and vice versa but another branch office should use the other central router in normal situation (for load balancing between the central routers). In case one central router dies all traffic should go through the remaining central router.

How should I configure the ospf routers so that the traffic from the branch router goes over its preferred central router?

I would like a solution by which only manipulating the central router configuration allows moving the traffic of one or more branch offices to the other central router but this is no absolute need.

What would you suggest the best solution?




Re: Manipulating OSPF path selection when two neighbor routers a

You can set load-balancing to work per-destination or per-packet. You can achive your needs through any one of the implementation

Per-destination load balancing means the router distributes the packets based on the destination address Per-packet load-balancing means that the router sends one packet for destination1 over the first path, the second packet for (the same) destination1 over the second path, and so on.

Community Member

Re: Manipulating OSPF path selection when two neighbor routers a

Maybe I should not mention the word "load-balancing" in my question.

I do not want to load balance traffic from one branch office between the two central routers!

Every traffic from one branch office should always go through the same central router.

Each of the central routers should be used by half of the branch offices.

(of course if one central router dies the other central router should service all branch offices)

I know a solution but I would like a solution which allows path manipulation only by changing the central routers.

No Load-Balancing!!!

Re: Manipulating OSPF path selection when two neighbor routers a

Following on from the previous post, there is one major consideration concerning per-packet loadbalancing, and that is to say that is not desireable if you planning to implement VoIP.

In such circumstance packets can arrived out of sequence.



Community Member

Re: Manipulating OSPF path selection when two neighbor routers a

Maybe my question was not clear enough or I should not mention "load-balancing" in my question.

We do not want a load-balancing of the traffic of one branch office. You already mention some reasons for that -> Voice,QoS.

I want that each branch office router sends all its traffic to one central router. I want different branch office routers to use different central routers so that both central routers are in use.

The ospf path manipulation should be possible by only manipulating the configuration of the central routers, so that a move of traffic does not need a branch office configuration change.

Re: Manipulating OSPF path selection when two neighbor routers a


If I understand correctly, each remote site is connected through a VLAN that has three devices on it: the remote site router, and the two central site routers. I am a little uncertain about how to do it, but here are some thoughts:

Let us say that the particular site is VLAN n. What happens if you set the ip ospf cost 10 on the VLAN n interface of the central router that you want the remote site to use, and ip ospf cost 20 on the one you want it to use as backup. Then reverse these positions for each alternate VLAN.

That will work for one traffic direction, but I am not sure which! I am not sure whether the cost on the LSA is the cost of the interface that has to receive the traffic (i.e. the central router) or the one that transmits the traffic (i.e. the remote router). I shall have to lab it to find out.

If that works in the outward direction, it will depend on the path cost between the two central routers being less than the difference between the path costs to the remote router. That is, if the remote site should use CoreA, but the packet is in CoreB, then CoreB needs to have a better route to the remote via CoreA than via its direct link.

You will have to bear in mind always that in any such scheme you are likely to end up with asymetric paths, i.e. the outward path is not necessarily the reverse of the inward path. That is not normally a problem though.

For the inbound direction you might consider running the connections as point-to-multipiont, and manipulating the OSPF neighbor cost. That would require static configuration of the neighbors at the remote router though.

I'll think about it today and I'll post again if I have any other thoughts.

Kevin Dorrell


Community Member

Re: Manipulating OSPF path selection when two neighbor routers a


the problem is (in my knowledge) that the command on the central router (branch office) vlan interface is not influencing the routing decision of the branch office router.

The branch router only inspects the costs of the links behind the local vlan/link and adds its own interface costs to this value. As I only have one branch office router vlan interface I can only use one time and there is no decision between the central routers possible.

The only possibility I know at the moment is to use the following Router-OSPF-command on the branch office router.

neighbor cost

But this command does not allow a simple centralized fast moving of all traffic from one central router to the other one.

I am searching for a solution to manipulate the routing for each branch office independently by only manipulating the central routers configuration.

And I hope this is possible within OSPF.



Re: Manipulating OSPF path selection when two neighbor routers a


I did some more thinking about it today. I think that the metric the branch router will perceive for the route is the sum of the cost of the links it will traverse, the cost being the one configured at the egress port. So you are right, the way to influence the packets from the branch to the core is to set costs on the links towards the core.

(By the way, while I was researching this, I found that the neighbor cost command is only useful in point-to-multipoint OSPF network types. That is because P2MP treats each neighbor as a seperate link.)

In the other direction, the costs you set on the vlan interface of each core router will influence the outbound packets. By manipulating those, you can make it so that a particular branch always gets its packet from core A, even if the packet started out in core B and had to pass over the cross-connect.

So I understand your problem ... how to set the costs on all those branch routers. I cannot offhand think of anything the core routers can do to influence that decision, because the route is determined by the cost at the branch end of the link.

I'll let you know if I think of anything.

Kevin Dorrell


CreatePlease to create content