RIP路由协议(Router Information Protocol)包含两个版本,RIPv1和RIPv2。RIP协议是出现的最早的距离矢量型IP路由选择协议,使用跳数作为唯一的度量值。虽然没有后来的一些路由协议功能强大,但它简单易用,至今仍有广泛的应用,多用于小型网络数据互联的设计中。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
RIPv1发送路由更新,不携带子网掩码;而RIPv2携带每个路由条目的子网掩码。
RIPv1广播发送路由更新,广播地址为255.255.255.255;RIPv2组播发送路由更新,组播地址为224.0.0.9。
RIPv2路由选择更新具有认证功能。
RIPv2每个路由更新条目都携带下一跳地址。
RIPv2的更新包中包含外部路有标记。
他们最主要的区别:RIPv1是有类路由协议,而RIPv2是无类路由协议。RIPv1 不支持不连续的子网,而RIPv2支持。
复习一下RIPv1的配置:
首先要在路由器上启动RIP进程,然后要将路由器上所有启动RIP的接口的主网络号宣告出去,具体配置命令----
Router(config)#router rip
Router(config-router)#network network-number
RIPv2在发送路由更新的时候携带子网掩码,支持不连续子网,但是RIPv2默认情况下在主网络边界上进行路由汇总,因此要关闭路由汇总功能,允许子网通告通过主网络的边界。具体配置:
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#no auto-summary
实验环境
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
把3个路由器分别改名为A、B、C
A(config)#int f0/0
A(config-if)#ip address 10.1.1.1 255.255.255.255.0
A(config-if)#no shutdown
A(config)#int f0/1
A(config-if)#ip address 192.168.1.1 255.255.255.0
A(config-if)#no shutdown
B(config)#int f0/0
B(config-if)#ip address 10.1.2.1 255.255.255.0
B(config-if)#no shutdown
B(config)#int f0/1
B(config-if)#ip address 192.168.1.2 255.255.255.0
B(config-if)#no shutdown
C(config)#int f0/0
C(config-if)#ip address 192.168.2.1 255.255.255.0
C(config-if)#no shutdown
C(config)#int f0/1
C(config-if)#ip address 192.168.1.3 255.255.255.0
C(config-if)#no shutdown
路由器接口IP地址配置完毕,然后在路由器上启动RIPv2,并宣告主网络号:
A(config)#router rip
A(config-router)#version 2
A(config-router)#no auto-summary
A(config-router)#network 10.1.1.0
A(config-router)#network 192.168.1.0
B(config)#router rip
B(config-router)#version 2
B(config-router)#no auto-summary
B(config-router)#network 10.1.2.0
B(config-router)#network 192.168.1.0
C(config)#router rip
C(config-router)#version 2
C(config-router)#no auto-summary
C(config-router)#network 192.168.2.0
C(config-router)#network 192.168.1.0
在路由器上配置使用RIPv2后,查看路由协议的配置,可以看到接收和发送路由更新都是使用版本2。相关查看命令:
A#show ip protocol
A#debug ip rip
A#show ip route
最后在PC上设置合适的IP地址和网关,用ping命令来检测连通情况。
转载于:https://blog.51cto.com/cnxfei/32019