路由交换机路由协议实验
实验十、三层交换机RIP动态路由
(1)实验目的:1、掌握三层交换机之间通过RIP协议实现网段互通的配置方法。
2、理解动态实现方式与静态方式的不同。
(2)实验设备:DCRS-6804S路由交换机2台; PC机2-4台;Console线1-2根;直通网线2-4根。 (3)实验拓扑:
图10-1 网络连接示意图
(4)实验要求:
1、在交换机A和交换机B上分别划分基于端口的VLAN:
表10-1基于端口的vlan分配表
交换机 交换机A 交换机B
VLAN 10 20 100 30 40 101 端口成员 1~8 9~16 24 1~8 9~16 24 2、交换机A和B通过的24口级联。
3、配置交换机A和B各VLAN虚拟接口的IP地址分别如下表所示:
表10-2 vlan虚拟接口IP地址分配表 VLAN10 VLAN20 VLAN30 192.168.10.1 192.168.20.1 192.168.30.1 VLAN40 VLAN100 VLAN101 192.168.40.1 192.168.100.1 192.168.100.2
4、PC1-PC4的网络设置为:
表10-3 各PC机网络设置表
设备 PC1 PC2 PC3 PC4 5、验证:
IP地址 192.168.10.101 192.168.20.101 192.168.30.101 192.168.40.101 gateway 192.168.10.1 192.168.20.1 192.168.30.1 192.168.40.1 Mask 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 没有RIP路由协议之前:
PC1与PC2,PC3与PC4可以互通。 PC1,PC2与PC3,PC4不通。 配置RIP路由协议之后: 四台PC之间都可以互通。
若实验结果和理论相符,则本实验完成。
(5)实验步骤:
第一步:交换机全部恢复出厂设置,配置交换机的VLAN信息 交换机A:
DCRS-6804S# config DCRS-6804S(Config)#vlan 10
DCRS-6804S(Config-Vlan10)#switchport interface ethernet 1/1-8 Set the port Ethernet1/1 access vlan 10 successfully Set the port Ethernet1/2 access vlan 10 successfully Set the port Ethernet1/3 access vlan 10 successfully Set the port Ethernet1/4 access vlan 10 successfully Set the port Ethernet1/5 access vlan 10 successfully
Set the port Ethernet1/6 access vlan 10 successfully Set the port Ethernet1/7 access vlan 10 successfully Set the port Ethernet1/8 access vlan 10 successfully DCRS-6804S(Config-Vlan10)#exit DCRS-6804S(Config)#vlan 20
DCRS-6804S(Config-Vlan20)#switchport interface ethernet 1/9-16 Set the port Ethernet1/9 access vlan 20 successfully Set the port Ethernet1/10 access vlan 20 successfully Set the port Ethernet1/11 access vlan 20 successfully Set the port Ethernet1/12 access vlan 20 successfully Set the port Ethernet1/13 access vlan 20 successfully Set the port Ethernet1/14 access vlan 20 successfully Set the port Ethernet1/15 access vlan 20 successfully Set the port Ethernet1/16 access vlan 20 successfully DCRS-6804S(Config-Vlan20)#exit DCRS-6804S(Config)#vlan 100
DCRS-6804S(Config-Vlan100)#switchport interface ethernet 1/24 Set the port Ethernet1/24access vlan 100 successfully DCRS-6804S(Config-Vlan100)#exit DCRS-6804S(Config)# 验证配置:
DCRS-6804S#show vlan 交换机B:
DCRS-6804S(Config)#vlan 30
DCRS-6804S (Config-Vlan30)# switchport interface ethernet 0/0/1-8 Set the port Ethernet0/0/1 access vlan 30 successfully Set the port Ethernet0/0/2 access vlan 30 successfully Set the port Ethernet0/0/3 access vlan 30 successfully Set the port Ethernet0/0/4 access vlan 30 successfully Set the port Ethernet0/0/5 access vlan 30 successfully Set the port Ethernet0/0/6 access vlan 30 successfully
Set the port Ethernet0/0/7 access vlan 30 successfully Set the port Ethernet0/0/8 access vlan 30 successfully DCRS-6804S(Config-Vlan30)#exit DCRS-6804S(Config)#vlan 40
DCRS-6804S(Config-Vlan40)# switchport interface ethernet 0/0/9-16 Set the port Ethernet0/0/9 access vlan 40 successfully Set the port Ethernet0/0/10 access vlan 40 successfully Set the port Ethernet0/0/11 access vlan 40 successfully Set the port Ethernet0/0/12 access vlan 40 successfully Set the port Ethernet0/0/13 access vlan 40 successfully Set the port Ethernet0/0/14 access vlan 40 successfully Set the port Ethernet0/0/15 access vlan 40 successfully Set the port Ethernet0/0/16 access vlan 40 successfully DCRS-6804S(Config-Vlan40)#exit DCRS-6804S(Config)#vlan 101
DCRS-6804S(Config-Vlan101)#switchport interface ethernet 0/0/24 Set the port Ethernet0/0/24 access vlan 101 successfully DCRS-6804S(Config-Vlan101)#exit DCRS-6804S(Config)# 验证配置:
DCRS-6804S#show vlan
第二步:创建并配置交换机各vlan虚拟接口的IP地址 交换机A
DCRS-6804S(Config)#int vlan 10 DCRS-6804S(Config-If-Vlan10)#ip 255.255.255.0
DCRS-6804S(Config-If-Vlan10)#no shutdown DCRS-6804S(Config-If-Vlan10)#exit DCRS-6804S(Config)#int vlan 20 DCRS-6804S(Config-If-Vlan20)#ip
address
192.168.20.1
address
192.168.10.1
255.255.255.0
DCRS-6804S(Config-If-Vlan20)#no shutdown DCRS-6804S(Config-If-Vlan20)#exit DCRS-6804S(Config)#int vlan 100 DCRS-6804S(Config-If-Vlan100)#ip 255.255.255.0
DCRS-6804S(Config-If-Vlan100)#no shutdown DCRS-6804S(Config-If-Vlan100)#exit DCRS-6804S(Config)#
第三步:配置各PC的IP地址,注意配置网关,按表7-10进行配置。
第四步:验证PC之间是否连通?
表10-4 测试结果表 address 192.168.100.1
PC PC1 PC1 PC1 PC1
端口 A:1/1 A:1/1 A:1/1 A:1/1 PC PC2 Vlan 100 Vlan 101 PC3 端口 A:1/9 A:1/24 B:0/0/24 B:0/0/1 结果 通 通 不通 不通 查看路由表,进一步分析上一步的现象原因。 交换机A:DCRS-6804S#show ip route 交换机B:DCRS-6804S#show ip route
第五步:启动RIP协议,并将对应的直连网段配置到RIP进程中 交换机A:
DCRS-6804S(Config)#router rip
DCRS-6804S(Config-Router-Rip)#version 2 DCRS-6804S(Config)#interface vlan 10 DCRS-6804S(Config-If-Vlan10)#ip rip work DCRS-6804S(Config-If-Vlan10)#exit DCRS-6804S(Config)#interface vlan 20