预配置:略

实验过程 第一步:在R1和R2上配置 R1#debug glbp GLBP debugging is on R1#conf t R1(config)#int f0/0 R1(config-if)#glbp 1 ip 192.168.0.100 R1(config-if)# *Dec 14 19:41:19.351: GLBP: Fa0/0 1 Disabled: a/GLBP IP address configured *Dec 14 19:41:19.355: GLBP: Fa0/0 1 Disabled -> Init R1(config-if)# *Dec 14 19:41:29.359: GLBP: Fa0/0 Interface up *Dec 14 19:41:29.359: GLBP: Fa0/0 1 Init: d/GLBP enabled *Dec 14 19:41:29.359: GLBP: Fa0/0 1 Init -> Listen R1(config-if)# *Dec 14 19:41:39.359: GLBP: Fa0/0 1 Listen: g/Active timer expired (unknown) *Dec 14 19:41:39.359: GLBP: Fa0/0 1 Listen -> Speak *Dec 14 19:41:49.359: GLBP: Fa0/0 1 Speak: f/Standby timer expired (unknown) *Dec 14 19:41:49.359: GLBP: Fa0/0 1 Standby router is local *Dec 14 19:41:49.359: GLBP: Fa0/0 1 Speak -> Standby

*Dec 14 19:41:49.363: GLBP: Fa0/0 1 Standby: g/Active timer expired (unknown) *Dec 14 19:41:49.363: GLBP: Fa0/0 1 Active router IP is local *Dec 14 19:41:49.363: GLBP: Fa0/0 1 Standby router is unknown, was local *Dec 14 19:41:49.363: GLBP: Fa0/0 1 Standby -> Active //现在R1成为了glpb的active路由器

R1#sh glbp //查看glpb运行情况 FastEthernet0/0 - Group 1 State is Active 2 state changes, last state change 00:05:04 Virtual IP address is 192.168.0.100 Hello time 3 sec, hold time 10 sec Next hello sent in 1.964 secs Redirect time 600 sec, forwarder time-out 14400 sec Preemption disabled Active is local Standby is unknown Priority 100 (default) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin //blbp负载均衡方法 There is 1 forwarder (1 active) Forwarder 1 State is Active 1 state change, last state change 00:04:54 MAC address is 0007.b400.0101 (default) Owner ID is ca91.0354.0000 Redirection enabled Preemption enabled, min delay 30 sec Active is local, weighting 100

R1#sh glbp brief Interface Grp Fwd Pri State Address Active router Standby router Fa0/0 1 - 100 Active 192.168.0.100 local unknown
Fa0/0 1 1 7 Active 0007.b400.0101 local -

第二步:在R2上配置GLBP协议 R2(config)#int f0/0 R2(config-if)#glbp 1 ip 192.168.0.100

R2#sh glbp FastEthernet0/0 - Group 1 State is Standby] //R2为standby状态 1 state change, last state change 00:01:36 Virtual IP address is 192.168.0.100 Hello time 3 sec, hold time 10 sec Next hello sent in 2.948 secs Redirect time 600 sec, forwarder time-out 14400 sec Preemption disabled Active is 192.168.0.1, priority 100 (expires in 9.056 sec) Standby is local Priority 100 (default) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin There are 2 forwarders (1 active) //现在有2个转发 Forwarder 1 State is Listen MAC address is 0007.b400.0101 (learnt) Owner ID is ca91.0354.0000 Time to live: 14399.056 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is 192.168.0.1 (primary), weighting 100 (expires in 9.056 sec) Forwarder 2 State is Active //转发2现在是激活状态 1 state change, last state change 00:01:41 MAC address is 0007.b400.0102 (default) Owner ID is ca92.0d30.0000 Preemption enabled, min delay 30 sec Active is local, weighting 100 第三步:在R3和R4上做测试

R3#ping 192.168.0.100

Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 8/222/1052 ms

R3#sh arp Protocol Address Age (min) Hardware Addr Type Interface Internet 192.168.0.100 1 0007.b400.0101 ARPA FastEthernet0/0 Internet 192.168.0.3 - ca93.09e0.0000 ARPA FastEthernet0/0

R4#sh arp Protocol Address Age (min) Hardware Addr Type Interface Internet 192.168.0.100 0 0007.b400.0102 ARPA FastEthernet0/0 Internet 192.168.0.4 - ca94.0834.0000 ARPA FastEthernet0/0 第四步:最后测试,在R3和R4上ping,在R1上关闭f0/0接口

R3#ping 192.168.0.100 re 1000000

Type escape sequence to abort. Sending 1000000, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!......!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

R4#ping 192.168.0.100 re 1000000

Type escape sequence to abort. Sending 1000000, 100-byte ICMP Echos to 192.168.0.100, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!

//在这里又打开后,不会切换到原来了