CCNP32-冗余

一、冗余分类

链路冗余: 链路聚合,etherchannel,stp等
设备冗余: 热备份(加电状态,故障后可自动切换),冷备份
电源冗余: 双电源,UPS等
引擎冗余: 双主板,
切换技术:
1,RPR;切换时间2-4分钟,主引擎正常工作,备份引擎配置相同,但不加电
2,RPR+;切换时间1-2分钟,主引擎正常工作,备份引擎实时同步主引擎
3,sso over nsf;切换时间1-2s,主引擎正常工作,备份引擎只同步cef表(数据层面的转发表)等即可进行数据转发,然后再控制层面进行同步
网关冗余: HSRP、VRRP、GLBP

二、HSRP:热备份网关协议

思科私有协议,一个group指定一个VIP地址,自动生成一个Vmac地址
MAC地址:0000.0c07.ac0a

0000.0c07.ac0a
固定代表hsrp组编号

HSRP特点:

  • 1.使用hello包进行active和standby选举,hello时间3s,hold时间 10s,更新地址224.0.0.2 ,持续发送
  • 2.抢占默认关闭
  • 3.若接口启用HSRP,则接口ICMP重定向失效
  • 4.选举规则:
  1. 比较优先级,优先级越大越优,默认优先级为100.可以修改范围0-255
  2. 比较接口物理IP地址,越大越优
    配置:
    在这里插入图片描述

R1、R2、R3为三个路由器,正常配置IP地址和宣告路由,R3创建环回模拟主机,R4、R5模拟两台主机,关闭路由功能,设置网关地址为10.1.1.254
配置HSRP:

R1(config)#int f0/0 
R1(config-if)#standby 10 ip 10.1.1.254
R2(config)#int f0/0 
R2(config-if)#standby 10 ip 10.1.1.254

查看:

R1#show standby 
FastEthernet0/0 - Group 10
  State is Standby
    3 state changes, last state change 00:00:31
  Virtual IP address is 10.1.1.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.472 secs
  Preemption disabled
  Active router is 10.1.1.2, priority 100 (expires in 8.352 sec)
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-10" (default)
  
R2#sho standby 
FastEthernet0/0 - Group 10
  State is Active           //由于R2的IP地址大,故R2优选为Active
    2 state changes, last state change 00:00:56
  Virtual IP address is 10.1.1.254
  Active virtual MAC address is 0000.0c07.ac0a
    Local virtual MAC address is 0000.0c07.ac0a (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.384 secs
  Preemption disabled
  Active router is local
  Standby router is 10.1.1.1, priority 100 (expires in 10.832 sec)
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-10" (default)

R4#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
R5#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!

若关闭R2的f0/0,则R1会自动切换为Active

R2(config)#int f0/0
R2(config-if)#shu
R1(config-if)#do sho stand
FastEthernet0/0 - Group 10
  State is Active
R4#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
  1 10.1.1.1 28 msec 20 msec 24 msec
  2 13.1.1.2 12 msec 68 msec 44 msec

故障切换:
HSRP下行链路发生故障:切换时间等于HSRP hold时间(10s)
HSRP上行链路发生故障:切换时间与路由协议收敛有关,可定义流量工程检测上行链路故障,并开启抢占,那么当检测到上行链路故障时,自动减小其优先级,Standby即可自动抢占为Active,若检测上行直连链路,则不需要流量工程,直接R2(config-if)#standby 10 track serial 1/1
开启抢占:standby 10 preempt

R2(config)#ip sla 1
R2(config-ip-sla)#icmp-echo 23.1.1.1 source-ip 23.1.1.2
R2(config-ip-sla-echo)#frequency 5
R2(config-ip-sla-echo)#exi
R2(config)#ip sla schedule 1 life forever start-time now 
R2(config)#track 1 ip sla 1 reachability 
R2(config)#int f0/0
R2(config-if)#standby 10 track 1 decrement 20

验证:关闭R2的s1/1口,R2的日志

*May 17 13:21:25.131: %TRACKING-5-STATE: 1 ip sla 1 reachability Up->Down
*May 17 13:21:26.627: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 10 state Active -> Speak
*May 17 13:21:38.523: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 10 state Speak -> Standby

这样也只是实现了网关备份,但是并没有实现负载分担,要实现负载分担,我们只需要再新建一个standby group 20,虚拟网关IP地址为10.1.1.100,调大R2的优先级,让R1成为group 10的Active,R2成为group20的Active即可,然后将R4网关改为10.1.1.254,R5网关改为10.1.1.100即可实现R4走R1,R5走R2。

三、VRRP:虚拟网关冗余协议

共有协议,一个group指定一个VIP地址,自动生成一个Vmac地址
MAC地址:0000.5e00.010a

0000.5e00.010a
代表VRRP组编号

特点:

  • 1.hello时间1s hold时间3.6
  • 2.在选举过程中发送hello,若选举完成之后仅仅master 发送hello, 源Mac地址为Vmac,目标IP地址为224.0.0.18
  • 3.选举一个master其余为backup
  • 4.默认抢占开启
  • 5.不能跟踪上行直连接口 ,只能跟踪 track
  • 6.在VRRP中,虚拟IP地址可以设为某个备份网关的真实IP地址,那么此真实接口优先级变为255
  • 7.启用VRRP,接口ICMP重定向不失效
    配置:
R1(config)#int f0/0 
R1(config-if)#vrrp 10 ip 10.1.1.254
R2(config)#int f0/0 
R2(config-if)#vrrp 10 ip 10.1.1.254

故障切换:
VRRP下行链路发生故障:切换时间等于VRRP hold时间(3.6s)
VRRP上行链路发生故障:切换时间与路由协议收敛有关

四、GLBP:网关负载均衡协议

思科私有协议,HSRP协议的增加,变种
AVG:虚拟活动网关,抢占默认关闭,priority,负责应答用户AVF的MAC地址,自动负载均衡
AVF:虚拟活动转发,抢占默认开启,weight,负载转发数据
MAC地址:0007.b400.6402

0007.b400.6402
代表GLBP组编号AVF编号

部署:

R1(config)#int f0/0
R1(config-if)#glbp 1 ip 10.1.1.254
R2(config)#int f0/0
R2(config-if)#glbp 1 ip 10.1.1.254

查看:
这里R1为AVG的Active,R2为AVG的Standby
R1为AVF1的Active,AVF2的Standby
R2为AVF2的Active,AVF1的Standby
有多少个网关,就有多少个AVF。

R1#show glbp  
FastEthernet0/0 - Group 1
  State is Active		//这是AVG的状态,R1为AVG的Active
    1 state change, last state change 00:10:17
  Virtual IP address is 10.1.1.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.592 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Preemption disabled
  Active is local
  Standby is 10.1.1.2, priority 100 (expires in 7.616 sec)
  Priority 100 (default)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    ca01.d250.0000 (10.1.1.1) local
    ca02.d2c4.0000 (10.1.1.2)
  There are 2 forwarders (1 active)
  Forwarder 1
    State is Active		//R1为AVF1的Active
      1 state change, last state change 00:10:05
    MAC address is 0007.b400.0101 (default)
    Owner ID is ca01.d250.0000
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
    Client selection count: 1
  Forwarder 2			//R1为AVF2的Standby
    State is Listen
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is ca02.d2c4.0000
    Redirection enabled, 599.744 sec remaining (maximum 600 sec)
    Time to live: 14399.744 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.2 (primary), weighting 100 (expires in 10.560 sec)
    Client selection count: 1

R2#sho glbp 
FastEthernet0/0 - Group 1
  State is Standby				//这是AVG的状态,R2为AVG的Standby
    1 state change, last state change 00:10:09
  Virtual IP address is 10.1.1.254
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.976 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Preemption disabled
  Active is 10.1.1.1, priority 100 (expires in 8.768 sec)
  Standby is local
  Priority 100 (default)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    ca01.d250.0000 (10.1.1.1)
    ca02.d2c4.0000 (10.1.1.2) local
  There are 2 forwarders (1 active)
  Forwarder 1				//R2为AVF1的Standby
    State is Listen
    MAC address is 0007.b400.0101 (learnt)
    Owner ID is ca01.d250.0000
    Time to live: 14397.504 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.1.1.1 (primary), weighting 100 (expires in 11.360 sec)
  Forwarder 2				//R2为AVF2的Active
    State is Active
      1 state change, last state change 00:10:15
    MAC address is 0007.b400.0102 (default)
    Owner ID is ca02.d2c4.0000
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
Github下载地址:https://github.com/XLAccount/MiaoBo 项目详解地址:http://www.code4app.com/blog-843201-350.html 快速集成RTMP的视频推流教程:http://www.code4app.com/blog-843201-315.html ffmpeg常用命令操作:http://www.code4app.com/blog-843201-326.html #关于IJKMediaFramework/IJKMediaFramework.h找不到的问题,下载后直接拉到项目中即可 下载地址:https://pan.baidu.com/s/1boPOomN 密码::9yd8 #BUG修复: 解决登录程序偶尔崩溃,修复轮播图片和页面控制器叠加等问题,修复新浪授权登录 (2016.9.7) 解决程序运行中偶尔崩溃问题,解决连续下拉刷新崩溃问题,优化代码 (2016.9.8) 优化直播页面,减少不必要的性能消耗,增加用户体验 (2016.9.11) 适配5s以上的机型除了6sPlus和6Plus延迟较大外,其余延迟都较小,网速好的话可以忽略不计 (2016.9.12) 新版本极大优化程序性能,修复关注数据异常等小问题,重新布局热门页面,减少因反复加载带来的性能消耗 (2016.9.13) 增加个人中心页面,采用下拉放大图片 ➕ 波纹效果 (2016.9.14) ![image text](https://github.com/XLAccount/ALLGIFS/blob/master/psb.gif) 展示图片 ![image](https://github.com/XLAccount/ALLGIFS/blob/master/psb-1.gif) 展示图片 ![image text](https://github.com/XLAccount/ALLGIFS/blob/master/psb-2.gif) 展示图片 ![image text](https://github.com/XLAccount/ALLGIFS/blob/master/psb-3.gif) 展示图片 感谢大神Monkey_ALin http://www.jianshu.com/users/9723687edfb5/latest_articles 的demo支持
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值