2.3浮动静态路由
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://sharkii.blog.51cto.com/325987/63153 | ||||||||||||||||||||
为R1建立浮动静态路由:
ip route 1.1.1.0 255.255.255.0 12.1.1.2
ip route 1.1.1.0 255.255.255.0 21.1.1.2 50
ip route 2.2.2.0 255.255.255.0 12.1.1.2
ip route 2.2.2.0 255.255.255.0 21.1.1.2 50
ip route 3.3.3.0 255.255.255.0 12.1.1.2
ip route 3.3.3.0 255.255.255.0 21.1.1.2 50
为R2建立浮动静态路由
ip route 4.4.4.0 255.255.255.0 12.1.1.1
ip route 4.4.4.0 255.255.255.0 21.1.1.1 50
注意:蓝色的路由形式就是浮动静态路由路由,路由后面的权值50表示指定的(管理距离),管理距离越高其路由优先权越低(权值范围在1-255之间),例如:指向下一跳地址的IPv4的静态路由的管理距离为1,而指向出站接口的静态路由的管理距离为0。如果有两条静态路由指向相同的目标网络,一条指向下一跳地址,一条指向出站接口,那么则优选后者(管理距离越低路由优先权越高)。
下面看看R1三种情况的路由表:1:正常情况---à2:主链路失效---à3:主链路恢复
正常情况
R1#show ip route
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [1/0] via 12.1.1.2
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [1/0] via 12.1.1.2
3.0.0.0/24 is subnetted, 1 subnets
S 3.3.3.0 [1/0] via 12.1.1.2
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
21.0.0.0/24 is subnetted, 1 subnets
C 21.1.1.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
主链路失效
R1(config)#int s1/0
R1(config-if)#shutdown
*Jan 6 18:00:52.819: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
R1#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [50/0] via 21.1.1.2
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [50/0] via 21.1.1.2
3.0.0.0/24 is subnetted, 1 subnets
S 3.3.3.0 [50/0] via 21.1.1.2
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
21.0.0.0/24 is subnetted, 1 subnets
C 21.1.1.0 is directly connected, Serial1/1
主链路恢复
R1(config)#int s1/0
R1(config-if)#no shutdown
*Jan 6 18:01:21.935: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Jan 6 18:01:22.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R1#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
S 1.1.1.0 [1/0] via 12.1.1.2
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [1/0] via 12.1.1.2
3.0.0.0/24 is subnetted, 1 subnets
S 3.3.3.0 [1/0] via 12.1.1.2
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
21.0.0.0/24 is subnetted, 1 subnets
C 21.1.1.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
通过以上对R1 S1/0接口的关开,可以看到3个路由表的变化(主备/链路的切换)。
提示:在每条路由条目中的括号内的数字是,例如[1/0],前者指定了管理距离为1,后者指定度量值为0(因为静态路由没有度量值)。因此对于相同的目标网络,缺省情况下,到相同目标网络的静态路由总是优先于动态路由。 本文出自 “Sharkii” 博客,请务必保留此出处http://sharkii.blog.51cto.com/325987/63153 本文出自 51CTO.COM技术博客 | ||||||||||||||||||||




sharkii
博客统计信息
热门文章
最新评论
友情链接