本次讲解路由器rip协议的配置:
RIP是基于D-V算法的路由协议,使用跳数(Hop Count)来表示度量值(Metric)。跳数是一个数据报到达目标所必须经过的路由器的数目。
RIP认为跳数少的路径为最优路径。路由器收集所有可达目标网络的路径,从中选择去往同一个网络所用跳数最少的路径信息,生成路由表;然后把所能收集到的路由(路径)信息中的跳数加1后生成路由更新通告,发送给相邻路由器:最后依次逐渐扩散到全网。RIP每30s发送一次路由信息更新。
本例配置模型图
命令行:
RA命令配置:
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#router rip //使用rip协议
R1(config-router)#version 2 //使用RIPv2版本
R1(config-router)#network 192.1.1.0 255.255.255.0 //指定与该路由器直接相连的网络
R1(config-router)# network 202.1.1.5 //指定与该路由器直接相连的网络
R1(config-router)#no shutdown
R1(config-router)#exit
R1#show 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
//目前没有配置RB路由器,所以上述没有rip协议的配置生成
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int s1/0
R1(config-if)#ip address 202.1.1.5 255.255.255.252 //将模型图中的IP配置划分到对应端口R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/0, changed state to down
R1(config-if)#exit
R1(config)#int f0/0
R1(config-if)#ip address 192.1.1.1 255.255.255.0 //将模型图中的IP配置划分到对应端口R1(config-if)#clock rate 64000 //配置时钟模式DCE端
R1(config-if)#bandwidth 64
R1(config-if)#no shutdown
R1#wr
Building configuration...
[OK]
RB命令配置:
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip //使用rip协议
Router(config-router)#version 2 //使用rip协议v2版本
Router(config-router)#network 192.168.2.0 //指定与该路由器直接相连的网络
Router(config-router)#network 202.1.1.6 //指定与该路由器直接相连的网络
Router(config-router)#exit
Router(config)#int s1/0
Router(config-if)#ip address 202.1.1.6 255.255.255.252 //将模型图中的IP配置划分到对应端口Router(config-if)#bandwidth 64 //配置时钟模式DTE端
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/0, changed state to up
Router(config-if)#exit
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
Router(config)#int f0/0
Router(config-if)#ip address 192.168.2.1 255.255.255.0 //将模型图中的IP配置划分到对应端口Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#show 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 192.1.1.0/24 [120/1] via 202.1.1.5, 00:00:08, Serial1/0 //已配置的rip协议
C 192.168.2.0/24 is directly connected, FastEthernet0/0