浮动静态路由配置
1、 实验目的
通过本次实验,我们可以在掌握浮动静态路由的原理,配置及其备份应用
2、 实验拓扑图
3、 实验步骤
(1) 根据拓扑图,配置路由器各个接口地址
Router(config)#hostname R1
R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#eixt
R1(config)#interface serial 2/0
R1(config-if)#ip ad
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#clock rate 128000
R1(config-if)#no sh
R1(config-if)#no shutdown
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shutdown
Router(config)#hostname R2
R2(config-if)#interface loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 2/0
R2(config-if)#ip ad
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no shutdown
(2)启动RIPv2,并配置一条静态路由
R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.1.2 130
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no au
R1(config-router)#no auto-summary
R1(config-router)#network 1.0.0.0
R1(config-router)#net
R1(config-router)#network 192.168.2.0
R1(config-router)#
R2(config)#ip route 1.1.1.0 255.255.255.0 192.168.1.1 130
R2(config)#router rip
R2(config-router)#ve
R2(config-router)#version 2
R2(config-router)#network 2.0.0.0
R2(config-router)#network 192.168.2.0
R2(config-router)#
(2)在R2上查看路由表
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 2.0.0.0/8 [120/1] via 192.168.2.2, 00:00:23, FastEthernet0/0
S 2.2.2.0/24 [130/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, Serial2/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
从以上的输出中可以看出,路由器将RIP的路由放入路由表中,因为RIP的管理距离的120,小于在静态路由器中设定的130,而静态路由处于备份的地位。
在路由器上关闭F0/0后,在查看路由表如下:
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [130/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, Serial2/0
R1#
由上可用看出,当主路由器中断后,备份的静态路由被放入路由表中,也很好的解释了浮动静态路由作为备份的工作原理。
在启动路由器的F0/0,查看路由表。
R1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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 route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 2.0.0.0/8 [120/1] via 192.168.2.2, 00:00:23, FastEthernet0/0
S 2.2.2.0/24 [130/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, Serial2/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
以上的输出表明有恢复到了原来的情况。浮动静态路由又恢复到备份的地位。