O'Reilly logo

Cisco IOS Cookbook, 2nd Edition by Ian Brown, Kevin Dooley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gateway Load-Balancing Protocol

Problem

You want to use a first hop redundancy protocol that automatically load-balances among the participating routers.

Solution

You configure GLBP on an interface using the glbp command:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface FastEthernet0/0
Router1(config-if)#ip address 172.22.1.3 255.255.255.0
Router1(config-if)#glbp 1 ip 172.22.1.1
Router1(config-if)#exit
Router1(config)#end
Router1#

As with HSRP and VRRP, you must configure other members of the same GLBP group to use the same virtual IP address:

Router2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#interface FastEthernet0/0
Router2(config-if)#ip address 172.22.1.2 255.255.255.0
Router2(config-if)#glbp 1 ip 172.22.1.1
Router2(config-if)#exit
Router2(config)#end
Router2#

Discussion

In Recipe 22.4, we showed a way of using HSRP to load-balance between two active redundant routers on a LAN segment. There are two reasons why this solution was somewhat less than ideal, though. First, it required configuring different default gateway addresses on half of the end devices on a LAN segment. And second, the load balancing must be done by hand and is completely static. GLBP provides a much more elegant solution to the same problem that doesn’t have these shortcomings.

In the examples, we have enabled GLBP with a single command, simply defining the group number and virtual IP address:

Router1(config-if)# ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required