网关冗余之GLBP的配置和验证

 
 
R1#sh run
Building configuration...
……….
interface Ethernet0/0
 ip address 192.168.1.1 255.255.255.0
 half-duplex
  glbp 1 ip 192.168.1.254
 glbp 1 priority 200
 glbp 1 preempt
!
interface Ethernet0/1
 ip address 192.168.2.1 255.255.255.0
 half-duplex
 
router rip
 version 2
 passive-interface Ethernet0/0
 network 192.168.1.0
 network 192.168.2.0
 no auto-summary
!
 
R2#sh run
Building configuration...
………….
interface Ethernet0/0
 ip address 192.168.1.2 255.255.255.0
 half-duplex
 glbp 1 ip 192.168.1.254
 glbp 1 priority 180
 glbp 1 preempt
!
interface Ethernet0/1
 ip address 192.168.2.2 255.255.255.0
 half-duplex
!
router rip
 version 2
 passive-interface Ethernet0/0
 network 192.168.1.0
 network 192.168.2.0
!
 
R3#sh run
Building configuration...
………..
interface Ethernet0/0
 ip address 192.168.1.3 255.255.255.0
 half-duplex
 glbp 1 ip 192.168.1.254
 glbp 1 priority 160
 glbp 1 preempt
!
interface Ethernet0/1
 ip address 192.168.2.3 255.255.255.0
 half-duplex
!
router rip
 version 2
 passive-interface Ethernet0/0
 network 192.168.1.0
 network 192.168.2.0
!
其他设配的配置按照拓扑图配置,确保直连链路的连通性。
 
1 R1 上查看 GLBP 的信息:
R1#sh glbp
Ethernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:18:28
  Virtual IP address is 192.168.1.254  // 虚拟网关是 192.168.1.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.324 secs
  Redirect time 600 sec, forwarder time-out 14400 sec
  Preemption enabled, min delay 0 sec
  Active is local        // 说明 R1 是活动的 AVG
  Standby is 192.168.1.2, priority 180 (expires in 9.320 sec)  // 说明 R2 是备份 AVG
  Priority 200 (configured)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    cc01.0d80.0000 (192.168.1.1) local
    cc02.0d80.0000 (192.168.1.2)
    cc03.0d80.0000 (192.168.1.3)       // 显示 BGLP 的成员
  There are 3 forwarders (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 00:18:18
MAC address is 0007.b400.0101 (default)        // 虚拟网关的其中一个 MAC 地址
                                          
                                            此段说明 R1 0007.b400.0101 的活动路由器,也就是说有发往 007.b400.0101 的数据,将由 R1 接收并转发。
    Owner ID is cc01.0d80.0000
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
  Forwarder 2
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is cc02.0d80.0000
    Redirection enabled, 598.132 sec remaining (maximum 600 sec)
    Time to live: 14398.132 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 192.168.1.2 (primary), weighting 100 (expires in 8.128 sec)
  Forwarder 3
    State is Listen
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is cc03.0d80.0000
    Redirection enabled, 599.320 sec remaining (maximum 600 sec)
    Time to live: 14399.320 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
Active is 192.168.1.3 (primary), weighting 100 (expires in 9.316 sec)
 
从上面得知:
R1: 0007.b400.0101 的活动路由器
R2: 0007.b400.0102 的活动路由器
R3: 0007.b400.0103 的活动路由器
 
2 检查 GLBP 的负载均衡功能
     PC ping 4.4.4 .4
    PC#ping 4.4.4 .4
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4 .4, timeout is 2 seconds:
.!!!!
 
再查看 ARP
PC#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.1.100           -   cc05.0d18.0000  ARPA   Ethernet0/0
Internet  192.168.1.254          13   0007.b400.0101  ARPA   Ethernet0/0
 
以上表明 PC ARP 请求获得网关 (192.168.1.254) MAC 00-07-b4- 00-01-01
 
清空 ARP 缓存表,再次 ping 4.4.4 .4, 查看 ARP 缓存
PC#clear arp
PC#ping 4.4.4 .4
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4 .4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/228/1032 ms
PC#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.1.100           -   cc05.0d18.0000  ARPA   Ethernet0/0
Internet  192.168.1.254           0   0007.b400.0103  ARPA   Ethernet0/0
 
以上表明 PC ARP 请求获得网关 (192.168.1.254) MAC 00-07-b4- 00-01-03
也就是说 GLBP 响应 ARP 请求时,每次会用不同的 MAC 响应,从而实现负载平衡。
3   检查 GLBP 的冗余功能
 
确定了 192.168.1.254 MAC 地址是 0007.b400.0103
PC ping 4.4.4 .4 重复 1000 次,并在中间断开 R3 e0/0 端口
PC#ping 4.4.4 .4 repeat 1000
 
Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 4.4.4 .4, timeout is 2 seconds:
.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!.....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
             可以看到在 R3 发生故障的时候,很快就有其他路由器顶替它的工作。
PC#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.1.100           -   cc05.0d18.0000  ARPA   Ethernet0/0
Internet  192.168.1.254           5   0007.b400.0103  ARPA   Ethernet0/0
 
再在 R1 上查看 glbp 的信息:
Ethernet0/0 - Group 1
…………
  Forwarder 3
    State is Listen
      4 state changes, last state change 00:01:43
    MAC address is 0007.b400.0103 (learnt)
    Owner ID is cc03.0d80.0000
    Redirection enabled, 597.940 sec remaining (maximum 598 sec)
    Time to live: 14397.940 sec (maximum 14398 sec)
    Preemption enabled, min delay 30 sec
    Active is 192.168.1.2 (secondary), weighting 100 (expires in 9.936 sec)
Arp replies sent: 2
可以看出路由器 R2 顶替了路由 R3 的功能,可以看出 gblp 既有负载均衡的功能还有冗余备份的功能!
 

你可能感兴趣的:(职场,休闲,glbp)