实验拓扑如下:
 
 
基本配置:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

R1 上:

 

R1#show ip route

Codes: 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 route

 

Gateway of last resort is not set

 

C    192.168.6.0/24 is directly connected, FastEthernet0/0

C    192.168.1.0/24 is directly connected, Serial1/1

R    192.168.2.0/24 [120/1] via 192.168.6.3, 00:00:05, FastEthernet0/0

                    [120/1] via 192.168.6.2, 00:00:02, FastEthernet0/0

                    [120/1] via 192.168.1.2, 00:00:05, Serial1/1

 

R1(config)#router rip

R1(config-router)#offset-list <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1 in 6  给所有路由增加跳数。

 

 

 

 

 

如下路由表:

R1#show ip route

Codes: 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 route

 

Gateway of last resort is not set

 

C    192.168.6.0/24 is directly connected, FastEthernet0/0

C    192.168.1.0/24 is directly connected, Serial1/1

R    192.168.2.0/24 [120/7] via 192.168.6.3, 00:00:00, FastEthernet0/0

                    [120/7] via 192.168.6.2, 00:00:00, FastEthernet0/0

                    [120/7] via 192.168.1.2, 00:00:00, Serial1/1

R1#config t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#

 

等价多条路径的出现,可以负载均衡,但是为了指定通信线路(带宽等因素)

可以手工增加跳数,

比如:s1/1带宽500K Fa0/0带宽 100K,指定通信为s1/1

 

R1上进行如下配置:

 

R1(config-router)#offset-list 1 in 6 fa0/0

R1(config-router)#end

 

查看:

 

R1#show ip route  

Codes: 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 route

 

Gateway of last resort is not set

 

C    192.168.6.0/24 is directly connected, FastEthernet0/0

C    192.168.1.0/24 is directly connected, Serial1/1

R    192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:01, Serial1/1

 

 

实现指定通信线路,通信。当S1/1断掉的时候,

 

R1(config)#int s1/1

R1(config-if)#shutdown

R1(config-if)#end

 

 

R1#show ip route  

Codes: 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 route

 

Gateway of last resort is not set

 

C    192.168.6.0/24 is directly connected, FastEthernet0/0

R    192.168.1.0/24 [120/7] via 192.168.6.2, 00:00:00, FastEthernet0/0

R    192.168.2.0/24 [120/7] via 192.168.6.3, 00:00:00, FastEthernet0/0

                    [120/7] via 192.168.6.2, 00:00:00, FastEthernet0/0

 

 

实现了线路的浮动路由。