GLBR和VRRP

目录

GLBP

协议概述 

工作机制

配置

show glbp  

负载均衡

VRRP

概念

配置

show vrrp 

实验图 

​参考


GLBP

协议概述 

工作机制

由AVG来负责响应PC对网关的ARP请求,同时AVG负责虚拟MAC的分配。AVG可以根据不同的负载均衡模式灵活的对PC的ARP请求进行响应。

配置

glbp 1 ip 192.168.23.254    //配置虚拟网关IP地址
 glbp 1 priority 120        //配置优先级(默认100)
 glbp 1 preempt             //开启抢占

show glbp  

FastEthernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:37:53
  Virtual IP address is 192.168.23.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.932 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Preemption enabled, min delay 0 sec
  Active is local                                                 !!!!!!!!!
  Standby is 192.168.23.3, priority 100 (expires in 9.756 sec)    !!!!!!!!!
  Priority 120 (configured)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin                                     !!!!!!!!!
  Group members:                                                  !!!!!!!!!
    c202.0873.0000 (192.168.23.2) local                           !!!!!!!!!
    c203.0891.0000 (192.168.23.3)                                 !!!!!!!!!
  There are 2 forwarders (1 active)                               !!!!!!!!!         
  Forwarder 1
    State is Active
      1 state change, last state change 00:37:43
    MAC address is 0007.b400.0101 (default)
    Owner ID is c202.0873.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 c203.0891.0000
    Redirection enabled, 597.652 sec remaining (maximum 600 sec)
    Time to live: 14397.632 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 192.168.23.3 (primary), weighting 100 (expires in 7.572 sec)

负载均衡

PC1> clear arp

PC1> trace 1.1.1.1
trace to 1.1.1.1, 8 hops max, press Ctrl+C to stop
 1   192.168.23.3   15.986 ms  12.152 ms  20.976 ms
 2   *10.1.13.1   48.312 ms (ICMP type:3, code:3, Destination port unreachable)

PC1> clear arp

PC1> trace 1.1.1.1
trace to 1.1.1.1, 8 hops max, press Ctrl+C to stop
 1   192.168.23.3   10.591 ms  10.429 ms  15.862 ms
 2   *10.1.13.1   30.869 ms (ICMP type:3, code:3, Destination port unreachable)

PC1> clear arp

PC1> trace 1.1.1.1
trace to 1.1.1.1, 8 hops max, press Ctrl+C to stop
 1   192.168.23.3   9.717 ms  10.579 ms  10.512 ms
 2   *10.1.13.1   30.150 ms (ICMP type:3, code:3, Destination port unreachable)

实验二: weighted

 (2)加权负载均衡
配置weight值,定义负载分配比例
比如AVF R1接口下配置weight值100,对应虚拟MAC是01,AVF R2接口下配置weight值200,对应虚拟MAC是02,则主机向AVG发送arp请求会先获取01的MAC,随后主机 clear arp-cache后再次向AVG发送arp请求,会获取02的MAC,再重复操作后第三次发送arp请求,则获取的MAC还会是02
优先级Priority值影响的是AVG,Weight值影响的是AVF

PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=31.112 ms
PC1> show arp
00:07:b4:00:01:01  192.168.23.254 expires in 117 seconds        1
PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=31.452 ms
PC1> show arp
00:07:b4:00:01:02  192.168.23.254 expires in 118 seconds        2
PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=31.616 ms
PC1> show arp
00:07:b4:00:01:02  192.168.23.254 expires in 116 seconds        2
PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=30.776 ms
PC1> show arp
00:07:b4:00:01:01  192.168.23.254 expires in 117 seconds        1
PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=47.583 ms
PC1> show arp
00:07:b4:00:01:02  192.168.23.254 expires in 118 seconds        2
PC1> clear arp
PC1> ping 1.1.1.1 -c 1
84 bytes from 1.1.1.1 icmp_seq=1 ttl=254 time=48.524 ms
PC1> show arp
00:07:b4:00:01:02  192.168.23.254 expires in 117 seconds        2

这里的特性跟HSRP有点像


VRRP

概念

CISCO VRRP配置_cisco vrrp配置实例_会飞的猪@123的博客-CSDN博客

配置

vrrp 1 ip            //配置VRRP group IP address 
vrrp 1 preempt       //开启抢占
vrrp 1 priority      //改优先级
vrrp 1 track         //开启追踪

show vrrp 

FastEthernet0/0 - Group 1  
  State is Master  
  Virtual IP address is 192.168.23.254
  Virtual MAC address is 0000.5e00.0101
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 200 
    Track object 1 state Up decrement 100
  Master Router is 192.168.23.3 (local), priority is 200 
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.218 sec

实验图 

参考

网关冗余协议——HSRP、VRRP、GLBP概念摘要_D_SJ的博客-CSDN博客

CISCO VRRP配置_cisco vrrp配置实例_会飞的猪@123的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/m0_74204829/article/details/130782357
今日推荐