Cisco device configuration tutorials and networking fundamentals
Cisco configuration tutorials
Jump to section:
The Gateway Load Balancing Protocol (GLBP) ensures two or more gateway routers can share a single virtual IP address which is used as the default gateway by hosts in a Local Area Network (LAN). Although a single gateway IP address is configured on the hosts, GLBP uses different virtual MAC addresses to enable load balancing of traffic between each individual router.
With GLBP each participating router is an Active Virtual Forwarder (AVF). This means, the Active Virtual Gateway (AVG) assigns a different virtual MAC address to each AVF. The AVG is the only GLBP router that replies to ARP requests. By sending ARP replies with a different virtual MAC address, GLBP is able to provide load balancing. This is shown in the following packet capture.
The AVG can decide what type of load balancing algorithm to use. By default, the AVG assigns vMAC addresses with the Round Robin method, which means each consecutive ARP reply contains the vMAC address of a different AVF.
For example, if there are two AVFs, the vMAC in the ARP replies alternates between the two available addresses, as seen in the above packet capture. Other load balancing options are host-dependent and weighted (discussed later in this blog post).
R1> R1>enable R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)#interface Gi0/0 R1(config-if)#glbp 10 load-balancing ? host-dependent Load balance equally, source MAC determines forwarder choice round-robin Load balance equally using each forwarder in turn weighted Load balance in proportion to forwarder weighting <cr> <cr>
The following packet capture shows a GLBP Hello message which contains important details about the protocol. It is visible that GLBP uses the multicast IP address 224.0.0.102 and encapsulates control packets with a UDP header using port number 3222. GLBP supports authentication with plain text password or md5 hash, and including authentication with a key-chain. The GLBP AVG default priority is 100. The default Hello and Hold time is 3 seconds and 10 seconds respectively.
In the following example scenario, GLBP Group 10 is configured between R1 and R2. The AVG is R1, and it assigns the vMAC address 0007.b400.0a01 to itself, and uses 0007.b400.0a02 for R2. Both R1 and R2 are AVFs. An authentication key chain is configured together with GLBP for added security. The vIP address 10.0.0.1 is used, and it is configured as a static default route on the Host.
Notice in R1's configuration the command glbp 10 priority 200 makes R1 the AVG. A higher priority will be more preferred. By default, each router has an AVG priority of 100 in which case the AVG election process selects the router with the highest interface IP address. This command and election process is independent from the AVF priority or weighting.
Configuration:
R1#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** ip address 10.0.0.2 255.255.255.0 glbp 10 ip 10.0.0.1 glbp 10 timers msec 400 msec 800 glbp 10 priority 200 glbp 10 authentication md5 key-chain EXAMPLE-KEYCHAIN duplex auto speed auto media-type rj45 R1#show run | sec ^key chain key chain EXAMPLE-KEYCHAIN key 1 key-string P4SSW0RD R1#show run int Gi0/1 | sec int interface GigabitEthernet0/1 description ** to internet ** ip address 172.16.1.1 255.255.255.252 duplex auto speed auto media-type rj45 R1#show run | sec ^ip route ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/1 172.16.1.2
R2#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** ip address 10.0.0.3 255.255.255.0 glbp 10 ip 10.0.0.1 glbp 10 timers msec 400 msec 800 glbp 10 priority 150 glbp 10 authentication md5 key-chain EXAMPLE-KEYCHAIN duplex auto speed auto media-type rj45 R2#show run | sec ^key chain key chain EXAMPLE-KEYCHAIN key 1 key-string P4SSW0RD R2#show run int Gi0/1 | sec int interface GigabitEthernet0/1 description ** to internet ** ip address 172.16.2.1 255.255.255.252 duplex auto speed auto media-type rj45 R2#show run | sec ^ip route ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/1 172.16.2.2
Host#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to R2 and R3 ** ip address 10.0.0.4 255.255.255.0 duplex auto speed auto media-type rj45 Host#show run | sec ^ip route ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0 10.0.0.1
R1#show glbp brief Interface Grp Fwd Pri State Address Active router Standby router Gi0/0 10 - 200 Active 10.0.0.1 local 10.0.0.3 « AVG has priority 200 configured Gi0/0 10 1 - Active 0007.b400.0a01 local - « Virtual MAC address assigned to AVG Gi0/0 10 2 - Listen 0007.b400.0a02 10.0.0.3 - R1#show glbp GigabitEthernet0/0 - Group 10 State is Active 1 state change, last state change 03:07:25 Virtual IP address is 10.0.0.1 « GLBP Virtual IP address Hello time 400 msec, hold time 800 msec « GLBP Hello and Hold time Next hello sent in 0.160 secs Redirect time 600 sec, forwarder timeout 14400 sec Authentication MD5, key-chain "EXAMPLE-KEYCHAIN" « Authentication with key-chain is configured Preemption disabled Active is local Standby is 10.0.0.3, priority 150 (expires in 0.608 sec) « Backup AVG is R2, has priority 150 Priority 200 (configured) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin « Default load balancing method is used Group members: 5254.0001.1c1c (10.0.0.3) authenticated 254.0006.af56 (10.0.0.2) local « Real (burned in/bia) MAC address of the AVG There are 2 forwarders (1 active) Forwarder 1 « Details about the AVF 1 (it is actually the AVG) State is Active 1 state change, last state change 03:07:13 MAC address is 0007.b400.0a01 (default) Owner ID is 5254.0006.af56 Redirection enabled Preemption enabled, min delay 30 sec Active is local, weighting 100 Client selection count: 3 Forwarder 2 « Details about AVF 2, this is R2 State is Listen MAC address is 0007.b400.0a02 (learnt) Owner ID is 5254.0001.1c1c Redirection enabled, 599.808 sec remaining (maximum 600 sec) Time to live: 14399.808 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is 10.0.0.3 (primary), weighting 100 (expires in 0.672 sec) Client selection count: 2 Host#trace 172.16.0.1 probe 1 Type escape sequence to abort. Tracing the route to 172.16.0.1 VRF info: (vrf in name/id, vrf out name/id) 1 10.0.0.2 3 msec « Host uses R1 as its next-hop 2 172.16.1.2 6 msec 3 172.16.0.1 10 msec Host#show arp Protocol Address Age (min) Hardware Addr Type Interface Internet 10.0.0.1 190 0007.b400.0a01 ARPA GigabitEthernet0/0 « AVG provided vMAC of itself (AVF 1) to the Host Internet 10.0.0.2 195 5254.0006.af56 ARPA GigabitEthernet0/0 Internet 10.0.0.3 189 5254.0001.1c1c ARPA GigabitEthernet0/0 Internet 10.0.0.4 - 5254.0016.d0fb ARPA GigabitEthernet0/0
In the following example scenario, GLBP for IPv6 is configured. The AVG is R1 configured with a priority of 120. The GLBP virtual IPv6 address is a link-local address which is autoconfigured based on the GLBP vMAC address 0007.b400.0a00. The vIP address is advertised to the Host using Neighbor Discovery Protocol (NDP) Router Advertisement messages.
The interface-level comand ipv6 nd router-preference High is configured on both routers to set the Router Preference in RA messages, and ensure the GLBP vIP address is installed on the Host. Both routers are active forwarders (AVF). GLBP IPv6 control packets are sent to the multicast address FF02::66. The GLBP vMAC address is provided through NDP Neighbor Advertisement messages (instead of ARP in IPv4).
Configuration:
R1#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** no ip address glbp 10 ipv6 autoconfig glbp 10 priority 120 glbp 10 authentication md5 key-string P4SSW0RD duplex auto speed auto media-type rj45 ipv6 address FE80::2 link-local ipv6 address 2001:DB8::2/64 ipv6 nd router-preference High R1#show run int Gi0/1 | sec int interface GigabitEthernet0/1 description ** to internet ** no ip address duplex auto speed auto media-type rj45 ipv6 address 2001:DB8:1::1/64 R1#show run | sec ^ipv6 route ipv6 route ::/0 GigabitEthernet0/1 2001:DB8:1::2 R1#show run | sec ^ipv6 unicast ipv6 unicast-routing
R2#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** no ip address glbp 10 ipv6 autoconfig glbp 10 authentication md5 key-string P4SSW0RD duplex auto speed auto media-type rj45 ipv6 address FE80::3 link-local ipv6 address 2001:DB8::3/64 ipv6 nd router-preference High R2#show run int Gi0/1 | sec int interface GigabitEthernet0/1 description ** to internet ** no ip address duplex auto speed auto media-type rj45 ipv6 address 2001:DB8:2::1/64 R2#show run | sec ^ipv6 route ipv6 route ::/0 GigabitEthernet0/1 2001:DB8:2::2 R2#show run | sec ^ipv6 unicast ipv6 unicast-routing
Host#show run int Gi0/0 | sec int
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
ipv6 address autoconfig default
ipv6 enable
R1#show glbp brief Interface Grp Fwd Pri State Address Active router Standby router Gi0/0 10 - 120 Active FE80::7:B4FF:FE00:A00 « GLBP virtual IPv6 address local FE80::3 Gi0/0 10 1 - Active 0007.b400.0a01 local - Gi0/0 10 2 - Listen 0007.b400.0a02 FE80::3 - R1#show glbp GigabitEthernet0/0 - Group 10 State is Active 1 state change, last state change 01:41:37 Virtual IP address is FE80::7:B4FF:FE00:A00 (auto-configured) « GLBP virtual IPv6 address is autoconfigured Hello time 3 sec, hold time 10 sec Next hello sent in 0.256 secs Redirect time 600 sec, forwarder timeout 14400 sec Authentication MD5, key-string « GLBP IPv6 authentication is configured Preemption disabled Active is local Standby is FE80::3, priority 100 (expires in 8.960 sec) Priority 120 (configured) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin Group members: « Two AVF routers participate in GLBP Group 10 5254.0000.e516 (FE80::2) local 5254.000f.0541 (FE80::3) authenticated There are 2 forwarders (1 active) Forwarder 1 State is Active 1 state change, last state change 01:41:26 MAC address is 0007.b400.0a01 (default) « GLBP vMAC of AVF1 Owner ID is 5254.0000.e516 Redirection enabled Preemption enabled, min delay 30 sec Active is local, weighting 100 Client selection count: 4 Forwarder 2 State is Listen MAC address is 0007.b400.0a02 (learnt) « GLBP vMAC of AVF2 Owner ID is 5254.000f.0541 Redirection enabled, 598.976 sec remaining (maximum 600 sec) Time to live: 14398.976 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is FE80::3 (primary), weighting 100 (expires in 10.560 sec) Client selection count: 3 Host#show ipv6 route IPv6 Routing Table - default - 4 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1 OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid lA - LISP away, a - Application ND ::/0 [2/0] via FE80::7:B4FF:FE00:A00, GigabitEthernet0/0 « GLBP virtual IPv6 address learned on the Host NDp 2001:DB8::/64 [2/0] via GigabitEthernet0/0, directly connected L 2001:DB8::5054:FF:FE11:8B1/128 [0/0] via GigabitEthernet0/0, receive L FF00::/8 [0/0] via Null0, receive Host#show ipv6 route ::/0 Routing entry for ::/0 Known via "ND", distance 2, metric 0 « Neighbor Discovery Protocol advertises the GLBP IPv6 address Route count is 1/1, share count 0 Routing paths: FE80::7:B4FF:FE00:A00, GigabitEthernet0/0 From FE80::7:B4FF:FE00:A00 Last updated 01:32:20 ago Host#trace 2001:DB8:A::1 Type escape sequence to abort. Tracing the route to 2001:DB8:A::1 1 2001:DB8::3 2 msec 2 msec 1 msec 2 2001:DB8:2::2 3 msec 2 msec 4 msec 3 2001:DB8:A::1 3 msec 2 msec 2 msec
In the following example scenario, GLBP weighting is configured so that more hosts prefer the AVF R2 as their default gateway device. Specifically, R2 is assigned a weight of 200, while R1 uses the default GLBP weight 100. This means, the AVG (R1) replies to ARP requests with the vMAC of R2 twice as often as the vMAC of R1. As a result, twice as many hosts prefer to send traffic through R2 as opposed to R1.
Configuration:
R1#show run int Gi0/0 | sec int
interface GigabitEthernet0/0
description ** to Site 1 **
ip address 10.0.0.2 255.255.255.0
glbp 10 ip 10.0.0.1
glbp 10 timers msec 400 msec 800
glbp 10 priority 200
glbp 10 load-balancing weighted
duplex auto
speed auto
media-type rj45
R2#show run int Gi0/0 | sec int
interface GigabitEthernet0/0
description ** to Site 1 **
ip address 10.0.0.3 255.255.255.0
glbp 10 ip 10.0.0.1
glbp 10 timers msec 400 msec 800
glbp 10 priority 150
glbp 10 weighting 200
glbp 10 load-balancing weighted
duplex auto
speed auto
media-type rj45
R1#show glbp GigabitEthernet0/0 - Group 10 State is Active 1 state change, last state change 05:14:38 Virtual IP address is 10.0.0.1 Hello time 400 msec, hold time 800 msec Next hello sent in 0.128 secs Redirect time 600 sec, forwarder timeout 14400 sec Preemption disabled Active is local Standby is 10.0.0.3, priority 150 (expires in 0.576 sec) Priority 200 (configured) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: weighted « Weighted load balancing is used Group members: 5254.0001.1c1c (10.0.0.3) 5254.0006.af56 (10.0.0.2) local There are 2 forwarders (1 active) Forwarder 1 State is Active 1 state change, last state change 05:14:26 MAC address is 0007.b400.0a01 (default) Owner ID is 5254.0006.af56 Redirection enabled Preemption enabled, min delay 30 sec Active is local, weighting 100 « Default weight is 100 Client selection count: 7 « vMAC of R1 was provided to 7 hosts via ARP reply Forwarder 2 State is Listen 2 state changes, last state change 00:13:52 MAC address is 0007.b400.0a02 (learnt) Owner ID is 5254.0001.1c1c Redirection enabled, 599.776 sec remaining (maximum 600 sec) Time to live: 14399.776 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is 10.0.0.3 (primary), weighting 200 (expires in 0.608 sec) « Weight 200 is configured Client selection count: 12 « vMAC of R2 was provided to 12 hosts via ARP reply
In the following example scenario, R1 and R2 have the default weight 100 assigned and are active forwarders (AVF). The AVG R1 uses the Round Robin load balancing method and alternates between two active vMAC addresses when replying to ARP requests. This means, both routers actively forward traffic and if any of the WAN links goes down a proactive method of AVF switchover needs to take place.
This is ensured with object tracking and IP SLA. Each router monitors its next-hop WAN address with an ICMP-echo IP SLA. If the next-hop is not reachable, the IP SLA and tracked object goes down, and the AVF weight decreases from 100 to 90. Each router gives up its active forwarder role if the weight is below 95, and the other AVF assumes the role for both vMAC addresses with a preempt delay of 1 second.
Configuration:
R1#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** ip address 10.0.0.2 255.255.255.0 glbp 10 ip 10.0.0.1 glbp 10 timers msec 400 msec 800 glbp 10 priority 200 glbp 10 weighting 100 lower 95 glbp 10 weighting track 1 decrement 10 glbp 10 forwarder preempt delay minimum 1 duplex auto speed auto media-type rj45 R1#show run | sec ^ip sla ip sla 10 icmp-echo 172.16.1.2 threshold 1000 timeout 1000 frequency 1 ip sla schedule 10 life forever start-time now R1#show run | sec ^track track 1 ip sla 10
R2#show run int Gi0/0 | sec int interface GigabitEthernet0/0 description ** to Site 1 ** ip address 10.0.0.3 255.255.255.0 glbp 10 ip 10.0.0.1 glbp 10 timers msec 400 msec 800 glbp 10 priority 150 glbp 10 weighting 100 lower 95 glbp 10 weighting track 1 decrement 10 glbp 10 forwarder preempt delay minimum 1 duplex auto speed auto media-type rj45 R2#show run | sec ^ip sla ip sla 10 icmp-echo 172.16.2.2 threshold 1000 timeout 1000 frequency 1 ip sla schedule 10 life forever start-time now R2#show run | sec ^track track 1 ip sla 10
R1#show glbp brief Interface Grp Fwd Pri State Address Active router Standby router Gi0/0 10 - 200 Active 10.0.0.1 local 10.0.0.3 Gi0/0 10 1 - Listen 0007.b400.0a01 10.0.0.3 - « After R1 WAN link failure, it is no longer an AVF Gi0/0 10 2 - Listen 0007.b400.0a02 10.0.0.3 - R2#show glbp brief Interface Grp Fwd Pri State Address Active router Standby router Gi0/0 10 - 150 Standby 10.0.0.1 10.0.0.2 local Gi0/0 10 1 - Active 0007.b400.0a01 local - « After R1 WAN link failure, R2 become AVF for both vMAC addresses Gi0/0 10 2 - Active 0007.b400.0a02 local - R1#show log | beg Log Buffer Log Buffer (8192 bytes): GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 167 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 167 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 %TRACK-6-STATE: 1 ip sla 10 state Up -> Down GLBP: Gi0/0 10 Track 1 object changed, state Up -> Down GLBP: Gi0/0 10 Weighting 100 -> 90 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Active pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VF 2 Active pri 135 vMAC 0007.b400.0a02 GLBP: Gi0/0 10.2 Active: i/Hello rcvd from higher pri Active router (135/10.0.0.3) GLBP: Gi0/0 10.2 Active -> Listen %GLBP-6-FWDSTATECHANGE: GigabitEthernet0/0 Grp 10 Fwd 2 state Active -> Listen GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 VF 2 Active pri 135 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Listen pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 VF 2 Active pri 135 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello out VG Active pri 200 vIP 10.0.0.1 hello 400, hold 800 VF 2 Listen pri 39 vMAC 0007.b400.0a02 GLBP: Gi0/0 Grp 10 Hello in VG Standby pri 150 vIP 10.0.0.1 hello 400, hold 800 VF 1 Active pri 167 vMAC 0007.b400.0a01 VF 2 Active pri 135 vMAC 0007.b400.0a02 [...]
In the above GLBP debug logs from R1 it is first visible how the track object goes down and the GLBP weight decreases from 100 to 90. Next, R1 sends GLBP Hello messages with an AVF priority of 39 (and with a weight of 90). Then, the Virtual Forwarder 2 (AVF R2) sends a GLBP Hello with an AVF priority of 135 which overrides the AVF priority of R1 (39). Finally, the VF R2 becomes the AVF for both vMAC addresses.
Disclaimer: You download and use files from networkstudysite.com at your own risk.
Packet captures:
How to use these files:
Learn more in this short guide.
Explore 313 packet captures
You can find more information at the following external links:
By clicking on the links below, you are leaving the networkstudysite.com website.
Cisco - GLBP - Gateway Load Balancing Protocol
Cisco - Cisco GLBP Load Balancing Options
Cisco Community - GLBP in depth guid
Cisco Community - GLBP AVF Priority
Disclaimer:
Use at your own risk: networkstudysite.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information found on this website. Full disclaimer on the About page.
Privacy Policy:
networkstudysite.com does not install browser cookies to collect or store your data.
Thank you for your interest in this blog post!
Looking for something else? View infographics, explore the archives or read the recommended posts below: