一、实验内容
1.模拟RIP,测试实验主机连通性。
2.通过实验观察RIP V1 和 V2的区别(重点在VLSM上)给出分析过程与结果(实验IP采用10.10.x.0网段)
二、实验目的
深刻理解RIP工作原理
三、实验拓扑图
四、实验配置
1、两台pc的ip、子网掩码、默认网关配置如下:
2、三层交换机的配置如下:
s3550>en #进入特权模式
s3550#conf t #进入配置模式
Enter configuration commands, one per line. End with CNTL/Z.
s3550(config)#hostname S3550 #改名
S3550(config)#vlan 10 #设置vlan 10
S3550(config-vlan)#exit
S3550(config)#vlan 50
S3550(config-vlan)#exit
S3550(config)#int f0/1
S3550(config-if)#switchport access vlan 10 #将f0/1加入vlan 10
S3550(config-if)#exit
S3550(config)#int f0/5
S3550(config-if)#switchport access vlan 50
S3550(config-if)#exit
S3550(config)#int vlan 10
S3550(config-if)#ip address 10.10.1.2 255.255.255.0 #配置vlan 10 ip 子网掩码
S3550(config-if)#no shutdown #启用端口
S3550(config-if)#exit
S3550(config)#int vlan 50
S3550(config-if)#ip address 10.10.5.1 255.255.255.0
S3550(config-if)#no shutdown
S3550(config-if)#exit
3、router1的配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#ip address 10.10.1.1 255.255.255.0 #配置端口ip、子网掩码
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int se0/1/0
Router(config-if)#ip address 10.10.2.1 255.255.255.0 #配置串口ip 、子网掩码
Router(config-if)#no shutdown
4、router2的配置
和1的基本相同,f0/1 的ip设置为10.10.3.1 子网掩码设置为255.255.255.0 串口ip为10.10.2.2 子网掩码为255.255.255.0
5、配置三层交换机RIP2协议
S3550>EN
S3550#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S3550(config)#router rip #开启RIP协议进程
S3550(config-router)#version 2 #选择RIP2协议
S3550(config-router)#network 10.10.1.0 #申明本网络的直连网段
S3550(config-router)#network 10.10.5.0
注意,如果直接输入router rip 显示IP routing not enabled ,需要输入 ip routing开启routing功能
6、配置router1RIP协议
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#no auto-summary #关闭路由信息的自动汇总功能
Router(config-router)#network 10.10.1.0
Router(config-router)#network 10.10.2.0
Router(config-router)#
7、配置router2RIP协议
和router1一样,直连网断设置如下:network 10.10.2.0
network 10.10.3.0
8、在三层交换机特权模式下输入show ip route查看路由表
C条目显示的是直连网段,R条目显示的是通过RIP协议学习的路由信息
五、测试两台pc机的连通性
六、使用debug命令并分析
在三层交换机的全局模式下输入debug ip rip,结果如图:
其中S3550#RIP: received v2 update from 10.10.1.1 on Vlan10
10.10.2.0/24 via 0.0.0.0 in 1 hops
表示S3550接受到从vlan10的10.10.2.0/24到10.10.1.1的v2更新
RIP: sending v2 update to 224.0.0.9 via Vlan10 (10.10.1.2)
表示通过vlan10将v2发送到224.0.0.9(10.10.1.2),224.0.0.9是RIP 的组播地址
RIP: build update entries
表示构建新条目
七、注意事项
1、配置VLAN、pc、串口的ip时要注意他们之间的关系
2、路由器与pc机之间连接使用交叉线,不能使用直通线(pc机可以看成是路由器,所以用交叉线)
3、第一次使用命令router rip可能会由于routing功能未开启 显示IP routing not enabled,使用ip routing解决