November 21, 2024

OSPF Load Balancing Example

OSPF Load Balancing:

[boxads] Today I will show how to configure OSPF load balancing, If we follow bellow example we see a client is connected through two WAN connections with two broadband routers that both are use for Internet routing. We will enable and disable OSPF load balancing packets that are sourcing from the HOST to the WEB SERVER.   Following the diagram:

OSPF Load Balancing Tutorial
OSPF Load Balancing Tutorial

Now lets go our OSPF Load Balancing Configuration part………..

Router R1:

R1#
R1#conf t
R1(config)#ip cef
R1(config)#int loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit

R1(config)#int fa0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#duplex auto
R1(config-if)#speed auto
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#router ospf 1
R1(config-router)#log-adjacency-changes
R1(config-router)# network 0.0.0.0 255.255.255.255 area 0
R1(config-router)#exit 
R2(config)#exit
R2#write

Router R2:

R2#
R2#conf t
R2(config)#ip cef
R2(config)#int loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#ip ospf network point-to-point
R2(config-if)#exit

R2(config)#interface fa0/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#duplex auto
R2(config-if)#speed auto
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#int fa0/1
R2(config-if)#ip address 172.16.1.2 255.255.255.0
R2(config-if)#duplex auto
R2(config-if)#speed auto
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#router ospf 1
R2(config-router)#log-adjacency-changes
R2(config-router)#network 0.0.0.0 255.255.255.255 area 0
R2(config-router)#exit
R2(config)#exit
R2#write

Router R3:

R3#
R3#conf t
R3(config)#ip cef
R3(config)#int loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit

R3(config)#int fa0/0
R3(config-if)#ip address 10.1.1.3 255.255.255.0
R3(config-if)#duplex auto
R3(config-if)#speed auto
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#

R3(config)#int fa0/1
R3(config-if)#ip address 172.16.1.3 255.255.255.0
R3(config-if)#duplex auto
R3(config-if)#speed auto
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#

R3(config)#router ospf 1
R3(config-router)#log-adjacency-changes
R3(config-router)#network 0.0.0.0 255.255.255.255 area 0
R3(config-router)#exit
R3(config)#exit
R3#write

Router R4:

R4#
R4#conf t
R4(config)#ip cef
R4(config)#int loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
R4(config-if)#ip ospf network point-to-point
R4(config-if)#exit
R4(config)#

R4(config)#int fa0/0
R4(config-if)#ip address 172.16.1.4 255.255.255.0
R4(config-if)#duplex auto
R4(config-if)#speed auto
R4(config-if)#no shutdown
R4(config-if)#exit

R4(config)#router ospf 1
R4(config-router)#log-adjacency-changes
R4(config-router)#network 0.0.0.0 255.255.255.255 area 0
R4(config-router)#exit
R4(config)#exit
R4#write

Verify our OSPF Load balancing Configuration:

[adsense]

When i type show ip route command in router R1 then we found OSPF reach R4 via two path.

1. R1 reach R4 via R2 [via 10.1.1.2]

2. R1 reach R4 via R3 [via 10.1.1.3]

OSPF load balancing
OSPF load balancing

After we do a TRACEROUTE to the destination we can see that the packets are passing trough two routers and thus load balancing the traffic. So our configuration part is ok.

Now we disable OSPF Load Balancing by maximum-paths command.

 Router R1:

R1#conf t
R1(config)#router ospf 1
R1(config-router)#maximum-paths 1
R1(config-router)#exit
R1(config)#

Again when i type show ip route command in router R1 then we found OSPF reach R4 via one path.

OSPF load balancing maximum-paths 1
OSPF load balancing maximum-paths 1

1. R1 reach R4 via R3 [via 10.1.1.3] path

Also after we do a TRACEROUTE to the destination we can see that the packets are passing trough one routers so load balancing is not working.

OSPF can be also tuned under the interface level configuration. This can be done using the command syntax: ip load-sharing per packet. Important thing to remember is not to disable CEF on the routers, in that case you can use up all of the CPU resources. This is done , when routers needs to calculate all over again in the routing table for every load balanced network.
Feel free to comment.

Shahed

Hi! I am Shahed Israr. I try to help GPON Technology users with their queries and provide them with relevant and accurate information to the best of my ability. My main goal is to assist and enhance GPON Technology user and help people find the answers they're looking for quickly and easily.

Follow Me:
TwitterFacebookLinkedInPinterestGoogle PlusDiggYouTubeRedditDelicious

Visited 485 times, 1 visit(s) today

Comments

comments

Shahed

Hi! I am Shahed Israr. I try to help GPON Technology users with their queries and provide them with relevant and accurate information to the best of my ability. My main goal is to assist and enhance GPON Technology user and help people find the answers they're looking for quickly and easily.

View all posts by Shahed →

One thought on “OSPF Load Balancing Example

  1. If any one face bellow message in GNS3 environment,please follow bellow steps.

    %OSPF-4-ERRRCV: Received invalid packet: Bad LLS Checksum from x.x.x.x, FastEthernet0/0

    Solution:

    applying bellow command to each router interface:

    ip ospf network point-to-point
    ip ospf authentication message-digest
    ip ospf message-digest-key 1 md5 7 123456

    The above md5 digest key settings have stopped the errors from occuring.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

error: Content is protected !!