通过动态路由协议实现链路备份 实验名称 通过动态路由协议实现链路备份 实验目的 掌握通过在不同链路上配置不同的路由协议实现链路备份 背景描述 你是公司高级网络管理员, 公司内部有一个很重要的服务器所在网段为 192.168.12.0/24, 平常访问通过 R1,R3 的 OSPF 路由协议, 为了保证该网段随时能够访问, 不能因为链路故障出问题, 要求你实现一个备份冗余的功能, 请给予支持 实现功能 保证在拥有冗余链路的时候, 主链路失效, 备份链路工作 实验拓扑 实验设备 R2624(3 台 ) V35DCE(2 根 ) V35DTE(2 根 )
实验步骤 第一步 : 基本配置 Red-Giant(config)#hos R3 R3(config)#int s0 R3(config-if)#ip add 192.168.13.3 255.255.255.0 R3(config-if)#clock rate 64000 R3(config-if)#int f0 R3(config-if)#ip add 192.168.4.1 255.255.255.0 R3(config)#int f1 R3(config-if)#ip add 192.168.3.1 255.255.255.0 R3(config)#int s1 R3(config-if)#ip add 192.168.23.3 255.255.255.0 R3(config-if)#cl ra 64000 R3(config-if)#end Red-Giant(config)# Red-Giant(config)# hos R2 R2(config)#int s0 R2(config-if)# int s0 R2(config-if)#ip add 192.168.23.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#int f0 R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#end Red-Giant(config)#hos R1 R1(config)#int s0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#int s0 R1(config-if)#no sh R1(config-if)#end R1#conf t R1(config)#int f0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#no sh 验证测试 :R1#ping 192.168.13.3 Type escape sequence to abort.
Sending 5, 100-byte ICMP Echoes to 192.168.13.3, timeout is 2 seconds: R2#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.23.3, timeout is 2 seconds: 第二步 : 配置主链路路由以及备份链路路由 R1(config)#router os 1 R1(config-router)#net 192.168.13.0 0.0.0.255 area 0 R1(config-router)#net 192.168.12.0 0.0.0.255 area 2 R3(config)#router os 1 R3(config-router)#net 192.168.13.0 0.0.0.255 area 0 R3(config-router)#net 192.168.4.0 0.0.0.255 area 1 R3(config-router)#net 192.168.3.0 0.0.0.255 area1 R3(config)#router rip 配置 RIP 协议作为备份,RIP 协议管理距离大于 OSPF,OSPF 自动成为主路由协议 R3(config-router)#ver 2 R3(config-router)# net 192.168.23.0 R3(config-router)#no auto-summary R2(config)#router rip R2(config-router)#version 2 R2(config-router)#net 192.168.23.0 R2(config-router)#net 192.168.12.0 R2(config-router)#no auto-summary 验证测试 : R3#sh ip ro Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2 Gateway of last resort is not set O IA 192.168.12.0/24 [110/49] via 192.168.13.1, 00:00:42, Serial0 C 192.168.13.0/24 is directly connected, Serial0 C 192.168.3.0/24 is directly connected, FastEthernet1 C 192.168.4.0/24 is directly connected, FastEthernet0 C 192.168.23.0/24 is directly connected, Serial1 第三步 : 当主链路 down 的时候, 可以通过备份链路通信 R3(config)#int s0 R3(config-if)#shut
R3#sh ip ro Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2 Gateway of last resort is not set R C C C 192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:13, Serial1 192.168.3.0/24 is directly connected, FastEthernet1 192.168.4.0/24 is directly connected, FastEthernet0 192.168.23.0/24 is directly connected, Serial1 第四步 : 当主链路 up 的时候, 仍然用主链路通信 R3(config)#int s0 R3#sh ip ro Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2 Gateway of last resort is not set O IA 192.168.12.0/24 [110/49] via 192.168.13.1, 00:14:45, Serial0 C 192.168.13.0/24 is directly connected, Serial0 C 192.168.3.0/24 is directly connected, FastEthernet1 C 192.168.4.0/24 is directly connected, FastEthernet0 C 192.168.23.0/24 is directly connected, Serial1 注意事项 配置备份路由的管理距离必须大于主路由的管理距离 参考配置 R3#sh run Current configuration: version 6.14(2) hostname "R3" ip subnet-zero interface FastEthernet0 ip address 192.168.4.1 255.255.255.0
interface FastEthernet1 ip address 192.168.3.1 255.255.255.0 interface FastEthernet2 interface FastEthernet3 interface Serial0 ip address 192.168.13.3 255.255.255.0 clock rate 64000 interface Serial1 ip address 192.168.23.3 255.255.255.0 clock rate 64000 router ospf 1 network 192.168.13.0 0.0.0.255 area 0 network 192.168.4.0 0.0.0.255 area 1 network 192.168.3.0 0.0.0.255 area 1 router rip version 2 network 192.168.23.0 no auto-summary ip classless line con 0 line aux 0 line vty 0 4 login end R1#sh run Current configuration: version 6.14(2) hostname "R1"
ip subnet-zero interface FastEthernet0 ip address 192.168.12.1 255.255.255.0 interface FastEthernet1 interface FastEthernet2 interface FastEthernet3 interface Serial0 ip address 192.168.13.1 255.255.255.0 interface Serial1 router ospf 1 network 192.168.13.0 0.0.0.255 area 0 network 192.168.12.0 0.0.0.255 area 2 ip classless line con 0 line aux 0 line vty 0 4 no login end R2#sh run Current configuration: version 6.14(2)
hostname "R2" ip subnet-zero interface FastEthernet0 ip address 192.168.12.2 255.255.255.0 interface FastEthernet1 interface FastEthernet2 interface FastEthernet3 interface Serial0 ip address 192.168.23.2 255.255.255.0 interface Serial1 router rip version 2 network 192.168.23.0 network 192.168.12.0 no auto-summary ip classless line con 0 line aux 0 line vty 0 4 login end