實驗目的:
掌握 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
實驗驗證:
實驗完成!