作者:   stanley.wy & allens
浮动静态路由_第1张图片
 
 
R1
fa0/0
192.168.1.1/24
 
s1/1
192.168.2.1/24
R2
fa0/0
192.168.1.2/24
 
s1/0
192.168.2.2/24
 
lo 0
192.168.3.1/24
 
步骤一:配置各路由器的 IP 地址,并使用 ping 命令确认直连接口相互可以 ping 通。
 
步骤二:在 R1 上配置到 R2 的回环接口的静态路由.
 
R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.2
R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 [s1] 
 
步骤三:分析:查看 R1 的路由表
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, 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 route
 
Gateway of last resort is not set
 
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, Serial1/1
S    192.168.3.0/24 [1/0] via 192.168.1.2
                    [1/0] via 192.168.2.2
[s2]  R1#
 
步骤三:先删除原先路由,调整静态路由
R1(config)#no ip route 192.168.3.0 255.255.255.0 192.168.2.2 [s3] 
R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 100 [s4] 
 
步骤四:再次检查路由表 , 发现路由器没有做均分负载
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, 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 route
 
Gateway of last resort is not set
 
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, Serial1/1
S    192.168.3.0/24 [1/0] via 192.168.1.2 [s5] 
 
步骤五:将 R1 fa0/0 的接口 shutdown 掉.再观察路由表
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, 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 route
 
Gateway of last resort is not set
 
C    192.168.2.0/24 is directly connected, Serial1/1
S    192.168.3.0/24 [100/0] via 192.168.2.2 [s6] 
 

 [s1] 因为R1有两条路径到达R2的192.168.3.0/24的网络
 [s2] 在此发现R1在做均分负载.但是注意:R1R2的广域网连接的速度与以太网连接网速度并不匹配.在此做法是不智的.
 [s3] 删除目的,是避免做均分负载
 [s4] 指出此条路由管理距离为100.需要注意的是默认的管理离是1.而且路由器永远会选择管理距离小的路由.
 [s5] 到达192.168.3.0/24目前下一跳为192.168.1.2/24
 [s6] 到达192.168.3.0/24现在使用192.168.2.2/24作为下一跳.