实验 9 RIP 路由协议配置

一.实验目的:
掌握 RIP 动态路由协议的配置、诊断方法。
二.实验要点:
1.配置 RIP 动态路由协议,使得两台 Cisco2611 路由器模拟远程网络互联。
2.对运行中的 RIP 动态路由协议进行诊断。
三.实验设备:
路由器 Cisco 2621 两台,带有网卡的工作站 PC 两台,控制台电缆一条,交叉双绞线若干。
四、实验环境
实验 9 RIP 路由协议配置_第1张图片
图 9
纠正一下,PC0的网关为192.168.0.1,PC1的网关为192.168.1.1
五. 实验步骤
1.按图 9 连接路由器和各工作站。
2.按图 9 配置路由器和各工作站 IP 地址等参数。
3.配置路由器 RouterA 和 RouterB 上的 RIPv1 协议。(RouterA、RouterB对应实验截图中的Router0、Router1)
路由器 A 的 RIP 协议配置
RouterA(config)#router rip
RouterA(config-router)#net 10.0.0.0
RouterA(config-router)#net 192.168.0.0
路由器 B 的 RIP 协议配置
RouterB(config)#router rip
RouterB(config-router)#net 10.0.0.0
RouterB(config-router)#net 192.168.1.0

4.测试各工作站之间的连通性。
问题:主机 A 是否能 ping 通主机 B 答案:能
5.检查路由器 RouterA 和 RouterB 的路由表。
6.检查路由器 RouterA 和 RouterB 的运行配置文件内容。
7.打开对 RIP 的诊断,使用 shutdown 和 no shutdown 命令关闭、开启串行接口 Serial 0/0、
快速以太网接口 Fastethernet 0/0。观察 RIP 诊断的输出。
RouterA#show ip protocols //显示路由器上配置的动态路由协议信息
RouterA#show ip rip //显示 RIP 当前运行状态及配置信息
RouterA#debug ip rip //可以显示 RIP 的所有活动,显示接收和发送的接口,更新信息的 RIP 版本及每条路由的度量
六. 实验总结
1.路由表的作用
2.从 RIP 的诊断信息中分析 RIP 的特性,如 RIP 的路由更新周期等。

具体操作步骤:

当没有配置RIP时,Router0和Router1无法相互ping通

在Router1中配置:

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface Serial0/0
Router(config-if)#ip address 10.0.0.2 255.0.0.0
Router(config-if)#clock rate 64000
This command applies only to DCE interfaces
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0, changed state to up

Router(config-if)#exit
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

Router(config-if)#exit
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#network 192.168.1.0
Router(config-router)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#ping 10.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms

Router#ping 192.168.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
在Router0中配置:

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface Serial0/0
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
Router(config-if)#
Router(config-if)#exit
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.0.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

Router(config-if)#exit
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#network 192.168.0.0
Router(config-router)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms

Router#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/8/26 ms

//路由表显示
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

C    10.0.0.0/8 is directly connected, Serial0/0
C    192.168.0.0/24 is directly connected, FastEthernet0/0
R    192.168.1.0/24 [120/1] via 10.0.0.2, 00:00:21, Serial0/0

Router#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 9 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
  Interface             Send  Recv  Triggered RIP  Key-chain
  Serial0/0             1     2 1   
  FastEthernet0/0       1     2 1   
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
    10.0.0.0
    192.168.0.0
Passive Interface(s):
Routing Information Sources:
    Gateway         Distance      Last Update
    10.0.0.2             120      00:00:05
Distance: (default is 120)

Router#show ip rip
% Incomplete command.

Router#debug ip rip
RIP protocol debugging is on
Router#RIP: received v1 update from 10.0.0.2 on Serial0/0
      192.168.1.0 in 1 hops
RIP: sending  v1 update to 255.255.255.255 via Serial0/0 (10.0.0.1)
RIP: build update entries
      network 192.168.0.0 metric 1
RIP: sending  v1 update to 255.255.255.255 via FastEthernet0/0 (192.168.0.1)
RIP: build update entries
      network 10.0.0.0 metric 1
      network 192.168.1.0 metric 2
RIP: received v1 update from 10.0.0.2 on Serial0/0
      192.168.1.0 in 1 hops
RIP: sending  v1 update to 255.255.255.255 via Serial0/0 (10.0.0.1)
RIP: build update entries
      network 192.168.0.0 metric 1
RIP: sending  v1 update to 255.255.255.255 via FastEthernet0/0 (192.168.0.1)
RIP: build update entries
      network 10.0.0.0 metric 1
      network 192.168.1.0 metric 2

Ctrl+Z停止

你可能感兴趣的:(计算机网络课程实验)