博客统计信息

51cto推荐博客
用户名:sharkii
文章数:13
评论数:37
访问量:18118
无忧币:20
博客积分:802
博客等级:2
注册日期:2008-02-26

我的技术圈(2)

更多>>
3.4 RIP的汇总和不连续网络
2008-03-06 22:28:10
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://sharkii.blog.51cto.com/325987/64472

 

3.4 RIP的汇总和不连续网络
 
实验连接图
提要描述
RIPv2中存在的是自动汇总,虽然可以简化了路由表的条目,但是如果出现了不连续网络这样的情况,就会丢失路由信息。所以在用RIPv2的时候直接可以毫不犹豫的关闭掉。而在RIP v1中存在的叫做边界路由的问题。   边界就是在有类的网络中才会出现的 一种汇总的现象,介乎于两个主类 。而不连续网络就是同一个主网络或子网被另一网络隔断。
实验目标:调试出自动汇总、手动汇总、边界汇总、不连续子网的现象,以及解决这些现象的办法。
基本配置
R1的配置
R2的配置
!
hostname R1
interface Serial1/1
ip address 12.1.1.1 255.255.255.0
no sh
clock rate 64000
!
Router rip
 Version 2
 Network 12.1.1.0
!
!
hostname R2
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
no sh
!
interface Serial1/1
ip address 192.168.1.2 255.255.255.0
no sh
!
Router rip
Version 2
Network 12.1.1.0
Network 192.168.1.0
!
R3的配置
 
!
hostname R3
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.0
!
interface Loopback1
 ip address 10.1.2.1 255.255.255.0
!
interface Loopback2
 ip address 10.1.3.1 255.255.255.0
!
interface Loopback3
 ip address 10.1.4.1 255.255.255.0
!
interface Serial1/0
ip address 192.168.1.3 255.255.255.0
no sh
clock rate 64000
!
router rip
version 2
network 10.1.1.0
network 10.1.2.0
network 10.1.3.0
network 10.1.4.0
network 192.168.1.0
!
 
↓调试配置及监测步骤↓
 
首先R1R2R3都已经运行了RIPv2
查看R1R2R3的路由表
 
R1#show ip route
R    10.0.0.0/8 [120/2] via 12.1.1.2, 00:00:23, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/1
R    192.168.1.0/24 [120/1] via 12.1.1.2, 00:00:23, Serial1/1
 
R2#show ip route
R    10.0.0.0/8 [120/1] via 192.168.1.3, 00:00:22, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/1
 
R3#show ip route    
     10.0.0.0/24 is subnetted, 4 subnets
C       10.1.3.0 is directly connected, Loopback2
C       10.1.2.0 is directly connected, Loopback1
C       10.1.1.0 is directly connected, Loopback0
C       10.1.4.0 is directly connected, Loopback3
R    12.0.0.0/8 [120/1] via 192.168.1.2, 00:00:08, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
由以上三个路由表可以看到,学到的路由全部都是自动汇总的。
 
下面我们关闭自动汇总看看:
 
R1(config)#router rip
R1(config-router)#no auto-summary
 
R2(config)#router rip
R2(config-router)#no auto-summary
 
R3(config)#router rip
R3(config-router)#no auto-summary
 
现在再看看各个路由表的情况:
 
R1#show ip route
     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R       10.1.3.0/24 [120/2] via 12.1.1.2, 00:00:21, Serial1/1
R       10.1.2.0/24 [120/2] via 12.1.1.2, 00:00:21, Serial1/1
R       10.1.1.0/24 [120/2] via 12.1.1.2, 00:00:21, Serial1/1
R       10.0.0.0/8 [120/2] via 12.1.1.2, 00:00:21, Serial1/1
R       10.1.4.0/24 [120/2] via 12.1.1.2, 00:00:21, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/1
R    192.168.1.0/24 [120/1] via 12.1.1.2, 00:00:21, Serial1/1
 
 
R2#show ip route
     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R       10.1.3.0/24 [120/1] via 192.168.1.3, 00:00:17, Serial1/1
R       10.1.2.0/24 [120/1] via 192.168.1.3, 00:00:17, Serial1/1
R       10.1.1.0/24 [120/1] via 192.168.1.3, 00:00:17, Serial1/1
R       10.0.0.0/8 [120/1] via 192.168.1.3, 00:02:08, Serial1/1
R       10.1.4.0/24 [120/1] via 192.168.1.3, 00:00:17, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/1
 
R3#show ip route
     10.0.0.0/24 is subnetted, 4 subnets
C       10.1.3.0 is directly connected, Loopback2
C       10.1.2.0 is directly connected, Loopback1
C       10.1.1.0 is directly connected, Loopback0
C       10.1.4.0 is directly connected, Loopback3
     12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       12.1.1.0/24 [120/1] via 192.168.1.2, 00:00:14, Serial1/0
R       12.0.0.0/8 [120/1] via 192.168.1.2, 00:02:04, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
对比前面没有关闭自动汇总,现在的路由表学到的全部是明细路由。等一些时间后再查看路由表,上面阴影的路由条目就会消失
 
当然我们也可以手动精确汇总,例如:把R310.1.1.1汇总成10.1.0.0/16
R3(config)#int s1/0
R3(config-if)#ip summary-address rip 10.1.0.0 255.255.0.0
 
R2#show ip route
     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R       10.1.3.0/24 [120/1] via 192.168.1.3, 00:00:16, Serial1/1
R       10.1.2.0/24 [120/1] via 192.168.1.3, 00:00:16, Serial1/1
R       10.1.1.0/16 [120/1] via 192.168.1.3, 00:00:16, Serial1/1
R       10.1.1.0/24 [120/1] via 192.168.1.3, 00:00:16, Serial1/1
R       10.1.4.0/24 [120/1] via 192.168.1.3, 00:00:16, Serial1/1
可以看到R2多出了一条10.1.1.0/16的路由,这就是手动汇总的精确路由
 
 
 
下面我们看看各路由器运行RIPv1边界汇总不连续子网问题
 
R1的配置
R2的配置
!
hostname R1
interface Serial1/1
ip address 12.1.1.1 255.255.255.0
no sh
clock rate 64000
!
Router rip
 Network 12.1.1.0
!
!
hostname R2
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
no sh
!
interface Serial1/1
ip address 192.168.1.2 255.255.255.0
no sh
!
Router rip
Network 12.1.1.0
Network 192.168.1.0
!
R3的配置
 
!
hostname R3
!
interface Serial1/0
ip address 192.168.1.3 255.255.255.0
no sh
clock rate 64000
!
router rip
network 192.168.1.0
!
 
 
1如果路由2边的主类网络号不相同的情况下,路由就会把一边的路由信息汇总转发出去
2如果路由2边的主类网络号相同的情况下,路由会不做汇总直接转发出去
 
现在看看在边界路由R2debug的情况
R2#debug ip rip
R2#
*Mar  6 21:19:14.887: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (192.168.1.2)
*Mar  6 21:19:14.887: RIP: build update entries
*Mar  6 21:19:14.891:   network 12.0.0.0 metric 1
 
再看看R3的路由表:
R3# show ip route
R    12.0.0.0/8 [120/1] via 192.168.1.2, 00:00:26, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0
 
R2debug信息R3的路由表可以看到,R2在向R3发送路由信息时候,并没有把我们配置宣告的12.1.1.0/24网络通告给R3,而是通告主类网络12.0.0.0/8与上面RIPv2没有关闭自动汇总发送的情况一样这就是RIP发送路由更新跨越网络边界时,它会按照(ABC类)的掩码进行汇总,即边界汇总
 
现在我们看看R3上配置一个loopback4接口,地址为12.1.2.1/24,使它与12.1.1.0/24形成一个不连续网络的情况。且打开debug观察。
 
R3(config)#interface loopback 4
R3(config-if)#ip address 12.1.2.1 255.255.255.0
 
R3#debug ip rip
R3#
*Mar  6 21:40:51.267: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (192.168.1.3)
*Mar  6 21:40:51.267: RIP: build update entries - suppressing null update
R3#
*Mar  6 21:41:00.051: RIP: received v1 update from 192.168.1.2 on Serial1/0
*Mar  6 21:41:00.055:      12.0.0.0 in 1 hops
 
R3#show ip route
     12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       12.0.0.0/8 [120/1] via 192.168.1.2, 00:00:49, Serial1/0
C       12.1.2.0/24 is directly connected, Loopback4
C    192.168.1.0/24 is directly connected, Serial1/0
 
debug信息可以看到R3仍然一直收到来自R1的更新,但当我们查看R3路由表时,更新的时间已经为49S12.0.0.0/8这条路由已经没有再周期更新了,过一些时间就出现possibly down
 
R3#show ip route
     12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       12.0.0.0/8 is possibly down,routing via 192.168.1.2, Serial1/0
C       12.1.2.0/24 is directly connected, Loopback4
C    192.168.1.0/24 is directly connected, Serial1/0
大概4分钟之后,在R3的路由表就看不到R1通告过来的路由条目。
R3#show ip route
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.2.0 is directly connected, Loopback4
C    192.168.1.0/24 is directly connected, Serial1/0
 
出现上述的原因是R3looback 4接口是直连接口,接受来自相同12.0.0.0的更新时,它会丢弃。只选择来自直连接口的路由。
 
 
遇到这样的问题,我们可以通过设置辅助地址(第二地址)来解决,辅助地址要与不连续网络位于同一个主网络内,并且使用相同的子网掩码。下面我们在R2R3上设置。
 
R2(config)#int s1/1
R2(config-if)#ip address 12.1.3.1 255.255.255.0 secondary
 
R3(config)#int s1/0
R3(config-if)#ip address 12.1.3.2 255.255.255.0 secondary
 
再次观察R3debug信息和路由表
 
R3#debug ip rip
*Mar  6 22:13:47.587: RIP: received v1 update from 192.168.1.2 on Serial1/0
*Mar  6 22:13:47.587:      12.0.0.0 in 1 hops
*Mar  6 22:13:47.587: RIP: received v1 update from 12.1.3.1 on Serial1/0
*Mar  6 22:13:47.591:      12.1.1.0 in 1 hops
 
R3#show ip route
     12.0.0.0/24 is subnetted, 4 subnets
R       12.1.1.0 [120/1] via 12.1.3.1, 00:00:10, Serial1/0
R       12.0.0.0 [120/1] via 192.168.1.2, 00:00:10, Serial1/0
C       12.1.3.0 is directly connected, Serial1/0
C       12.1.2.0 is directly connected, Loopback4
C    192.168.1.0/24 is directly connected, Serial1/0
 
可以看到现在的R3已经有了12.1.1.0/24的路由条目,当然R1也学到了12.1.3.0/24的路由条目
 
R1#show ip route
     12.0.0.0/24 is subnetted, 2 subnets
C       12.1.1.0 is directly connected, Serial1/1
R       12.1.3.0 [120/1] via 12.1.1.2, 00:00:12, Serial1/1
R    192.168.1.0/24 [120/1] via 12.1.1.2, 00:00:12, Serial1/1
 
测试一下R1R3的互通性
R1#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/86/156 ms
 
R3#ping 12.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/98/132 ms
 
留心观察会发现辅助地址不但解决了不连续网络的问题,而且也解决了边界汇总的问题。所以很多时候不连续网络和边界汇总是同时出现的。

本文出自 “Sharkii” 博客,请务必保留此出处http://sharkii.blog.51cto.com/325987/64472

分享至
更多
一键收藏,随时查看,分享好友!
Sliencer、anxiang1987
2人
了这篇文章
类别:IGP技术圈()┆阅读()┆评论() ┆ 推送到技术圈返回首页

文章评论

 
2008-03-07 10:34:06
一个网络的路由汇总很只重要 可以压缩路由表 支持

2008-03-09 09:19:15
详细的,,,,分析的彻底

2008-03-10 01:35:23
回复 [匿名]leesun

呵呵~汇总对于早期的网络确实很有用~其实相对于现在的网络设备的硬件性能来讲,路由表大些也没有什么问题。现在一台只有奔腾二性能的路由器就可以承载十多万条bgp路由了,国外有些大学甚至直接就用pc主机来跑路由。在一个铁路系统的工程中,我见过中心与各个售票点之家,竟然有几百条明细的静态路由,但是看都“哗”了一声。

有空可以telnet上一些开放权限的设备上看看那些眼都看花了的bgp路由。对学习bgp多小有些帮助。

例如:telnet://route-server.he.net

route-server.he.net> sh ip bgp ?
A.B.C.D       IP prefix <network>/<length>, e.g., 35.0.0.0/8
A.B.C.D       Network in the BGP routing table to display
cidr-only     Display only routes with non-natural netmasks
community     Display routes matching the communities
community-list   Display routes matching the community-list
dampening     Display detailed information about dampening
filter-list     Display routes conforming to the filter-list
inconsistent-as Display only routes with inconsistent origin ASs
injected-paths   Display all injected paths
ipv4         Address family
neighbors     Detailed information on TCP and BGP neighbor connections
paths         Path information
peer-group     Display information on peer-groups
prefix-list     Display routes matching the prefix-list
quote-regexp   Display routes matching the AS path "regular expression"
regexp       Display routes matching the AS path regular expression
route-map     Display routes matching the route-map
summary       Summary of BGP neighbor status
vpnv4         Display VPNv4 NLRI specific information
|           Output modifiers
<cr>


2011-10-25 16:03:43
简直就是一个词语!!!-----完美!!!很给力

2012-02-15 22:23:09
原来辅助地址可以这么使用,学习了!

 

发表评论            

【技术门诊】专家解析:软考重点难点及应试技巧
昵  称:
登录  快速注册
验证码:

请点击后输入验证码博客过2级,无需填写验证码

内  容: