设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 465|回复: 1
收起左侧

GLBP详解

[复制链接]
发表于 2018-3-14 15:27:56 | 显示全部楼层 |阅读模式
1)GLBP介绍
cisco ios 支持版本 IOS 12.2(15)T以上
全称Gateway Load Banancing Protocol,
和HRSP、VRRP不同的是,GLBP不仅提供冗余网关,还在各网关之间提供负载均衡,
而HRSP、VRRP都必须选定一个活动路由器,而备用路由器则处于闲置状态。

和HRSP不同的是,GLBP可以绑定多个MAC地址到虚拟IP,
从而允许客户端选择不同的路由器作为其默认网关,而网关地址仍使用相同的虚拟IP,
从而实现一定的冗余。

2)活动网关选举
使用类似于HRSP的机制选举活动网关,
优先级最高的路由器成为活动落由器,称作Acitve VirtualGateway,其他非AVG提供冗余。备份的AVF,也是实现数据的转发,而在GLBP中,同一个GROUP的所有路由器(最多4个)可以同时转发流量

某路由器被推举为AVG后,和HRSP不同的工作开始了,AVG分配虚拟的MAC地址给其他GLBP组成员。
所有的GLBP组中的路由器都转发包,
但是各路由器只负责转发与自己的虚拟MAC地址的相关的数据包。

3)地址分配
每个GLBP组中最多有4个虚拟MAC地址,非AVG路由器有AVG按序分配虚拟MAC地址,
非AVG也被称作Active Virtual Forwarder(AVF)。

AVF分为两类:Primary Virtual Forwarder和Secondary VirtualForwarder。
直接由AVG分配虚拟MAC地址的路由器被称作Primary Virtual Forwarder,
后续不知道AVG真实IP地址的组成员,只能使用hellos包来识别其身份,然后被分配虚拟MAC地址,此类被称作SecondaryVirtual Forwarder。

4)GLBP配置
如果AVG失效,则推举就会发生,决定哪个AVF替代AVG来分配MAC地址,推举机制依赖于优先级。
最多可以配置1024个GLBP组,不同的用户组可以配置成使用不同的组AVG来作为其网关。

router#conf t
router(config)#int fastethernet 0/0
router(config-if)#ip address 10.1.1.1
router(config-if)#glbp 99 ip 10.1.1.254
router(config-if)#glbp 99 priority 105
router(config-if)#glbp 99 preempt delay 10
router(config-if)#glbp 99 weighting track int s0 10
router(config-if)#exit
router(config)#^Z
使用下面的接口命令来为路由器分配GLBP的优先级:#glbp group priority level 组号的范围从0-1023优先级从1- 255,越大优先级越高

如果使用HSRP,那么其他的路由器只能在当前活跃的路由器失效时才能接替活跃的角色,如果路由器要比当前路由器有更高的优先级,GLBP将剥夺主路由器并成为AVG,可以使用下面的命令剥夺启动并且在剥夺之前延迟一段时间。一般是4S
# glbp group preempt [delay minimum seconds]
GLBP使用一个加权函数来决定哪台路由器成为组中虚拟MAC得知的AVF,每台路由器开始时都带一个最大权值(1到254)。当某个特定接口失效的时候,权值所配置的值减少,GLBP使用门槛值来确定路由器是否能成为AVF,如果权值降到较低的门槛以下,路由器必须放弃AVF的角色,在权值上升到较高的门槛以上的时候,路由器可以继续它的AVF角色。在缺省的情况下,路由器设置的最大权值为100,如果要动态改变权值,GLBP必须要知道所跟踪的接口并且知道如何调整权值,首先必须定义跟踪的接口,可以使用下面的全局配置命令#trackobject-number interface type mod/num {line-protocol | ip routing}object-number是一个任意的索引值1-500,这个值用作权值的调节,触发调整的条件可以是线协议也可以是路由协议。

还必须定义接口权值门槛:#glbp group weighing maximum [lower lower] [upperupper] 最大权值的范围从1-254 缺省值为100较高门槛值缺省值为MAXIMUM,较小门槛值缺省值为1,各自定义为可以或者不能成为AVF的门槛。
还必须配置GLBP知道跟踪了哪个接口,以便权值可以使用下面接口配置命令来改变权值:
#glbp group weighting track object-number [decrement value]当所跟踪的接口失效的时候,权值减少了VALUE从1-254缺省值是10,在AVF的路由器有更高权值的时候,它也不能剥夺另一台路由器。
在AVF路由器上,用下面的接口命令来定义负载均衡的方式:#glbp group load-balancing [round-robin| weighted | host-dependent]
要启动GLBP,必须给该组分配一个虚拟IP地址,可以通过以下的接口配置命令来实现:
#glbp group ip [ip-address [secondary] ]
注意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 ... d2d8e930add17f.html
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-20 22:55 , Processed in 0.056289 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表