Gateway Load Balancing Protocol (GLBP) is a Cisco proprietary protocol that attempts to overcome the limitations of existing redundant router protocols by adding basic load balancing functionality.

In addition to being able to set priorities on different gateway routers, GLBP allows a weighting parameter to be set. Based on this weighting (compared to others in the same virtual router group), ARP requests will be answered with MAC addresses pointing to different routers. Thus, load balancing is not based on traffic load, but rather on the number of hosts that will use each gateway router. By default GLBP load balances in round-robin fashion.

GLBP elects one AVG (Active Virtual Gateway) for each group. Other group members act as backup in case of AVG failure. In case there are more than two members, the second best AVG is placed in the Standby state and all other members are placed in the Listening state. This is monitored using hello and holdtime timers, which are 3 and 10 seconds by default. The elected AVG then assigns a virtual MAC address to each member of the GLBP group, including itself, thus enabling AVFs (Active Virtual Forwarders). Each AVF assumes responsibility for forwarding packets sent to its virtual MAC address. There could be up to four active AVFs at the same time.

By default, GLBP routers use the local multicast address 224.0.0.102 to send hello packets to their peers every 3 seconds over UDP 3222 (source and destination).

Lets now start with our topology. Here PC1,PC2,PC3 and PC4 routing is disabled with “no ip routing” and all are pointing towards the GLBP assigned address 10.0.0.254, which is assigned on the LAN interface of R1 and R2 pointing towards end hosts. Additionally R1(AS-12) is connected to ISP1(AS-501) and R2(AS-12) is connected to ISP2(502) . I have not configured R1 and R2 to be an IBGP neighbor, although R1 and R2 both receiving same routes from ISP1 and ISP2.

Pre-configurations of all devices.

PC1,PC2,PC3 and PC4 have addresses in range 10.0.0.0/24 and ip routing is disabled and default-gateway is configured to be 10.0.0.254(GLBP address) assigned on Fastethernet0/0 interface of R1 and R2.

Sample config of PC1

PC1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
end
PC1#sh run | i default
ip default-gateway 10.0.0.254
PC1#sh ip route
Default gateway is 10.0.0.254

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

R1

R1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.101 255.255.255.0
glbp 1 ip 10.0.0.254
R1#sh run int S0/0
interface Serial0/0
ip address 11.11.11.1 255.255.255.0
R1#sh run | s bgp
router bgp 12
no synchronization
bgp log-neighbor-changes
neighbor 11.11.11.254 remote-as 501
no auto-summary
R1#sh ip bgp summ | b Nei
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
11.11.11.254    4   501      35      31                     5          0      0         00:28:31                    4
R1#sh ip bgp | b Network
Network          Next Hop            Metric LocPrf Weight Path
*> 33.33.33.1/32    11.11.11.254             0             0 501 i
*> 33.33.33.2/32    11.11.11.254             0             0 501 i
*> 33.33.33.3/32    11.11.11.254             0             0 501 i
*> 33.33.33.4/32    11.11.11.254             0             0 501 i

R2

R2#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.102 255.255.255.0
glbp 1 ip 10.0.0.254
R2#sh run int s0/0
interface Serial0/0
ip address 22.22.22.2 255.255.255.0
R2#sh run | s bgp
router bgp 12
no synchronization
bgp log-neighbor-changes
neighbor 22.22.22.254 remote-as 502
no auto-summary
R2#sh ip bgp summ | b Neighbor
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
22.22.22.254    4   502      38      34                5               0    0       00:31:42                   4
R2#sh ip bgp  | b Network
Network          Next Hop            Metric LocPrf Weight Path
*> 33.33.33.1/32    22.22.22.254             0             0 502 i
*> 33.33.33.2/32    22.22.22.254             0             0 502 i
*> 33.33.33.3/32    22.22.22.254             0             0 502 i
*> 33.33.33.4/32    22.22.22.254             0             0 502 i

ISP1

ISP1#sh run int s0/0
interface Serial0/0
ip address 11.11.11.254 255.255.255.0
ISP1#sh run | s bgp
router bgp 501
no synchronization
bgp log-neighbor-changes
network 33.33.33.1 mask 255.255.255.255
network 33.33.33.2 mask 255.255.255.255
network 33.33.33.3 mask 255.255.255.255
network 33.33.33.4 mask 255.255.255.255
neighbor 11.11.11.1 remote-as 12
no auto-summary
ISP1#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 11.11.11.1

ISP2

ISP2#sh run int s0/0
interface Serial0/0
ip address 22.22.22.254 255.255.255.0
ISP2#sh run | s bgp
router bgp 502
no synchronization
bgp log-neighbor-changes
network 33.33.33.1 mask 255.255.255.255
network 33.33.33.2 mask 255.255.255.255
network 33.33.33.3 mask 255.255.255.255
network 33.33.33.4 mask 255.255.255.255
neighbor 22.22.22.2 remote-as 12
no auto-summary
ISP2#sh run | i ip route
ip route 0.0.0.0 0.0.0.0 22.22.22.2

Now lets start with the verifications of GLBP. As we have not configured any fancy stuffs so far in GLBP , lets check the output of “show glbp” on R1 and R2 respectively.

R1#sh glbp
FastEthernet0/0 – Group 1
State is Standby                      —>>This is standby AVG as this has the lower ip address assigned similar to HSRP or VRRP.
1 state change, last state change 00:29:49
Virtual IP address is 10.0.0.254
Hello time 3 sec, hold time 10 sec
Next hello sent in 1.772 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Preemption disabled     —>>Preemption is disabled by default similar to HSRP, only VRRP has preepmtion enabled by default.
Active is 10.0.0.102, priority 100 (expires in 7.136 sec) –>>This is pointing towards the Active Gateway that is R2.
Standby is local                     —>>R1 is  standby AVG.
Priority 100 (default)              —>>Default priority.
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
Group members:
c200.1550.0000 (10.0.0.101) local       —>>AVF’s and there respective MAC addresses.(R1)
c201.1550.0000 (10.0.0.102)                  —>>AVF’s and there respective MAC addresses.(R2)
There are 2 forwarders (1 active)
Forwarder 1
State is Listen
MAC address is 0007.b400.0101 (learnt)
Owner ID is c201.1550.0000       –>>AVF is R1, this is in listen state means this will answer the next ARP response.
Time to live: 14397.124 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 10.0.0.102 (primary), weighting 100 (expires in 8.780 sec)
Forwarder 2
State is Active
1 state change, last state change 00:29:58
MAC address is 0007.b400.0102 (default)
    Owner ID is c200.1550.0000      —>>AVF is R2 and this is Active means this will answer the ARP.
Preemption enabled, min delay 30 sec
Active is local, weighting 100

R2#sh glbp
FastEthernet0/0 – Group 1
State is Active           —>>This is AVG as this has the higher ip address assigned similar to HSRP or VRRP.
2 state changes, last state change 00:30:42
Virtual IP address is 10.0.0.254
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.372 secs
Redirect time 600 sec, forwarder timeout 14400 sec
Preemption disabled     —>>Preemption is disabled by default similar to HSRP, only VRRP has preepmtion enabled by default.
Active is local             —>> This indicated that this is AVG for this group.
Standby is 10.0.0.101, priority 100 (expires in 9.024 sec)
Priority 100 (default)     —>>Priority of all FHRP’s by default is 100.
Weighting 100 (default 100), thresholds: lower 1, upper 100        —>>Default config of GLBP.
  Load balancing: round-robin                                                                         —>>Default load-balancing of GLBP.
Group members:
c200.1550.0000 (10.0.0.101)                               —>>AVF’s and there respective MAC addresses.(R1)
    c201.1550.0000 (10.0.0.102) local                    —>>AVF’s and there respective MAC addresses.(R2)
There are 2 forwarders (1 active)
Forwarder 1
State is Active
1 state change, last state change 00:30:32
MAC address is 0007.b400.0101 (default)
Owner ID is c201.1550.0000                                     —>>AVF is R2 and this is Active means this will answer the ARP.
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Client selection count: 2
Forwarder 2
State is Listen
MAC address is 0007.b400.0102 (learnt)
Owner ID is c200.1550.0000   —>>AVF is R1,this is in listen state means this will answer the next ARP response.
Redirection enabled, 597.904 sec remaining (maximum 600 sec)
Time to live: 14397.904 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 10.0.0.101 (primary), weighting 100 (expires in 7.900 sec)
Client selection count: 2

So far so good, so we are doing some Load balancing out here, but really are we doing, how can we check.The easy way to check is from pinging from our end hosts Pc1 through Pc4 and see do we actually distributing the load, as seen in the above output.

Lets start.

Pc1

PC1#ping 33.33.33.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/241/1080 ms
PC1#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0101  ARPA   FastEthernet0/0      —>>AVF is R2.

PC2

PC2#ping 33.33.33.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/241/1064 ms
PC2#sh arp  | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0102  ARPA   FastEthernet0/0       —>>AVF is R1.

PC3

PC3#ping 33.33.33.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/231/1060 ms
PC3#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0101  ARPA   FastEthernet0/0     —>>AVF is R2.

PC4

PC4#ping 33.33.33.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/233/1056 ms
PC4#sh arp | i 10.0.0.254
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.254              0   0007.b400.0102  ARPA   FastEthernet0/0     —>>AVF is R1.

So the output is quite promising we have sent twenty packets as a whole towards our destinations and 10 packets are routed via R1 and 10 packets are routed via R2. As the default Load Balancing in GLBP is round-robin as we have seen in the output of “show glbp” it means the forwarding engine inside the GLBP will serve packets one after another in a round robin fashion. As evident from the output.

Now lets modify some of the outputs,Here our connections to ISP1 and ISP2 are both T1 means (BW 1544 Kbit), now lets say the connection to ISP1 from R1 is DS3 channel(45 Mbps), and now we want packets are more likely to be forwarded towards R1 in comparison to R2.Lets modify the weighting and watch the results.

For actually test the load-balancing we need to create an extended access-list on R1 and R2, that we can use for packet counters, and ping from our end hosts PC1 through PC4, and change configurations on R1 accordingly as this the faster link so i have increased weighting of R1 as double than R2 and decreased the Forwarder preempt delay from Default 30 seconds to 1 second on R1.So the final config on R1 is.

R1

R1#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.101 255.255.255.0
ip access-group 100 in
duplex auto
speed auto
glbp 1 ip 10.0.0.254
 glbp 1 weighting 210 lower 195 upper 205  —>>This side weighting is twice than R1(100 default).
 glbp 1 load-balancing weighted          —>>This will change the default LB from Round-Robin to Weighted.
 glbp 1 forwarder preempt delay minimum 1   —>>The forwarder preemtion delay is minimum to 1 sec.
end

R2

R2#sh run int fa0/0
interface FastEthernet0/0
ip address 10.0.0.102 255.255.255.0
ip access-group 100 in
duplex auto
speed auto
glbp 1 ip 10.0.0.254
glbp 1 load-balancing weighted          —>>This will change the default LB from Round-Robin to Weighted.
 glbp 1 forwarder preempt delay minimum 1   —>>The forwarder preemtion delay is minimum to 1 sec.
end

The access-list 100 is used as packet counter and applied inbound on R1 and R2, the config is below.

access-list 100 permit icmp any any echo
access-list 100 permit ip any any
access-list 100 deny   ip any any log

Now lets start pinging from PC1 through PC4 with repeat count of 1000 each.

PC1#ping 33.33.33.1 re 1000

PC2#ping 33.33.33.2 re 1000

PC3#ping 33.33.33.3 re 1000

PC4#ping 33.33.33.4 re 1000

Now lets see the result on R1 and R2 by using access-list that we have made for packet counters.

R1#sh access-l
Extended IP access list 100
10 permit icmp any any echo (3000 matches)
20 permit ip any any (195 matches)
30 deny ip any any log

R2#sh access-l
Extended IP access list 100
10 permit icmp any any echo (1000 matches)
20 permit ip any any (189 matches)
30 deny ip any any log

Voila, the results are quite good as we can see total 4000 packets sent out of which 3000 packets are forwarded by R1 and 1000 packets are forwarded by R2. Its really hard to simulate actual load-balancing in GLBP, also if we can refer to Cisco DOC-CD GLBP the load balancing algorithm is not well documented here.

We can configure authentication and tracking, same as we use in HSRP and VRRP, the configurations are almost same only we need to replace key word glbp in GLBP by standby in HSRP or vrrp in VRRP, rest are same.

Good resources to look for GLBP.

INE BLOG  :-  GLBP Explained

Cisco Site apart from DOC-Cd  :- GLBP