网关冗余和负载均衡HSRP.docx_第1页
网关冗余和负载均衡HSRP.docx_第2页
网关冗余和负载均衡HSRP.docx_第3页
网关冗余和负载均衡HSRP.docx_第4页
网关冗余和负载均衡HSRP.docx_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

网关冗余和负载均衡HSRP一、 交换机SW1(R6)交换机SW2(R4)配置R6enableR6#conf tR6(config)#hostname SW1SW1 (config)#int fa0/0SW1 (config-if)#no shutdownSW1 (config-if)#exitSW1 (config)#int fa0/1SW1 (config-if)#no shutdownSW1 (config-if)#exitSW1 (config)#int fa0/2SW1 (config-if)#no shutdownSW1 (config-if)#exitSW1#vlan databaseSW1 (vlan)#vlan 2VLAN 2 added: Name: VLAN0002SW1 (vlan)#exitSW1#conf tSW1 (config)#int range fa0/0 - 2SW1 (config-if-range)#switchport access vlan 2SW1 (config-if-range)#exitSW1 (config-if-range)#exitSW1(config)#int vlan 2SW1(config-if)#ip add 192.168.13.2 255.255.255.0SW1(config-if)#no shutdownSW1(config-if)#exitSW1(config)#exitSW1#R4enableR4#conf tR4(config)#host SW2SW2(config)#int fa0/1SW2(config-if)#no shutdownSW2(config-if)#exitSW2(config)#int f0/0SW2(config-if)#no shutdownSW2(config-if)#exitSW2(config)#exitSW2#vlan databaseSW2(vlan)#vlan 2VLAN 2 added: Name: VLAN0002SW2(vlan)#exitSW2#conf tSW2(config)#int range fa0/0 - 1SW2(config-if-range)#switchport access vlan 2SW2(config-if-range)#endSW2#二、 配置PC1(R7)PC2(R5)R7enableR7#conf tR7(config)#host PC1PC1(config)#no ip routingPC1(config)#int e0/0PC1(config-if)#ip add 192.168.13.100 255.255.255.0PC1(config-if)#no shutdownPC1(config-if)#exitPC1(config)#ip default-gateway 192.168.13.2PC1(config)#exitPC1#R5enableR5#conf tR5(config)#host PC2PC2 (config)#no ip routingPC2 (config)#int e0/0PC2 (config-if)#ip add 192.168.20.100 255.255.255.0PC2 (config-if)#no shutdownPC2 (config-if)#exitPC2 (config)#ip default-gateway 192.168.20.2三、 对路由器进行基本配置R1#conf tR1(config)#int e0/0R1(config-if)#ip add 192.168.13.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#int s1/0R1(config-if)#ip add 192.168.12.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#R2enableR2#conf tR2(config)#int s1/0R2(config-if)#ip add 192.168.12.2 255.255.255.0R2(config-if)#clock rate 128000R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int s1/1R2(config-if)#ip add 192.168.23.2 255.255.255.0R2(config-if)#clock rate 128000R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int e0/0R2(config-if)#ip add 192.168.20.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#exitR2#R3enableR3#conf tR3(config)#int s1/0R3(config-if)#ip add 192.168.23.3 255.255.255.0R3(config-if)#no shutdownR3(config)#int e0/0R3(config-if)#ip add 192.168.13.3 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#四、 配置路由协议R1#conf tR1(config)#router ripR1(config-router)#net 192.168.12.0R1(config-router)#net 192.168.13.0R1(config-router)#passive-interface e0/0 /把e0/0接口设为被接口,为了防止从该接口发送RIP信息给R3R1(config-router)#exitR1(config)#exitR1#R2#conf tR2(config)#router ripR2(config-router)#net 192.168.12.0R2(config-router)#net 192.168.23.0R2(config-router)#net 192.168.20.0R2(config-router)#passive-interface e0/0R2(config-router)#exitR2(config)#exitR2#R3#conf tR3(config)#router ripR3(config-router)#net 192.168.13.0R3(config-router)#net 192.168.23.0R3(config-router)#passive-interface e0/0R3(config-router)#exitR3(config)#exitR3#五、查看路由表R1#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial1/0C 192.168.13.0/24 is directly connected, Ethernet0/0R 192.168.20.0/24 120/1 via 192.168.12.2, 00:00:28, Serial1/0R 192.168.23.0/24 120/1 via 192.168.13.3, 00:01:12, Ethernet0/0 120/1 via 192.168.12.2, 00:00:06, Serial1/0R1#前后对比R1#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial1/0C 192.168.13.0/24 is directly connected, Ethernet0/0R 192.168.20.0/24 120/1 via 192.168.12.2, 00:00:28, Serial1/0R 192.168.23.0/24 120/1 via 192.168.12.2, 00:00:02, Serial1/0R1#R2#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial1/0R 192.168.13.0/24 120/1 via 192.168.23.3, 00:00:17, Serial1/1 120/1 via 192.168.12.1, 00:00:14, Serial1/0C 192.168.20.0/24 is directly connected, Ethernet0/0C 192.168.23.0/24 is directly connected, Serial1/1R2#R3#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not setR 192.168.12.0/24 120/1 via 192.168.23.2, 00:00:16, Serial1/0C 192.168.13.0/24 is directly connected, Ethernet0/0R 192.168.20.0/24 120/1 via 192.168.23.2, 00:00:12, Serial1/0C 192.168.23.0/24 is directly connected, Serial1/0R3#五、 测试R1#ping 192.168.20.100Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.20.100, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 60/80/120 msR1#六、 配置HSRPR1#conf tR1(config)#int e0/0R1(config-if)#standby 1 ip 192.168.13.254 /启用HSRP功能,并设置虚拟IP地址R1(config-if)#standby 1 priority 120 /配置HSRP的优先级,默认优先级为100R1(config-if)#standby 1 preempt /允许该路由器在优先级是最高时成为活动路由器R1(config-if)#standby 1 timer 3 10 /3为hello时间,10为hold时间R1(config-if)#standby 1 authentication md5 key-string cisco /配置认证密码R1(config-if)#R3#conf tR3(config)#int e0/0R3(config-if)#standby 1 ip 192.168.13.254R3(config-if)#standby 1 preemptR3(config-if)#standby 1 time 3 10R3(config-if)#standby 1 authentication md5 key-string ciscoR3(config-if)#endR3#七、检查测试HSRPR1#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 120 Active local 192.168.13.3 192.168.13.254R1#R3#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 100 P Standby 192.168.13.1 local 192.168.13.254R3#八、对R1进行变动再次查看检测HSRPR1#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 120 Init unknown unknown 192.168.13.254R1#R3#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 100 P Active local unknown 192.168.13.254R3#九、对R1进行变动再次查看检测HSRPR1#conf tR1(config)#int e0/0R1(config-if)#standby 1 track s1/0 30R1(config-if)#exitR1(config)#int s1/0R1(config-if)#shutdownR1(config-if)#exitR1(config)#R1#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 90 Standby 192.168.13.3 local 192.168.13.254R1#R3#sh standby brief P indicates configured to preempt. |Interface Grp Prio P State Active Standby Virtual IPEt0/0 1 100 P Active local 192.168.13.1 192.168.13.254R3#十、创建多个HSRP组R

温馨提示

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

评论

0/150

提交评论