cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1014
Views
5
Helpful
3
Replies

OSPF Load Balancing

leoandino
Level 1
Level 1

 

Hi.
I have an L3 switch with ospf connected to two DNS servers. Each DNS server propagates an IP listener by OSPF.

I understand, that OSPF having routes of equal cost, should balance the load by default, but this is not happening. So, how do I configure the L3 Switch to perform load balancing of the same path in OSPF?

For the load balancing to work in OSPF, should it have a lot of traffic?

 

Switch Capture:

 

O E2 210.0.0.4 [110/20] via 30.0.0.2, 00:39:07, Vlan30
                        [110/20] via 20.0.0.3, 00:39:07, Vlan20

 

Topology:

 

 SWITCH L3--------->DNS server VLAN20

                   --------->DNS srver VLAN 30

 

Verifying the tests, from both DNS servers, only one server receives responses from one of the routes.

 

 

What I did was:

add "maximum-paths 2" in OSPF

 

Vlan20 and Vlan 30 interface  add the "ip load-sharing per-packet"

and  enable IP cef.

 

Thanks you!

 

 

3 Replies 3

Mark Malone
VIP Alumni
VIP Alumni
hmm i think the lb is only for when you have say 2 equal cost paths going to a single ospf switch in front then it will utilize both links , i dont think it will LB to a server like that maybe im wrong but ive never used it like that , you dont even need the maximum paths command to get ospf to lb as its default mechanism once paths are equal , if you trace to that server does it go by both hops in the output ?

you could try ip load-sharing per packet but that command can cause sensitive applications like voice to have issues

Hi Mark, Leo,

The ip load-sharing per-packet command is typically not even available on multilayer switches, so this is most likely not a feasible approach.

Back to the issue at hand, for ECMP, Cisco's CEF implementation takes both the source and destination IP address into account when selecting a particular path toward destination. You can test the path the packet would be forwarded through using the

show ip cef exact-route source-IP destination-IP

command. The source-IP and destination-IP are, obviously, the source and destination IP addresses of the packet being handled (they can be entirely fictious, though here, the destination is obviously 210.0.0.4). Note that for a particular [Source,Destination] pair, CEF will always select the same path. With the fixed destination 210.0.0.4, you would need to send packets from multiple sources to see that they are being load-shared across the multiple paths.

What I suggest is just testing various source addresses in the show ip cef exact-route command, and then trying to actually configure them and use them to see if the traffic gets finally spread to both servers as expected.

Best regards,
Peter

Hi.

Thanks for your answer.

perform the test of the command, and it is shown that it divides into traffic:

SW1 # sh ip cef exact-route 60.60.60.10 210.0.0.4
60.60.60.10 -> 210.0.0.4: Vlan30 (next hop 30.0.0.2)
SW1 # sh ip cef exact-route 60.60.60.4 210.0.0.4
60.60.60.4 -> 210.0.0.4: Vlan20 (next hop 20.0.0.3)

But in practice it does not work. :(

Is it necessary for the OSPF ECMP that the routes to the same destination are in different vlan?
Review Cisco Networking for a $25 gift card