本帖最后由 zd6 于 2013-4-12 09:04 编辑
RIP 自动汇总及有无类路由
实验配置: RIPv1 R1#conf t R1(conifg)#int f0/0 R1(config-if)#ip add 172.16.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#int s0/0 R1(config-if)#clock rate 64000//串行接口DCE端配置时钟速率,使用show controllers s0/0命令查看 R1(config-if)#ip add 200.0.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#router rip R1(config-router)#network 172.16.1.0 R1(config-router)#network 200.0.1.0
R2#conf t R2(conf ig)int f0/0 R2(conf ig-if)#ip add 172.16.2.2 255.255.255.0 R2(conf ig-if)#no shutdown R2(conf ig-if)#int f0/1 R2(conf ig-if)#ip add 200.0.2.1 255.255.255.0 R2(conf ig-if)#no shutdown R2(conf ig-if)#int s0/0 R2(conf ig-if)#ip add 200.0.1.2 255.255.255.0 R2(conf ig-if)#no shutdown R2(config)#router rip R2(conf ig-router)#network 172.16.2.1 R2(conf ig-router)#network 200.0.1.0 R2(conf ig-router)#network 200.0.2.0
R3#conf t R3(config)#int f0/0 R3(conf ig-if)#ip add 172.16.3.1 255.255.255.0 R3(conf ig-if)#no shutdown R3(conf ig-if)#int f0/1 R3(conf ig-if)#ip add 200.0.2.2 255.255.255.0 R3(conf ig-if)#no shutdown R3(config)#router rip R3(conf ig-router)#network 172.16.3.0 R3(conf ig-router)#network 200.0.2.0
PC0: Ip address 172.16.1.2 Subnet Mask 255.255.255.0 Default Getway 172.16.1.1 PC1: Ip address 172.16.2.2 Subnet Mask 255.255.255.0 Default Getway 172.16.2.1 PC2: Ip address 172.16.3.2 Subnet Mask 255.255.255.0 Default Getway 172.16.3.1
实验结果:
R1:show ip route
R2:show ip route
R3: show ip route
主机之间无法通信,RIP协议采用了RIPv1,由于RIPv1是有类路由协议(不携带子网掩码),所以在路由表中无法学习到其他相同主类网络的网段。
RIPv2 不关闭自动汇总:
R1#conf t R1(conifg)#int f0/0 R1(config-if)#ip add 172.16.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#int s0/0 R1(config-if)#clock rate 64000//串行接口DCE端配置时钟速率,使用show controllers s0/0命令查看 R1(config-if)#ip add 200.0.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#router rip R1(conf ig-router)#version 2 R1(config-router)#network 172.16.1.0 R1(config-router)#network 200.0.1.0
R2#conf t R2(conf ig)int f0/0 R2(conf ig-if)#ip add 172.16.2.2 255.255.255.0 R2(conf ig-if)#no shutdown R2(conf ig-if)#int f0/1 R2(conf ig-if)#ip add 200.0.2.1 255.255.255.0 R2(conf ig-if)#no shutdown R2(conf ig-if)#int s0/0 R2(conf ig-if)#ip add 200.0.1.2 255.255.255.0 R2(conf ig-if)#no shutdown R2(config)#router rip R2(conf ig-router)#version 2 R2(conf ig-router)#network 172.16.2.1 R2(conf ig-router)#network 200.0.1.0 R2(conf ig-router)#network 200.0.2.0
R3#conf t R3(config)#int f0/0 R3(conf ig-if)#ip add 172.16.3.1 255.255.255.0 R3(conf ig-if)#no shutdown R3(conf ig-if)#int f0/1 R3(conf ig-if)#ip add 200.0.2.2 255.255.255.0 R3(conf ig-if)#no shutdown R3(config)#router rip R3(conf ig-router)#version 2 R3(conf ig-router)#network 172.16.3.0 R3(conf ig-router)#network 200.0.2.0
PC0: Ip address 172.16.1.2 Subnet Mask 255.255.255.0 Default Getway 172.16.1.1 PC1: Ip address 172.16.2.2 Subnet Mask 255.255.255.0 Default Getway 172.16.2.1 PC2: Ip address 172.16.3.2 Subnet Mask 255.255.255.0 Default Getway 172.16.3.1
实验结果:
R1:show ip route
R2:show ip route
R3:show ip route
主机之间可以通信,RIP协议采用了RIPv2,由于RIPv2是无类路由协议(携带子网掩码)所以在路由表中学习到了其他同主类网络的网段。但由于RIPv2默认的进行了自动汇总,所以在路由表中体现了172.16.0.0/16的主类网络。网络虽然可以通信,但增加了路由网络的额外开销。
RIPv2 关闭自动汇总: 使用R(config-router)#no auto-summary命令关闭自动汇总功能。
实验结果:
R1: show ip route
R2: show ip route
R3: show ip route
主机之间可以通信,由于关闭了自动汇总,路由表中出现了所有相关子网,而不是只有主类网络,因此减少了网络的额外开销。
自动汇总:自动汇总的目的是为了优化大量网段在路由通告中给路由带来的负担,以及由于庞大的路由表导致了路由器在进行路由转发过程中转发速度减慢。自动汇总会对相同主类网段中的多个子网进行汇总,其目的在于解决上述问题。在网络设计实施过程中切忌不能随意应用路由汇总,路由汇总只有在有合理设计及规划的基础上进行应用。
|