Today through this article i will try to show you how to configure load balancing or load sharing using static routing.I mean one can use static routing too for load-balancing.Here in this architecture we have total 3 routers R1 ,R1 and R3. When any traffic generated from R1 for R3 it can travel in two ways: In other ways you can simply say that when we want to send something from PC0 (220.127.116.11) to PC1 (18.104.22.168) our packets reach there in two ways. here in this lab there are two possible paths to travell from pc0 to pc1. The First one is R1R3 and the second one is R1R2R3.I am going to perform this lab with the help of cisco packet tracer here.So just start learning load balancing and load sharing using static route with the help of an example lab using cisco packet tracer.
so when we have two simultaneously path to send packets from source to destination that is known as load balancing.
So here for Load Balancing we need to configure two static route to reach network 22.214.171.124/8 from network 126.96.36.199/8.
keep in Mind that there are total two methods of load-balancing or Load sharing:
1. Load balancing can be per-packet based
2.Load balancing can be per-destination based.
When we say about load balancing you must be sure that load balancing and load sharing are approx same thing. Load sharing or load balancing is actually a method to divide the network traffic and sent it to destination through different links available in the network.
Now when we come to more specif Form of Load sharing and That is Load sharing through static routes then load sharing can be divided in to two Parts:
1. Equal Cost Load-sharing:
In Equal cost Load sharing using static routes a router automatically share traffic if more than one link to same destination available with equal metric.
2. Non Equal Cost Load-sharing:
In unequal-cost Load sharing static routes sends the traffic to all available links available in the network but the traffic percentage will be different across different links.
A weak link gets only 40% of the Traffic but a strong link gets the 60% of the traffic. here weak and strongs are in terms of speed usually.
configuration on Router R1:
r1(config)#ip route 188.8.131.52 255.0.0.0 184.108.40.206 r1(config)#ip route 220.127.116.11 255.0.0.0 18.104.22.168 r1(config)#ip route 22.214.171.124 255.0.0.0 126.96.36.199 r1(config)#ip route 188.8.131.52 255.0.0.0 184.108.40.206
configuration on Router R2:
R2(config)#ip route 220.127.116.11 255.0.0.0 18.104.22.168 R2(config)#ip route 22.214.171.124 255.0.0.0 126.96.36.199 R2(config)#ip route 188.8.131.52 255.0.0.0 184.108.40.206 R2(config)#ip route 220.127.116.11 255.0.0.0 18.104.22.168 R2(config)#ip route 22.214.171.124 255.0.0.0 126.96.36.199 R2(config)#ip route 188.8.131.52 255.0.0.0 184.108.40.206
configuration on Router R3:
R3(config)#ip route 220.127.116.11 255.0.0.0 18.104.22.168 R3(config)#ip route 22.214.171.124 255.0.0.0 126.96.36.199 R3(config)#ip route 188.8.131.52 255.0.0.0 184.108.40.206 R3(config)#ip route 220.127.116.11 255.0.0.0 18.104.22.168
check routing table for load balancing on router R3:
R3#show ip route S 22.214.171.124/8 [1/0] via 126.96.36.199 [1/0] via 188.8.131.52 S 184.108.40.206/8 [1/0] via 220.127.116.11 [1/0] via 18.104.22.168 C 22.214.171.124/8 is directly connected, Serial0/0/0 C 126.96.36.199/8 is directly connected, Serial0/0/1 C 188.8.131.52/8 is directly connected, FastEthernet0/0
as you ca see the first one sending the traffic through 184.108.40.206 and the second one sending the traffic through 220.127.116.11.
use ip debug command to find load balancing path.
R3#debug ip packet Packet debugging is on R3# IP: tableid=0, s=18.104.22.168 (FastEthernet0/0), d=22.214.171.124 (Serial0/0/1), routed via RIB IP: s=126.96.36.199 (FastEthernet0/0), d=188.8.131.52 (Serial0/0/1), g=184.108.40.206, len 28, forward IP: tableid=0, s=220.127.116.11 (Serial0/0/1), d=18.104.22.168 (Serial0/0/0), routed via RIB IP: s=22.214.171.124 (Serial0/0/1), d=126.96.36.199 (Serial0/0/0), g=188.8.131.52, len 28, forward IP: tableid=0, s=184.108.40.206 (Serial0/0/0), d=220.127.116.11 (FastEthernet0/0), routed via RIB IP: s=18.104.22.168 (Serial0/0/0), d=22.214.171.124 (FastEthernet0/0), g=126.96.36.199, len 28, forward
To understand Load balancing more keep few facts in Mind:
Load balancing and backup Path is two different thing.
In next tutorial i will show you how to configure Backup path using static route and What is the Difference between load balancing and backup Path.
CEF – Cisco Express Forwarding load balancing is by default using source and destination IP to calculate the hash and distribute traffic over multiple paths.
CEF is on by default, But if you find some device with CEF off like in Mine case. as you can see below cef is off on my router.
R2#show ip cef %IPv4 CEF not running
If CEF is OFF on your Router you can enable it using below command.
You can see CEF working using below command:
R2#show ip cef Prefix Next Hop Interface 0.0.0.0/0 drop Null0 (default route handler entry) 0.0.0.0/32 receive 188.8.131.52/8 attached to Serial0/0/1 attached to Serial0/0/0 184.108.40.206/8 attached Serial0/0/0 220.127.116.11/32 receive 18.104.22.168/32 receive 22.214.171.124/32 receive 126.96.36.199/8 attached to Serial0/0/1 attached to Serial0/0/0 188.8.131.52/8 attached Serial0/0/1 184.108.40.206/32 receive 220.127.116.11/32 receive 18.104.22.168/32 receive 22.214.171.124/8 attached to Serial0/0/1 attached to Serial0/0/0 126.96.36.199/4 drop 188.8.131.52/24 receive 255.255.255.255/32 receive R2#