实验八 HSRP协议原理及配置_第1页
实验八 HSRP协议原理及配置_第2页
实验八 HSRP协议原理及配置_第3页
实验八 HSRP协议原理及配置_第4页
实验八 HSRP协议原理及配置_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、实验八 HSRP协议原理及配置8.1 实验目的:1. 熟悉HSRP协议原理;2. 掌握HSRP的配置;3. 熟悉HSRP的应用。8.2 实验环境:本实验至少需要三台路由器、一台交换机、两台主机。实验中用交换机模拟局域网,其中局域网A有两台路由器与局域网B相连,所以为了安全可靠,我们在两台路由器之间进行备份。这就是我们本实验要讨论的热备份路由协议。具体的实验组网如下:8.3 实验步骤:8.3.1 实验准备本实验需要使用HSRP协议完成路由器之间的热备份,在HSRP中需要使用到虚拟IP地址,用该IP地址用作主机的缺省网关,就可以在一台路由器故障时,不修改主机配置而仍然与主机PCC通信。所以我们首先

2、要规划IP地址。本实验的IP地址规划如下:路由器的接口IP地址分配如下:RTARTBRTCE010.110.32.11/2110.110.32.10/2110.110.10.100/24S01.0.0.1/241.0.0.2S12.0.0.1/242.0.0.2各主机的IP地址分配如下:PCAPCBPCCIP10.110.32.2010.110.10.3010.110.10.1Gateway10.110.32.110.110.10.110.110.10.1008.3.2 单备份组配置本实验需要路由器RTA与RTB实现热备份,并且正常时以RTA为活动路由器,并且在RTA由故障状态恢复正常时能继续

3、担当活动路由器。根据实验要求和HSRP协议原理可以设定RTA的优先级较高(默认值为100),同时置抢占标志,即可满足要求。具体实验配置步骤很简单,不再赘述,下面列出各路由器的配置信息供您参考:RTA(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTA ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 sp

4、eed auto duplex auto no loopback ip address 10.110.32.11 255.255.248.0 standby 1 ip 10.110.32.1 /创建备份组并设定虚拟IP地址 standby 1 preempt /设定抢占标志 standby 1 priority 120 /设定优先级 ip rip version 2 mcast /设定RIP协议版本 ! interface Serial0 encapsulation ppp ip address 1.0.0.1 255.255.255.0 ip rip version 2 mcast ! in

5、terface Serial1 encapsulation ppp ! exit router rip no auto-summary /取消自动聚合功能 network all ! endRTB(config-if-Serial1)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTB ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed

6、 auto duplex auto no loopback ip address 10.110.32.10 255.255.248.0 standby 1 ip 10.110.32.1 standby 1 preempt ip rip version 2 mcast ! interface Serial0 encapsulation ppp ! interface Serial1 encapsulation ppp ip address 2.0.0.1 255.255.255.0 ip rip version 2 mcast ! exit router rip no auto-summary

7、network all ! endRTC(config-if-Serial1)#show running-config Now create configuration. Current configuration ! version 1.5.6 logging console hostname RTC ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.110.10.100 255.255

8、.255.0 ip rip version 2 mcast ! interface Serial0 clock-select DTECLK1 encapsulation ppp ip address 1.0.0.2 255.255.255.0 ip rip version 2 mcast ! interface Serial1 clock-select DTECLK1 encapsulation ppp ip address 2.0.0.2 255.255.255.0 ip rip version 2 mcast ! exit router rip no auto-summary networ

9、k all ! end注意:在配置动态路由协议时,由于使用的是RIP协议,该协议默认版本version 1不支持可变长子网掩码,而实验中设定的IP地址又是A类地址。所以需要在接口上修改RIP协议版本为version 2,而且要取消路由协议的自动聚合功能。如果没有这些设置,将看不到到对端局域网的路由信息。完成上述配置之后,测试网络是否满足设计需求。先用show standby查看路由器的状态如下:RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 1 State : Active Hot Standby IP : 10.

10、110.32.1 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01RTB(config-if-Serial1)#show standby Ethernet0 |Group Number : 1 State : Standby Hot Standby IP : 10.110.32.1 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address

11、 : 00-e0-fc-00-5f-01在主机PCA上使用ping命令测试是否能与主机PCC通信,应该能正常通信。然后关闭路由器RTA的E0口(shutdown),此时路由器的状态又是什么呢?路由器RTB是不是已经成为活动路由器了?应该是。再次在主机PCA上测试应该能与主机PCC通信。最后再把RTA的E0口恢复正常(no shutdown),它的状态又有什么变换?我们的设计满足需求吗?如果时间充裕,您试试看仅仅关闭S0口,是什么现象?S0和E0同时关闭呢?HSRP协议的正常工作是依靠路由器之间周期性的发送报文来实现的,那么这个周期究竟是多少呢?实际上在上面的状态信息中已经有显示。即Hello

12、Time:3,修改该参数的命令是:standby group-number timer hello-time hold-time。其中hold-time是用于确认路由器是否故障的,如果超过该时间仍没有收到活动路由器或备份路由器的Hello报文,则认为该路由器故障。在一般情况下,路由器使用路由器自动映射生成的MAC地址为虚拟MAC地址,我们也可以人为的修改使其使用实际的MAC地址或指定的MAC地址为虚拟MAC地址。下面是修改后的显示信息,供参考:RTA(config-if-Ethernet0)#standby use-biaRTA(config-if-Ethernet0)#show standb

13、y Ethernet0 |Group Number : 1 State : Listen Hot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 60 Hello Time: 20Use Burned in Mac AddressRTA(config-if-Ethernet0)#standby use-ovmac 11-11-11-11-11-01RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 1 State : Standby H

14、ot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 60 Hello Time: 20 Use Virtual Mac Address : 11-11-11-11-11-01修改后,您迅速查看RTB的状态会看到该路由器从INIT-LISTEN-SPEAK-STANDBY的过程,这是因为修改参数后,路由器有一个学习过程。在实际应用中还可能会修改路由器之间的确认口令(默认为quidway),该配置简单,只需要同一备份组各路由器的口令一致即可(standby group-number authentication

15、passwaord)。8.3.3 多备份组配置上面的实验中,如果只是关闭RTA的S0口,会发现RTA仍是活动路由器(ACTIVE)。如果我们采用下面的监视指定端口技术,就不会有此现象了。仍然使用上面的组网,只需要在RTA上多配置一条命令(standby 1 track serial0 40)即可,其中40是指当serial0故障时,就降低自己的优先级40,此时优先级为80,低于RTB的优先级100,所以RTB成为活动路由器。实验现象是这样的吗?Quidway系列路由器允许一台路由器为多个备份组作备份,所以我们可以通过设置多备份组实现负荷分担。如上面的实验,我们将RTA设为group 1的活动路

16、由器group 2的备份路由器,RTB作相反设置,即可实现负荷分担。配置完成后的配置信息如下:RTA(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTA ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.11

17、0.32.11 255.255.248.0 standby 2 ip 10.110.32.2 standby 2 preempt standby 1 ip 10.110.32.1 standby 1 preempt standby 1 priority 120 ip rip version 2 mcast ! interface Serial0 encapsulation ppp ip address 1.0.0.1 255.255.255.0 ip rip version 2 mcast ! interface Serial1 encapsulation ppp ! exit router

18、rip no auto-summary network all ! endRTB(config-if-Ethernet0)#show running-config Now create configuration. Current configuration ! version 1.5.6 hostname RTB ! interface Aux0 async mode interactive encapsulation ppp ! interface Ethernet0 speed auto duplex auto no loopback ip address 10.110.32.10 25

19、5.255.248.0 standby 2 ip 10.110.32.2 standby 2 preempt standby 2 priority 120 standby 1 ip 10.110.32.1 standby 1 preempt ip rip version 2 mcast ! interface Serial0 encapsulation ppp ! interface Serial1 encapsulation ppp ip address 2.0.0.1 255.255.255.0 ip rip version 2 mcast ! exit router rip no aut

20、o-summary network all ! end路由器RTC的配置不变。当然负荷分担还需要依靠主机的缺省网关来决定。比如本实验,将主机PCB的缺省网关改为10.110.32.2,就可以实现负荷分担了。此时各路由器的状态信息如下:RTA(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Standby Hot Standby IP : 10.110.32.2 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Ma

21、c Address : 00-e0-fc-00-5f-02 Ethernet0 |Group Number : 1 State : Active Hot Standby IP : 10.110.32.1 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01RTB(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Active Hot Standby IP :

22、 10.110.32.2 Priority : 120 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-02 Ethernet0 |Group Number : 1 State : Standby Hot Standby IP : 10.110.32.1 Priority : 100 Preempt : may Hold Time : 10 Hello Time: 3 Use Virtual Mac Address : 00-e0-fc-00-5f-01从此可以明确两台路由器都在其中一个备份组充当活动路由器,在另一备份组中充当备份路由器。如果某一路由器故障,则另一路由器充当两个备份组的活动路由器,如:RTB(config-if-Ethernet0)#shutdownRTB(config-if-Ethernet0)#show standby Ethernet0 |Group Number : 2 State : Init Hot Standby IP : 10.110.32.2 Priority

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论