注意GLBP是CISCO专有的,而且目前只能在Catalyst 6500 Supervisor 720的CiscoIOS软件版本12.2(14)SX中使用。
############### GLBP的知识点说明 ####################
HSRP和VRRP要想同一子网实现Load-Balancing,必须在各个设备的同一接口下配置多个Groups,分配不同的IP地址(作为Client'sGateWay),不同的设备分别为不同Group的主(Active orMaster),同一子网内不同用户组必须指定不同的GateWay以实现匀衡负载。
GIBP解决了上述问题,各个设备的接口下只要配置一个Group,一个IP地址,就会在各设备间自动进行匀衡负载,同一子网所有用户都是同一个GateWay。实现方法:用户对GateWay进行ARP请求时,GLBP会自动用同组内不同设备的MAC来响应,对用户来完全是透明的。
GLBP同HSRP一样有:Active(只有一个) ,Standby(只有一个) ,Listen(可多个)状态
总之:HSRP和VRRP提供的一个Gateway,只能对应一台设备(除非它出了问题,由其他一台来代替它);
GLBP提供的一个GateWay,能同时最多对应四台设备,自动根据配置在设备间匀衡负载。多四台时,多的作为备用。
BLBP的默认设置及相关取值范围:
Default Vlaues
Priority = 100 ,自动一次减少10:
Hello timer 3sec ,Holdtimer 10sec
Weight = 100 ,自动一次减少10
Preempt-Delay-Minimum= 0 sec
默认没有抢占性
Weight-Threshold-Lower = 1
Weight-Threshold-Upper = Weight-Setting
(AVF的实际Weight在这两个值之外时,就不工作了,即AVG认为它不能成为AVF)
Load-Balancing = Round-Robin
MultiCast = 224.0.0.102
UDP = 3222 (source anddestination)
Forwarder Preempt-Delay-Minimun = 30 sec
(一个AVF处于不能转发的Threshold值30秒后,将被备用AVF代替,此功能默认开启,可关闭。
即此功能是根据 Weight来抢占的)
范围:
Group = 0-1023
Priority = 1-255
Weight = 1-254
Preempt-Delay-Minimum = 0 - 3600 sec
Hello timer = 1-60 sec ( msec 50 - 60000)
Hold timer = 2-180 sec ( msec 70 - 180000)
Forwarder Preempt-Delay-Minimun = 0 - 3600sec
AVG --- Active Virtual Gateway
在一个GLBP的Group中,Priority最高(同优先能时,最大IP地址)的成为AVG;
由它负责:
1.为Group中的成员分配Virtaul MAC;
2.响应用户对GateWay的ARP请求,并根据自己的匀衡负载配置,向用户提供相应Virtual MAC;
3.为每个AVF指定一个后备的组中成员。
(这样这个AVF不工作时,将由后备设备自动代替它工作,用户完成透明)
AVF --- Active Virtual Forwarder
负责发送指向自己Virtual MAC的用户的数据,AVG同时亦是AVF
AVF用Hello发现AVG后,自动向AVG请求一个Virtual MAC。
GLBP Load Balancing
1.Round-Robin
在所有AVF间轮循,所以同一用户在不同的时间里可能由不同AVF来服务。
2.Weighted
根据Weight大小决定负载的多少,大的,就会多些机会负载。同一用户的同一应用程序处理过程中,
可能由不同的AVF来服务。
3.Host-Dependent
用户请求到某一个AVF后,一直由这个AVF为他服务。
Enabling GLBP
使GLBP从Disable变为开始工作,就给这个GLBP组指定(或学习)IP地址。这点同HSRP和VRRP都相同。
AVG必须要指定IP地址,AVF可以从AVG学到IP地址(Standby AVG最好就指定IP地址)
GLBP Client Cache
默认此功能是Disable的,每个GLBP组最多可存2000个用户,此功能只能在AVG上。
(所要内存为:至少20* 2000 + 3200 个 Bytes,用来保存用户MAC与AVF的对应及相关信息)
命令:
GLBP group-number Client-cache Maximun host-number[Timeout timeout-number]
Timeout用来指定条目保存的时间
host-number = 8-2000
timeout-number = 1-1440 minutes
SHOW GLBP Detail
###############################################################
sw1(config-if)#do sh glb
Vlan10 - Group 123
State is Active
2 statechanges, last state change 00:00:25
Virtual IP address is 192.168.10.254
Hello time 4 sec, hold time 8 sec
Next hellosent in 2.748 secs
Redirect time 5 sec, forwarder time-out 700sec
Authentication MD5, key-chain"HSRP-VLAN-10"
Preemption enabled, min delay 5 sec
Active is local
Standby is unknown
Priority 255 (configured)
Weighting 150 (configured 150), thresholds:lower 50, upper 150
Track object10 state Up decrement 51
Track object20 state Up decrement 51
Load balancing: round-robin
IP redundancy name is "GLBP-VLAN-10"
Group members:
cc00.09c0.0000 (192.168.10.250) local
There is 1 forwarder (1 active)
Forwarder 1
State isActive
1 state change, last state change 00:00:17
MAC addressis 0007.b400.7b01 (default)
Owner ID iscc00.09c0.0000
Redirectionenabled
Preemptionenabled, min delay 5 sec
Active islocal, weighting 150
sw1#show run int vlan 10
Building configuration...
Current configuration : 499 bytes
!
interface Vlan10
ip address 192.168.10.250 255.255.255.0
no ip proxy-arp
ip nat inside
ip virtual-reassembly
glbp 123 ip 192.168.10.254
glbp 123 timers 4 8
glbp 123 timers redirect 5 700
glbp 123 priority 255
glbp 123 preempt delay minimum 5
glbp 123 weighting 150 lower 50
glbp 123 authentication md5 key-chainHSRP-VLAN-10
glbp 123 name GLBP-VLAN-10
glbp 123 weighting track 10 decrement 51
glbp 123 weighting track 20 decrement 51
glbp 123 forwarder preempt delay minimum 5
end
####################
# debub ip packet detail
*Mar 1 00:45:33.355: IP: s=192.168.10.250(local), d=224.0.0.102 (Vlan10), len 120, sendingbroad/multicast
*Mar 100:45:33.359: UDP src=3222, dst=3222
**************
*Mar 1 01:13:28.007: GLBP: Vl10 Grp 123Hello in 192.168.10.252 VGListen pri 180 vIP 192.168.10.254 hello 4000,hold 8000 VF 3 Active pri 167 vMAC0007.b400.7b03
*Mar 101:13:28.015: mac 0007.b400.7b03
*Mar 1 01:13:29.107: GLBP: Vl10 Grp 123Hello in 192.168.10.251 VGStandby pri 200 vIP 192.168.10.254 hello 4000, hold 8000 VF 2Active pri 167 vMAC 0007.b400.7b02
*Mar 101:13:29.115: mac 0007.b400.7b02
*Mar 1 01:13:29.515: GLBP: Vl10 Grp 123Hello out 192.168.10.250 VGActive pri 255 vIP 192.168.10.254 hello 4000,hold 8000 VF 1 Active pri 167 vMAC0007.b400.7b01
*Mar 101:13:29.519: mac 0007.b400.7b01
#####################################
sw1#sh glbp
Vlan10 - Group 123
State is Active
2 statechanges, last state change 00:34:34
Virtual IP address is 192.168.10.254
Hello time 4 sec, hold time 8 sec
Next hellosent in 2.184 secs
Redirect time 5 sec, forwarder time-out 700sec
Authentication MD5, key-chain"HSRP-VLAN-10"
Preemption enabled, min delay 5 sec
Active is local
Standby is 192.168.10.251, priority 200 (expiresin 5.768 sec)
Priority 255 (configured)
Weighting 150 (configured 150), thresholds:lower 50, upper 150
Track object10 state Up decrement 51
Track object20 state Up decrement 51
Load balancing: round-robin
IP redundancy name is "GLBP-VLAN-10"
Group members:
cc00.09c0.0000 (192.168.10.250) local
cc01.09c0.0000 (192.168.10.251) authenticated
cc02.09c0.0000 (192.168.10.252) authenticated
There are 3 forwarders (1 active)
Forwarder 1
State isActive
1 state change, last state change 00:34:26
MAC addressis 0007.b400.7b01 (default)
Owner ID iscc00.09c0.0000
Redirectionenabled
Preemptionenabled, min delay 5 sec
Active islocal, weighting 150
Arp repliessent: 2
Forwarder 2
State isListen
MAC addressis 0007.b400.7b02 (learnt)
Owner ID iscc01.09c0.0000
Redirectiondisabled
Time tolive: 697.068 sec (maximum 700 sec)
Preemptionenabled, min delay 5 sec
Active is192.168.10.251 (primary), weighting 110 (expires in 5.064sec)
Forwarder 3
State isListen
MAC addressis 0007.b400.7b03 (learnt)
Owner ID iscc02.09c0.0000
Redirectionenabled, 3.928 sec remaining (maximum 4 sec)
Time tolive: 649.928 sec (maximum 650 sec)
Preemptionenabled, min delay 5 sec
Active is192.168.10.252 (primary), weighting 90 (expires in 7.768 sec)
***********************
sw2#sh glbp
Vlan10 - Group 123
State is Standby
1 statechange, last state change 00:09:59
Virtual IP address is 192.168.10.254(learnt)
Hello time 4 sec (cfgd 2 sec), hold time 8 sec(cfgd 4 sec)
Next hellosent in 0.168 secs
Redirect time 2 sec (active 5 sec), forwardertime-out 700 sec
Authentication MD5, key-chain"HSRP-VLAN-10"
Preemption enabled, min delay 2 sec
Active is 192.168.10.250, priority 255 (expiresin 4.592 sec)
Standby is local
Priority 200 (configured)
Weighting 110 (configured 110), thresholds:lower 50, upper 110
Track object10 state Up decrement 70
Load balancing: weighted
Group members:
cc00.09c0.0000 (192.168.10.250) authenticated
cc01.09c0.0000 (192.168.10.251) local
cc02.09c0.0000 (192.168.10.252) authenticated
There are 3 forwarders (1 active)
Forwarder 1
State isListen
MAC addressis 0007.b400.7b01 (learnt)
Owner ID iscc00.09c0.0000
Time tolive: 699.976 sec (maximum 700 sec)
Preemptionenabled, min delay 2 sec
Active is192.168.10.250 (primary), weighting 150 (expires in 7.972sec)
Forwarder 2
State isActive
1 state change, last state change 00:09:56
MAC addressis 0007.b400.7b02 (default)
Owner ID iscc01.09c0.0000
Preemptionenabled, min delay 2 sec
Active islocal, weighting 110
Forwarder 3
State isListen
MAC addressis 0007.b400.7b03 (learnt)
Owner ID iscc02.09c0.0000
Time tolive: 648.436 sec (maximum 650 sec)
Preemptionenabled, min delay 2 sec
Active is192.168.10.252 (primary), weighting 90 (expires in 6.428 sec)
***********
sw3#sh glbp
Vlan10 - Group 123
State is Listen
Virtual IP address is 192.168.10.254(learnt)
Hello time 4 sec (cfgd 1 sec), hold time 8 sec(cfgd 3 sec)
Next hellosent in 0.364 secs
Redirect time 4 sec (active 5 sec), forwardertime-out 650 sec (active 700 sec)
Authentication MD5, key-chain"HSRP-VLAN-10"
Preemption enabled, min delay 4 sec
Active is 192.168.10.250, priority 255 (expiresin 5.952 sec)
Standby is 192.168.10.251, priority 200 (expiresin 5.508 sec)
Priority 180 (configured)
Weighting 90 (configured 90), thresholds: lower50, upper 90
Track object10 state Up decrement 50
Load balancing: host-dependent
Group members:
cc00.09c0.0000 (192.168.10.250) authenticated
cc01.09c0.0000 (192.168.10.251) authenticated
cc02.09c0.0000 (192.168.10.252) local
There are 3 forwarders (1 active)
Forwarder 1
State isListen
MAC addressis 0007.b400.7b01 (learnt)
Owner ID iscc00.09c0.0000
Time tolive: 699.760 sec (maximum 700 sec)
Preemptionenabled, min delay 4 sec
Active is192.168.10.250 (primary), weighting 150 (expires in 7.752sec)
Forwarder 2
State isListen
MAC addressis 0007.b400.7b02 (learnt)
Owner ID iscc01.09c0.0000
Time tolive: 699.288 sec (maximum 700 sec)
Preemptionenabled, min delay 4 sec
Active is192.168.10.251 (primary), weighting 110 (expires in 7.280sec)
Forwarder 3
State isActive
1 state change, last state change 00:03:17
MAC addressis 0007.b400.7b03 (default)
Owner ID iscc02.09c0.0000
Preemptionenabled, min delay 4 sec
Active islocal, weighting 90
##############################################
转自:http://hi.baidu.com/skytwen/blog/item/ed0952b6c2d2d8e930add17f.html