当前位置:文档之家› RIP协议基本配置

RIP协议基本配置

1>RIP动态路由协议的基本配置:
a,连接网络拓扑图:3台Router,2台PC。Router两两相连,PC放在Router的两侧。
b,为网络的各个组件配IP:RouterA 12.0.0.1/8、f0/0 192.168.0.1/24 RouterB s0/0 12.0.0.2/8、s0/1 23.0.0.1/8、RouterC s0/0 23.0.0.2/8、f0/0 3.3.3.1/24
c,配置RIP协议,使网络能够正常连通。配置命令如下:
以在RouterA上面配置RIP协议为例:
Router(config)#hostname RouterA
RouterA(config)#router rip
RouterA(config-router)#network 192.168.0.0
RouterA(config-router)#network 12.0.0.0
d,在RouterA上面设置被动接口,使得该接口停止向192.168.0.0/24网段广播路由更新信息,但是允许在该接口继续接受路由更新广播信:
RouterA(config)#router rip
RouterA(config-router)#passive-interface f0/0
e,通过show ip protocols命令查看配置效果
RouterA#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 13 seconds
……
f,利用debug命令,对rip运行过程中的事件进行跟踪显示输出:
RouterC#debug ip rip
RIP protocol debugging is on
RouterC#RIP: received v1 update from 23.0.0.1 on Serial0/0
12.0.0.0 in 1 hops
192.168.0.0 in 2 hops
RIP: sending v1 update to 255.255.255.255 via FastEthernet0/0 (3.3.3.1)
RIP: build update entries
network 12.0.0.0 metric 2
network 23.0.0.0 metric 1
network 192.168.0.0 metric 3
RIP: sending v1 update to 255.255.255.255 via Serial0/0 (23.0.0.2)
g,RIP缺省路由的配置:
连接简单的网络拓扑图,只需要两个路由器用串行线相连,配置缺省路由,使得链路能够正常通信。再用show ip route rip命令查看一 下该网络的RIP路由信息即可:
在RouterA上面配置缺省路由:
RouterA(config)#router rip
RouterA(config-router)#network 12.0.0.0
RouterA(config-router)#end

RouterA#show ip route rip
R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:14, Serial0/0
2>RIPv2动态路由协议的配置:
a,在1>中的第一个拓扑图上用no router rip 命令删除原有的RIP协议配置,配置RIPv2版本的ip路由协议:
配置命令如下:(以RouterC为例)
*** RouterC的RIPv2配置过程:
RouterC(config)#router rip
RouterC(config-router)#version 2
RouterC(config-router)#network 3.0.0.0
RouterC(config-router)#network 23.0.0.0
RouterA和RouterB执行相似的命令即可配置成功。
b,查看各项参数:
** RouterC#show ip route
…………
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, FastEthernet0/0
R 12.0.0.0/8 [120/1] via 23.0.0.1, 00:00:15, Serial0/0
C 23.0.0.0/8 is directly connected, Serial0/0
R 192.168.0.0/24 [120/2] via 23.0.0.1, 00:00:15, Serial0/0

** RouterC#show ip protocols
…………
Default version control: send version 2, receive 2
Interface Send Recv Triggered RIP Key-

chain
FastEthernet0/0 2 2 *** Cisco路由器上默认的RIP配置特点是只发送version 1的路由更新,
Serial0/0 2 2 *** 可以接收任何版本的更新。
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
3.0.0.0
23.0.0.0
……

** debug ip packet命令:
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (3.3.3.1)
***可以发现:ripv2的路由更新是多播发送的,其目标地址是224.0.0.9***
RIP: build update entries
12.0.0.0/8 via 0.0.0.0, metric 2, tag 0
23.0.0.0/8 via 0.0.0.0, metric 1, tag 0
192.168.0.0/24 via 0.0.0.0, metric 3, tag 0
RIP: sending v2 update to 224.0.0.9 via Serial0/0 (23.0.0.2)
RIP: build update entries
3.0.0.0/8 via 0.0.0.0, metric 1, tag 0

** 在RouterA中输入show running-config命令显示RouterA中的详细RIP协议信息:
RouterA#show running-config
Building configuration...
……
router rip
version 2
network 12.0.0.0
network 192.168.0.0
……
c,RouterC会将其一侧的网络3.3.3.0/24自动汇总成3.0.0.0/8,因此在RouterB的路由表中只会看到自动汇总好的网络3.0.0.0/8.
如果希望在RouterA上看到精确的,而不是自动汇总后的网络,需要在网络边界路由器C、B上禁用RIP的自动汇总特性。这需要命令: no auto-summary来解决。
使用no auto-summary命令前,在RouterB执行show ip protocols:
RouterB#show ip protocols
……
Automatic network summarization is in effect
……
使用no auto-summary命令(在路由配置模式下使用此命令):
RouterB(config)#router rip
RouterB(config-router)#no auto
RouterB(config-router)#no auto-summary
RouterB(config-router)#end
使用no auto-summary命令前,在RouterB执行show ip protocols:
RouterB#show ip protocols
Routing Protocol is "rip"
……
Automatic network summarization is not in effect *** 由此句验证是否关闭了RIP的自动汇总功能
……
Distance: (default is 120)

此时,可以在RouterA和RouterB的路由表中看到网络3.3.3.0/24的精确路由。
RouterB#show ip route rip
……
R 3.3.3.0/24 [120/1] via 23.0.0.2, 00:00:07, Serial0/1
R 192.168.0.0/24 [120/1] via 12.0.0.1, 00:00:15, Serial0/0

























































相关主题