How to Configure the Gateway Load Balancing Protocol?
Gateway Load Balancing Protocol (GLBP) is the Cisco-proprietary FHRP. It also allows load sharing between a group of redundant routers. GLBP was specially designed to overcome the limitations of HSRP and VRRP.
In HSRP and VRRP, only the active/master router can forward traffic while all the standby/backup routers are idle but Gateway Load Balancing Protocol overcome this problem, all routers in the GLBP group can be efficiently utilized and forward traffic, so in addition to redundancy we also get load balancing. We can configure GLBP in the Cisco IOS router using three types of an algorithm: round-robin, weighted, or host-dependent.
The routers participating in the Gateway Load Balancing Protocol group are called Active Virtual Forwarders (AVF). Like HSRP, one router still must control the Gateway Load Balancing Protocol operation, and this router is called the Active Virtual Gateway (AVG).
An Active Virtual Gateway (AVG) is elected when GLBP is activated on the network. It decides the next AVF that will be used to forward the packet based on the selected algorithm. A router with the AVG role by default also acts as AVF at the same time.
The Gateway Load Balancing Protocol (GLBP) configuration on the Cisco router is easy and similar to the configuration of the Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP). We will use the same topology for the GLBP configuration that we used for the HSRP configuration.
Each gateway will be configured in a GLBP group with the same group number, and at least one gateway in the GLBP group must be configured with the virtual IP address to be used by the group. We can use the “glbp group ip” command to enable GLBP from the global configuration mode. The configuration on both Router2 and Router3 is as under:
Router2:
- Router2>enable
- Router2#config terminal
- Router2(config)# interface gigabitEthernet 0/1
- Router2(config-if)#no shutdown
- Router2(config-if)#ip address 192.168.10.2 255.255.255.0
- Router2(config-if)#glbp 1 ip 192.168.10.1
- Router2(config-if)glbp 1 priority 110
- Router2(config-if)#glbp preempt
- Router2(config-if)#glbp 1 load-balancing round-robin
- Router2(config-if)#exit
- Router2(config)#do wr
Router3:
- Router3>enable
- Router3#config terminal
- Router3(config)# interface gigabitEthernet 0/1
- Router3(config-if)#no shutdown
- Router3(config-if)#ip address 192.168.10.3 255.255.255.0
- Router3(config-if)#glbp 1 ip 192.168.10.1
- Router3(config-if)glbp 1 priority 100
- Router3(config-if)#glbp preempt
- Router3(config-if)#glbp 1 load-balancing round-robin
- Router3(config-if)#exit
- Router3(config)#do wr
We are using GLBP group number 1 and virtual IP 192.168.10.1, and this virtual IP address should be configured on each router. We also configured the priority for both routers to elect as AVG; the priority of Router2 is 110, and the priority of Router1 is 100. The default priority value of GLBP is 100. The router with the highest priority number will be elected as the AVG.
If the AVG fails, the next router with the highest priority value will be granted the role of AVG. Preempt is enabled on both routers, which means that they can get back the AVG role from the current AVG if they have higher priority.
We can verify GLBP configuration, using the command show glbp brief from any GLBP members. To verify GLBP configuration, we can simply issue a command show glbp brief from any of the GLBP members:
GLBP Round-Robin Algorithm
Round-robin is the default load-balancing algorithm with the Gateway Load Balancing Protocol configuration. With this algorithm, AVG replies to each ARP request for the GLBP virtual IP with each AVF’s virtual MAC address, so all AVFs are used equally.
GLBP Weighted Algorithm
The weighted algorithm allocates traffic to each AVF based on its weight value. An AVF with a bigger weight value will redirect more traffic to it.
The weighting range is from 1 to 254, and the default weight value is 100. The router with a higher weight value will be assigned more traffic to the router with a lower weight value. The configuration command for the above example scenario is as follows:
Router2:
- Router2>enable
- Router2#config terminal
- Router2(config)# interface gigabitEthernet 0/1
- Router2(config-if)#glbp 1 load-balancing weighted
- Router2(config-if)#glbp 1 weight 150
- Router2(config)#do wr
Router3:
- Router3>enable
- Router3#config terminal
- Router3(config)# interface gigabitEthernet 0/1
- Router3(config-if)#glbp 1 load-balancing weighted
- Router3(config-if)#glbp 1 weight 200
- Router3(config)#do wr
GLBP Host-Dependent
This algorithm uses the host’s MAC address to determine which virtual MAC address to direct the host to use. If the number of active virtual forwarders (AVF) does not change, this algorithm usually guarantees the same virtual MAC address that was previously assigned.
In some situations, this comes up as the best option, for example, in the case of stateful NAT. The configuration of the Gateway Load Balancing Protocol host-dependent for the above topology is as follows:
Router2:
- Router2>enable
- Router2#config terminal
- Router2(config)# interface gigabitEthernet 0/1
- Router2(config-if)#glbp 1 load-balancing host-dependant
- Router2(config)#do wr
Router3:
- Router3>enable
- Router3#config terminal
- Router3(config)# interface gigabitEthernet 0/1
- Router3(config-if)#glbp 1 load-balancing host-dependant
- Router3(config)#do wr
Advantages of Gateway Load Balancing Protocol
GLBP allows automatic selection and simultaneous use of multiple available gateways and automatic failover between those gateways. Various routers share the load of frames that, from a client viewpoint, are sent to a single default gateway address.
We can fully use network resources without the administrative burden of configuring multiple groups and managing multiple default gateway configurations. Gateway Load Balancing Protocol has the following characteristics:
- GLBP allows full use of network resources on all devices without the administrative burden of creating multiple groups.
- GLBP provides a single virtual IP address with several virtual MAC addresses.
- GLBP routes traffic to a single gateway distributed across multiple routers.
- In the event of failure and change, it provides automatic rerouting.