三种路由器冗余协议的配置示例
更新时间:2023-11-07 16:36:01 阅读量: 教育文库 文档下载
- 虚拟路由器冗余协议推荐度:
- 相关推荐
三种路由器冗余协议的配置示例
2009-02-22 16:26:08| 分类: Cisco|字号 订阅
拓扑图
实验用到的是4台3640路由器,我用的镜像是unzip-c3640-ik9o3s-mz.124-10.bin 其中HSRP和VRRP用到SW1、SW2和SW3,而GLBP则用到全部4台路由器。
一、HSRP
1. 配置HSRP
SW1(config)#interface vlan 50
SW1(config-if)#ip address 192.168.1.10 255.255.255.0 SW1(config-if)#standby 1 priority 200 SW1(config-if)#standby 1 preempt SW1(config-if)#standby 1 ip 192.168.1.1 SW1(config-if)#standby 1 authentication MyKey SW1(config-if)#standby 2 priority 100 SW1(config-if)#standby 2 ip 192.168.1.2 SW1(config-if)#standby 2 authentication MyKey SW1(config-if)#^Z
SW2(config)#interface vlan 50
SW2(config-if)#ip address 192.168.1.11 255.255.255.0
SW2(config-if)#standby 1 priority 100 SW2(config-if)#standby 1 ip 192.168.1.1 SW2(config-if)#standby 1 authentication MyKey SW2(config-if)#standby 2 priority 200 SW2(config-if)#standby 2 preempt SW2(config-if)#standby 2 ip 192.168.1.2 SW2(config-if)#standby 2 authentication MyKey SW2(config-if)#^Z
我们在这里一共配置了两个standby group,其中SW1充当group 1的active router,并配置了抢占,同时,它还充当了group 2的standby router。同理,SW2是group 2的active router,同时为group 1的standby router。 这时侯我们查看HSRP信息:
SW1#show standby vlan 50 brief
P indicates configured to preempt. |
Interface Grp Prio P State Active Standby Virtual IP Vl50 1 200 P Init unknown unknown 192.168.1.1 Vl50 2 100 Init unknown unknown 192.168.1.2 显示HSRP的状态为Init,而Standby为Unknown,这是由于我们还没有配置VLAN 50及将端口关联到VLAN 50
2. 在SW1和SW2上配置VLAN
SW1(vlan)#vlan 50 VLAN 50 added: Name: VLAN0050 SW1(vlan)#exit APPLY completed. Exiting.... SW1#config t
Enter configuration commands, one per line. End with CNTL/Z. SW1(config)#int f0/1 SW1(config-if)#switchport
SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 50 SW1(config-if)#
SW2#vlan database SW2(vlan)#vlan 50
VLAN 50 added: Name: VLAN0050 SW2(vlan)#exit APPLY completed. Exiting.... SW2#config t
Enter configuration commands, one per line. End with CNTL/Z. SW2(config)#int f0/1 SW2(config-if)#switch
SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 50
配置完成后我们可以看到SW1和SW2经历如下过程: SW1(config-if)#
*Mar 1 00:17:08.155: %HSRP-5-STATECHANGE: Vlan50 Grp 1 state Speak -> Standby *Mar 1 00:17:08.155: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Speak -> Standby *Mar 1 00:17:08.655: %HSRP-5-STATECHANGE: Vlan50 Grp 1 state Standby -> Active *Mar 1 00:17:08.659: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Standby -> Active *Mar 1 00:17:17.783: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Active -> Speak 可以看到,SW1先从Speak状态转为Standby,然后尝试称为Active,在Group 2中,由于SW2的优先级比SW1高,所以SW1又转换为Speak 输入debug standby events SW1#debug standby events HSRP Events debugging is on SW1#
*Mar 1 00:05:24.131: HSRP: Vl50 Grp 1 Active: i/Resign rcvd (100/192.168.1.11) *Mar 1 00:05:24.135: HSRP: Vl50 Grp 2 Active: j/Coup rcvd from higher pri router (200/192.168.1.11)
*Mar 1 00:05:24.139: HSRP: Vl50 Grp 2 Active router is 192.168.1.11, was local *Mar 1 00:05:24.139: HSRP: Vl50 Grp 2 Active -> Speak
*Mar 1 00:05:24.139: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Active -> Speak SW1#
*Mar 1 00:05:24.139: HSRP: Vl50 Grp 2 Redundancy \Speak SW1#
*Mar 1 00:05:27.131: HSRP: Vl50 Grp 1 Redundancy group hsrp-Vl50-1 state Active -> Active SW1#
*Mar 1 00:05:30.131: HSRP: Vl50 Grp 1 Redundancy group hsrp-Vl50-1 state Active
->Active SW1#
*Mar 1 00:05:34.123: HSRP: Vl50 Grp 1 Standby router is 192.168.1.11
*Mar 1 00:05:34.139: HSRP: Vl50 Grp 2 Speak: d/Standby timer expired (unknown) *Mar 1 00:05:34.139: HSRP: Vl50 Grp 2 Standby router is local *Mar 1 00:05:34.139: HSRP: Vl50 Grp 2 Speak -> Standby
*Mar 1 00:05:34.139: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Speak -> Standby SW1#
*Mar 1 00:05:34.139: HSRP: Vl50 Grp 2 Redundancy \Standby
这里我们可以清晰看到每个状态的切换
查看SW1的HSRP状态 SW1#show standby vlan 50 brief
P indicates configured to preempt. |
Interface Grp Prio P State Active Standby Virtual IP Vl50 1 200 P Active local 192.168.1.11 192.168.1.1 Vl50 2 100 Standby 192.168.1.11 local 192.168.1.2 可以看到每个Group各自的active router和standby router,以及每个group的网关地址(这里的virtual ip)。
接下来,我们尝试关闭SW3的F0/0端口,让SW1和SW2不能通信,看会有什么结果。 首先在SW1上输入debug standby events 然后关闭SW3的F0/0端口 SW1#
*Mar 1 00:08:37.107: HSRP: Vl50 Grp 2 Standby: c/Active timer expired (192.168.1.11) *Mar 1 00:08:37.107: HSRP: Vl50 Grp 2 Active router is local, was 192.168.1.11 *Mar 1 00:08:37.107: HSRP: Vl50 Grp 2 Standby router is unknown, was local *Mar 1 00:08:37.111: HSRP: Vl50 Grp 2 Standby -> Active
*Mar 1 00:08:37.111: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Standby -> Active SW1#
*Mar 1 00:08:37.111: HSRP: Vl50 Grp 2 Redundancy \Active
*Mar 1 00:08:38.095: HSRP: Vl50 Grp 1 Standby router is unknown, was 192.168.1.11 SW1#
*Mar 1 00:08:40.115: HSRP: Vl50 Grp 2 Redundancy group hsrp-Vl50-2 state Active -> Active SW1#
*Mar 1 00:08:43.115: HSRP: Vl50 Grp 2 Redundancy group hsrp-Vl50-2 state Active -> Active
可以看到SW2自己成为group 2上的active router SW1#show standby vlan 50 brief
P indicates configured to preempt. |
Interface Grp Prio P State Active Standby Virtual IP Vl50 1 200 P Active local unknown 192.168.1.1 Vl50 2 100 Active local unknown 192.168.1.2 我们再次把SW3的F0/0端口打开 SW1#
*Mar 1 00:11:04.111: HSRP: Vl50 Grp 1 Hello in 192.168.1.11 Active pri 100 vIP 192.168.1.1
*Mar 1 00:11:04.115: HSRP: Vl50 Grp 1 Active: h/Hello rcvd from lower pri Active router (100/192.168.1.11)
*Mar 1 00:11:04.163: HSRP: Vl50 Grp 2 Active: j/Coup rcvd from higher pri router (200/192.168.1.11)
*Mar 1 00:11:04.163: HSRP: Vl50 Grp 2 Active router is 192.168.1.11, was local *Mar 1 00:11:04.167: HSRP: Vl50 Grp 2 Active -> Speak
*Mar 1 00:11:04.167: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Active -> Speak SW1#
*Mar 1 00:11:04.167: HSRP: Vl50 Grp 2 Redundancy \Speak SW1#
*Mar 1 00:11:07.115: HSRP: Vl50 Grp 1 Redundancy group hsrp-Vl50-1 state Active -> Active SW1#
*Mar 1 00:11:10.115: HSRP: Vl50 Grp 1 Redundancy group hsrp-Vl50-1 state Active -> Active SW1#
*Mar 1 00:11:14.163: HSRP: Vl50 Grp 2 Speak: d/Standby timer expired (unknown) *Mar 1 00:11:14.163: HSRP: Vl50 Grp 2 Standby router is local *Mar 1 00:11:14.163: HSRP: Vl50 Grp 2 Speak -> Standby
*Mar 1 00:11:14.163: %HSRP-5-STATECHANGE: Vlan50 Grp 2 state Speak -> Standby SW1#
*Mar 1 00:11:14.167: HSRP: Vl50 Grp 2 Redundancy \Standby
*Mar 1 00:11:14.207: HSRP: Vl50 Grp 1 Standby router is 192.168.1.11 显示在group 2中有更高优先级的router,于是状态又切换回standby
正在阅读:
三种路由器冗余协议的配置示例11-07
格力的6σ管理01-27
庄子精读课程讲稿06-04
计算机网络课程设计04-18
基于单片机的相位差在线检测01-12
母亲节活动通知04-04
GCP法规题库--判断题06-01
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 冗余
- 示例
- 路由器
- 协议
- 配置
- 完美国际称号全
- 2015各大板块龙头一览
- 实验六 单相桥式全控整流及有源逆变电路实验V2.1版
- 外研版高二英语选修七module3 满分卷
- 西北工业大学数据库实验报告1
- 轧钢厂加热炉安全技术操作规程
- 农村小学学困生转化策略的研究 - 图文
- 2018-2019-邮储银行实习报告优秀范文-精选word文档(3页)
- 审计学复习题+答案
- 浅谈我国股指期货交易风险的防范与控制
- 机械制图 习题 装配图 零件图
- 《环境工程原理》试题库
- 中国机动车尾气烟度遥测仪产业调查及未来五年发展机会分析报告
- U型支架级进模设计
- 全国知名书画家名单
- 学习化妆难不难?就业方向有哪些? - 图文
- 航空器维修常用工具的使用 - 图文
- (1)控制任务:有3个抢答席和1个主持人席,每个抢答席上各有1个抢答
- 重庆中考二次函数的综合题22-40题
- 配网终端加密模块需求报告