RIP自动汇总及有无类路由
本帖最后由 zd6 于 2013-4-12 09:04 编辑RIP自动汇总及有无类路由
实验配置:RIPv1R1#conft R1(conifg)#int f0/0R1(config-if)#ip add 172.16.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#int s0/0R1(config-if)#clock rate 64000//串行接口DCE端配置时钟速率,使用show controllers s0/0命令查看R1(config-if)#ip add 200.0.1.1 255.255.255.0R1(config-if)#no shutdownR1(config)#router ripR1(config-router)#network 172.16.1.0R1(config-router)#network 200.0.1.0
R2#conftR2(conf ig)int f0/0R2(conf ig-if)#ip add 172.16.2.2 255.255.255.0R2(conf ig-if)#no shutdown R2(conf ig-if)#int f0/1R2(conf ig-if)#ip add 200.0.2.1 255.255.255.0R2(conf ig-if)#no shutdownR2(conf ig-if)#int s0/0R2(conf ig-if)#ip add 200.0.1.2 255.255.255.0R2(conf ig-if)#no shutdownR2(config)#router ripR2(conf ig-router)#network 172.16.2.1R2(conf ig-router)#network 200.0.1.0R2(conf ig-router)#network 200.0.2.0
R3#conftR3(config)#int f0/0R3(conf ig-if)#ip add 172.16.3.1 255.255.255.0R3(conf ig-if)#no shutdownR3(conf ig-if)#int f0/1R3(conf ig-if)#ip add 200.0.2.2 255.255.255.0R3(conf ig-if)#no shutdown R3(config)#router rip R3(conf ig-router)#network 172.16.3.0R3(conf ig-router)#network 200.0.2.0
PC0:Ip address 172.16.1.2Subnet Mask 255.255.255.0Default Getway 172.16.1.1PC1:Ip address 172.16.2.2Subnet Mask 255.255.255.0Default Getway 172.16.2.1PC2:Ip address 172.16.3.2Subnet Mask 255.255.255.0Default Getway 172.16.3.1
实验结果:
R1:show ip route
R2:show ip route
R3: show ip route
主机之间无法通信,RIP协议采用了RIPv1,由于RIPv1是有类路由协议(不携带子网掩码),所以在路由表中无法学习到其他相同主类网络的网段。
RIPv2 不关闭自动汇总:
R1#conft R1(conifg)#int f0/0R1(config-if)#ip add 172.16.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#int s0/0R1(config-if)#clock rate 64000//串行接口DCE端配置时钟速率,使用show controllers s0/0命令查看R1(config-if)#ip add 200.0.1.1 255.255.255.0R1(config-if)#no shutdownR1(config)#router ripR1(conf ig-router)#version 2R1(config-router)#network 172.16.1.0R1(config-router)#network 200.0.1.0
R2#conftR2(conf ig)int f0/0R2(conf ig-if)#ip add 172.16.2.2 255.255.255.0R2(conf ig-if)#no shutdown R2(conf ig-if)#int f0/1R2(conf ig-if)#ip add 200.0.2.1 255.255.255.0R2(conf ig-if)#no shutdownR2(conf ig-if)#int s0/0R2(conf ig-if)#ip add 200.0.1.2 255.255.255.0R2(conf ig-if)#no shutdownR2(config)#router ripR2(conf ig-router)#version 2R2(conf ig-router)#network 172.16.2.1R2(conf ig-router)#network 200.0.1.0R2(conf ig-router)#network 200.0.2.0
R3#conftR3(config)#int f0/0R3(conf ig-if)#ip add 172.16.3.1 255.255.255.0R3(conf ig-if)#no shutdownR3(conf ig-if)#int f0/1R3(conf ig-if)#ip add 200.0.2.2 255.255.255.0R3(conf ig-if)#no shutdown R3(config)#router ripR3(conf ig-router)#version 2R3(conf ig-router)#network 172.16.3.0R3(conf ig-router)#network 200.0.2.0
PC0:Ip address 172.16.1.2Subnet Mask 255.255.255.0Default Getway 172.16.1.1PC1:Ip address 172.16.2.2Subnet Mask 255.255.255.0Default Getway 172.16.2.1PC2:Ip address 172.16.3.2Subnet Mask 255.255.255.0Default 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
主机之间可以通信,由于关闭了自动汇总,路由表中出现了所有相关子网,而不是只有主类网络,因此减少了网络的额外开销。
自动汇总:自动汇总的目的是为了优化大量网段在路由通告中给路由带来的负担,以及由于庞大的路由表导致了路由器在进行路由转发过程中转发速度减慢。自动汇总会对相同主类网段中的多个子网进行汇总,其目的在于解决上述问题。在网络设计实施过程中切忌不能随意应用路由汇总,路由汇总只有在有合理设计及规划的基础上进行应用。
禽兽尚且有半点怜悯之心,而我一点也没有,所以我不是禽兽。 男人与女人,终究也只是欲望的动物吧!真的可以因为爱而结合吗?对不起,我也不知道。。 走,MM,咱们化蝶去…… 这是什么东东啊 我是个凑数的。。。 爱护环境,人人有病。
页:
[1]