实验目的: 掌握 RIP 协议的配置方法; 掌握查看通过动态路由协议 RIP 学习产生的路由; 熟悉广域网线缆的链接方式;

实验背景 假设校园网通过一台三层交换机连到校园网出口路由器上,路由器再和校园外的另一台路由器连接。现要做适当配置,实现校园网内部主机与校园网外部主机之间的相互通信。为了简化网管的管理维护工作,学校决定采用 RIPV2 协议实现互通。

技术原理 RIP(Routing Information Protocols,路由信息协议)是应用较早、使用较普遍的 IGP内部网管协议,使用于小型同类网络,是距离矢量协议; RIP 协议跳数作为衡量路径开销的, RIP 协议里规定最大跳数为 15; RIP 协议有两个版本: RIPv1 和 RIPv2, RIPv1 属于有类路由协议,不支持 VLSM, 以广播形式进行路由信息的更新,更新周期为 30 秒; RIPv2 属于无类路由协议, 支持 VLSM,以组播形式进行路由更细。

实验步骤 建立建立 packet tracer 拓扑图  (1)在本实验中的三层交换机上划分 VLAN10 和 VLAN20,其中 VLAN10 用于 连接校园网主机, VLAN20 用于连接 R1。  (2)路由器之间通过 V.35 电缆通过串口连接, DCE 端连接在 R1 上, 配置其时钟频率 64000。  (3)主机和交换机通过直连线,主机与路由器通过交叉线连接。  (4)在 S3560 上配置 RIPV2 路由协议。  (5)在路由器 R1、 R2 上配置 RIPV2 路由协议。  (6)将 PC1、 PC2 主机默认网关设置为与直连网路设备接口 IP 地址。  (7)验证 PC1、 PC2 主机之间可以互相同信;

实验设备 PC 2 台; Switch_3560 1 台; Router-PT 2 台;直连线;交叉线; DCE 串口线

配置如下: PC机配置: PC0 IP: 192.168.1.2 Submask: 255.255.255.0 Gateway: 192.168.1.1 PC1 IP: 192.168.2.2 Submask: 255.255.255.0 Gateway: 192.168.2.1

交换机配置: Switch>EN Switch#CONF T Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S3560 S3560(config)#vlan 10 S3560(config-vlan)#exit S3560(config)#vlan 20 S3560(config-vlan)#exit S3560(config)#int f0/10 S3560(config-if)#switchport access vlan 10 S3560(config-if)#int f0/20 S3560(config-if)#switchport access vlan 20 S3560(config-if)#exit S3560(config)#end S3560# %SYS-5-CONFIG_I: Configured from console by console

S3560#show vlan

S3560#conf t Enter configuration commands, one per line. End with CNTL/Z. S3560(config)#int vlan 10 S3560(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up S3560(config-if)#ip address 192.168.1.1 255.255.255.0 S3560(config-if)#no shutdown S3560(config-if)#exit S3560(config)#int vlan 20 S3560(config-if)# %LINK-5-CHANGED: Interface Vlan20, changed state to up S3560(config-if)#ip address 192.168.3.1 255.255.255.0 S3560(config-if)#no shutdown S3560(config-if)#end S3560# S3560#show ip route S3560#show run S3560#conf t S3560(config)#router rip S3560(config-router)#network 192.168.1.0 S3560(config-router)#network 192.168.3.0 S3560(config-router)#version 2 S3560(config-router)#end S3560# %SYS-5-CONFIG_I: Configured from console by console S3560#show ip route

路由器配置: Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#int f0/0 R1(config-if)#no shutdown R1(config-if)#ip address 192.168.3.2 255.255.255.0 R1(config-if)#int s2/0 R1(config-if)#no shutdown R1(config-if)#ip address 192.168.4.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#end R1# %SYS-5-CONFIG_I: Configured from console by console

R1#show ip route R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router rip R1(config-router)#network 192.168.3.0 R1(config-router)#network 192.168.4.0 R1(config-router)#version 2 R1(config-router)#exit R1(config)#

Router(config)#hostname R2 R2(config)# R2(config)#int f0/0 R2(config-if)#no shutdown R2(config-if)#ip address 192.168.2.1 255.255.255.0 R2(config-if)#int s2/0 R2(config-if)#no shutdown R2(config-if)#ip address 192.168.4.2 255.255.255.0 R2(config-if)#end R2# R2#show ip route R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router rip R2(config-router)#network 192.168.2.0 R2(config-router)#network 192.168.4.0 R2(config-router)#version 2 R2(config-router)#end R2# %SYS-5-CONFIG_I: Configured from console by console

实验验证:

实验完成!