RIP (Routing Information Protocol)——路由信息协议
RIP 分两个版本(RIPv1和RIPv2)
CCNA知识——动态路由RIP的概述
Hop(跳数) 计算(***15跳)
路由器每隔30秒更新
最多支持相同hop数的6条路径
RIP是以跳数为度量值的距离矢量路由协议:
30秒更新一次(更新计时器)
180秒失效(失效计时器)
240秒路由从路由表中删除 (刷新计时器)
CCNA知识——动态路由RIP的缺陷
以跳数为依据过于简单,经常获得非***路径
度量值以15为限,不能适合大的网络
安全性差,接收来自任何路由设备的路由更新
收敛缓慢。经常大于5分钟
RIPv1利用广播更新路由信息,消耗带宽大
RIPv1和RIPv2的区别:
RIPv1 RIPv2
有类路由协议 无类路由协议
不支持VLSM(可变长子网掩码) 支持VLSM
不支持不连续网络 支持不连续网络
以广播方式通告信息 以组播方式通告信息
CCNA知识——动态路由RIP的配置
启用RIP
Router(config)#router rip
Router (config-router)#network 本地网段
启用RIPv2
Router (config-router)#version 2
为抑制RIP传播
Router (config-router)#passive-interface fa0/0
试验环境:
R1的ip地址是172.16.1.1/24(S0/0)
R2的ip地址是172.16.1.2/24 (S0/0) 172.32.1.1/24(S0/1)
R3的ip地址是172.32.1.2/24(S0/0)
先用RIPv1来做配置
R1的基本配置:
Router> en
Router# conf t
Router(config)# host R1
r1 (config)#int s0/0
r1(config-if)#ip address 172.16.1.1 255.255.255.0
r1(config-if)#no shut
r1 (config)#router rip
r1(config-router)# network 172.16.1.0
R2的基本配置:
Router> en
Router#conf t
Router(config)#host r2
r2(config)#int s0/0
r2 (config-if)#ip address 172.16.1.1 255.255.255.0
r2 (config-if)#no shut
r2(config)#int s0/1
r2(config-if)#ip add 172.32.1.1 255.255.255.0
r2(config-if)#no shut
r2(config)#router rip
r2(config-router)# network 172.16.1.0
r2(config-router)# network 172.32.1.0
R3的基本配置:
Router>en
Router#conf t
Router(config)#host r3
r3(config)#int s0/0
r3(config-if)#ip add 172.32.1.2 255.255.255.0
r3(config-if)#no shut
r3(config)#router rip
r3(config-router)# network 172.32.1.0
查看:
R1
r1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0/0
R 172.32.0.0/16 [120/1] via 172.16.1.2, 00:00:16,Serial0/0
R2
r2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0/0
172.32.0.0/24 is subnetted, 1 subnets
C 172.32.1.0 is directly connected, Serial0/1
R3
r1# sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
R 172.16.0.0/16 [120/1] via 172.32.1.1, 00:00:15, Serial0/0
172.32.0.0/24 is subnetted, 1 subnets
C 172.32.1.0 is directly connected, Serial0/0
测试:
r1#ping 172.16.1.2
r1#ping 172.32.1.1
r1#ping 172.32.1.2
再用RIPv2来做配置
R1的基本配置:
Router> en
Router# conf t
Router(config)# host R1
r1 (config)#int s0/0
r1(config-if)#ip address 172.16.1.1 255.255.255.0
r1(config-if)#no shut
r1 (config)#router rip
r1(config-router)#version 2
r1(config-router)# network 172.16.1.0
R2的基本配置:
Router> en
Router#conf t
Router(config)#host r2
r2(config)#int s0/0
r2 (config-if)#ip address 172.16.1.1 255.255.255.0
r2 (config-if)#no shut
r2(config)#int s0/1
r2(config-if)#ip add 172.32.1.1 255.255.255.0
r2(config-if)#no shut
r2(config)#router rip
r2(config-router)#version 2
r2(config-router)# network 172.16.1.0
r2(config-router)# network 172.32.1.0
R3的基本配置:
Router>en
Router#conf t
Router(config)#host r3
r3(config)#int s0/0
r3(config-if)#ip add 172.32.1.2 255.255.255.0
r3(config-if)#no shut
r3(config)#router rip
r3(config-router)#version 2
r3(config-router)# network 172.32.1.0
查看
r1#sh run
r1#sh ip protocols
r2#sh run
r2#sh ip protocols
r3#sh run
r3#sh ip protocols
r1#ping 172.32.1.2
这样,动态路由RIP的配置就完成了。
【编辑推荐】