《2022年2022年交换机路由器实验教程 .pdf》由会员分享,可在线阅读,更多相关《2022年2022年交换机路由器实验教程 .pdf(17页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、VLAN ,TRUNK ,VTP 和 VLAN 间路由的使用和配置实验目的: 熟练掌握 VLAN ,TRUNK ,VTP 和 VLAN 间路由的使用和配置实验内容: 在 1900系列和 2900 系列交换机上 VLAN 的配置在 1900 系列和 2900 系列交换机上 TRUNK 的配置在 1900系列和 2900系列交换机上 VTP 的配置在 1900系列和 2900系列交换机以及 2600系列路由器上 VLAN 间路由的配置实验条件:2900 系列交换机两台, 1900 系列交换一台和 2600 系列路由器各一台一VLAN 的配置本实验需要 2900 交换机一台, PC机两台, cons
2、ole线一条Step 1 配置交换机Switch Switch enable Switch# configure terminal 或config t Switch(config)#hostname Switch_A Switch_A(config)#enable secret class/(enable cecret password) Switch_A(config)#enable password cisco) Switch_A(config)#line con 0 Switch_A(config-line)#password cisco/(enable console password
3、 Switch_A(config-line)#login Switch_A(config-line)#line vty 0 15 Switch_A(config-line)#password cisco Switch_A(config-line)#login Switch_A(config-line)#exit Switch_A(config)#interface Vlan1 Switch_A(config-if)#ip address 192.168.1.2 255.255.255.0 Switch_A(config-if)#no shutdown Switch_A(config-if)#e
4、xit Switch_A(config)#ip default-gateway 192.168.1.1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 17 页 - - - - - - - - - Switch_A(config)#end Step 2 为PC 配置正确的 IP地址,子网掩码和缺省网关Step 3 检测连通性由switch ping两台PC 机,检测连通性Step 4 显示VLAN 的接口信息2900:Switch_A#show vlan 1900: Sw
5、itch_A#show vlan-membership Step 5 创建,命名 VLAN 2900:Switch_A#vlan database Switch_A(vlan)#vlan 2 name VLAN2 Switch_A(vlan)#vlan 3 name VLAN3 Switch_A(vlan)#exit 1900: Switch_A#configure terminal Switch_A(config)#vlan 2 name VLAN2 Switch_A(config)#vlan 3 name VLAN3 Step 6 安排4,5,6端口到 VLAN 2 2900:Switch
6、_A#configure terminal Switch_A(config)#interface fastethernet 0/4 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 2 Switch_A(config-if)#interface fastethernet 0/5 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 2 Switch_A(co
7、nfig-if)#interface fastethernet 0/6 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 2 Switch_A(config-if)#end 1900: Switch_A#configure terminal Switch_A(config)#interface Ethernet 0/4 Switch_A(config-if)#vlan static 2 Switch_A(config-if)#interface Ethernet 0/5 S
8、witch_A(config-if)#vlan static 2 Switch_A(config-if)#interface Ethernet 0/6 Switch_A(config-if)#vlan static 2 Switch_A(config)#end Step 7 显示VLAN 的接口信息2900:名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 17 页 - - - - - - - - - Switch_A#show vlan 1900: Switch_A#sh
9、ow vlan-membership Step 8 安排7,8,9端口到 VLAN 3 Switch_A#configure terminal Switch_A(config-if)#interface fastethernet 0/7 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 3 Switch_A(config-if)#interface fastethernet 0/8 Switch_A(config-if)#switchport mode access Swi
10、tch_A(config-if)#switchport access vlan 3 Switch_A(config-if)#interface fastethernet 0/9 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 3 Switch_A(config-if)#end Step 9 显示VLAN 的接口信息2900:Switch_A#show vlan 1900: Switch_A#show vlan-membership Step 10 测试VLANs Step
11、 11 解除VLAN 与端口的绑定2900:Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/4 Switch_A(config-if)#no switchport access vlan 2 1900: Switch_A#configure terminal Switch_A(config)#interface Ethernet 0/4 Switch_A(config-if)#no vlan-membership 2 Switch_A(config-if)#end Step 12 显示VLAN 的接口信
12、息2900:Switch_A#show vlan 1900: Switch_A#show vlan-membership Step 13 删除VLAN 2900:Switch_A#vlan database Switch_A(vlan)#no vlan 3 Deleting VLAN 3 Switch_A(vlan)#exit 1900: Switch_A#configure terminal 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 17 页 - - - - -
13、- - - - Switch_A(config)#interface ethernet 0/7 Switch_A(config-if)#no vlan 3 Switch_A(config-if)#exit Step 14 显示VLAN 的接口信息2900:Switch_A#show vlan 1900: Switch_A#show vlan-membership 二VLAN 的 TRUNK 配置本实验需要 2900 交换机两台, PC机两台, console线一条(一) ISL Step 1 配置交换机的基本参数参考上面的实验Step 2 为PC 配置正确的 IP地址,子网掩码和缺省网关Ste
14、p 3 检测连通性由switch ping两台PC 机,检测连通性Step 4 显示VLAN 的接口信息Switch_A#show vlan Step 5 在Switch_A 上创建,命名 VLAN Switch_A#vlan database Switch_A(vlan)#vlan 10 name Accounting Switch_A(vlan)#vlan 20 name Marketing Switch_A(vlan)#vlan 30 name Engineering Switch_A(vlan)#exit 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - -
15、 - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 17 页 - - - - - - - - - Step 6 安排4,5,6端口到 VLAN 10 Switch_A(config)#interface fastethernet 0/4 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/5 Switch_A(config-if)#switc
16、hport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/6 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#end Step 7 安排端口 7,8,9到VLAN 20 Switch_A#configure terminal Switch_A(config)#inter
17、face fastethernet 0/7 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#interface fastethernet 0/8 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#interface fastethernet 0/9 Switch
18、_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#end Step 8 安排端口 10,11,12到VLAN 30 Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/10 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Sw
19、itch_A(config-if)#interface fastethernet 0/11 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#interface fastethernet 0/12 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#end Step
20、 9 在Switch_B 上创建,命名 VLAN 重复5-8步,在 Switch_B创建,命名 VLAN Step 10 显示VLAN 的接口信息Switch_A#show vlan Step 11 测试VLANs Step 12 创建ISL trunk Switch_A(config)#interface fastethernet 0/1 Switch_A(config-if)#switchport mode trunk Switch_A(config-if)#switchport trunk encapsulation isl 名师资料总结 - - -精品资料欢迎下载 - - - - -
21、- - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 17 页 - - - - - - - - - Switch_A(config-if)#end Switch_B(config)#interface fastethernet 0/1 Switch_B(config-if)#switchport mode trunk Switch_B(config-if)#switchport trunk encapsulation isl Switch_B(config-if)#end Step 13 测试ISL trunk (二) dot1q Ste
22、p 1 配置交换机的基本参数参考上面的实验Step 2 为PC 配置正确的 IP地址,子网掩码和缺省网关Step 3 检测连通性由switch ping两台PC 机,检测连通性Step 4 显示VLAN 的接口信息Switch_A#show vlan Step 5 在Switch_A 上创建,命名 VLAN Switch_A#vlan database Switch_A(vlan)#vlan 10 name Accounting Switch_A(vlan)#vlan 20 name Marketing Switch_A(vlan)#vlan 30 name Engineering Switc
23、h_A(vlan)#exit Step 6 安排4,5,6端口到 VLAN 10 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 17 页 - - - - - - - - - Switch_A(config)#interface fastethernet 0/4 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-i
24、f)#interface fastethernet 0/5 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/6 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#end Step 7 安排端口 7,8,9到VLA
25、N 20 Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/7 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#interface fastethernet 0/8 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 2
26、0 Switch_A(config-if)#interface fastethernet 0/9 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#end Step 8 安排端口 10,11,12到VLAN 30 Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/10 Switch_A(config-if)#switchport mode
27、access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#interface fastethernet 0/11 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#interface fastethernet 0/12 Switch_A(config-if)#switchport mode access Switch_A(config-if)
28、#switchport access vlan 30 Switch_A(config-if)#end Step 9 在Switch_B 上创建,命名 VLAN 重复5-8步,在 Switch_B创建,命名 VLAN Step 10 显示VLAN 的接口信息Switch_A#show vlan Step 11 测试VLANs Step 12 创建dot1q trunk Switch_A(config)#interface fastethernet 0/1 Switch_A(config-if)#switchport mode trunk Switch_A(config-if)#switchpor
29、t trunk encapsulation dot1q Switch_A(config-if)#end 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 17 页 - - - - - - - - - Switch_B(config)#interface fastethernet 0/1 Switch_B(config-if)#switchport mode trunk Switch_B(config-if)#switchport trunk encapsulation do
30、t1q Switch_B(config-if)#end Step 13 测试dot1q trunk 三VLAN 的 VTP 配置本实验需要 2900 交换机两台, PC机两台, console线一条Step 1 配置交换机参考上面的实验Step 2 为PC 配置正确的 IP地址,子网掩码和缺省网关Step 3 测试连接性由switch ping两台PC 机,检测连通性Step 4 显示VLAN 接口信息Switch_A#show vlan Step 5 配置VTP 服务器端Switch_A#vlan database Switch_A(vlan)#vtp server Switch_A(vla
31、n)#vtp domain group1 Switch_A(vlan)#exit Step 6 创建,命名 VLANs Switch_A#vlan database Switch_A(vlan)#vlan 10 name Accounting 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 17 页 - - - - - - - - - Switch_A(vlan)#vlan 20 name Marketing Switch_A(vlan)#vlan 30 name Eng
32、ineering Switch_A(vlan)#exit Step 7 安排端口 4,5,6到VLAN 10 Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/4 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/5 Switch_A(config-if)#switchport mode a
33、ccess Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/6 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#end Step 8 安排端口 7,8,9到VLAN 20 Switch_A#configure terminal Switch_A(config)#interface fasteth
34、ernet 0/7 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#interface fastethernet 0/8 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#interface fastethernet 0/9 Switch_A(config-if
35、)#switchport mode access Switch_A(config-if)#switchport access vlan 20 Switch_A(config-if)#end Step 9 安排端口 10,11,12到VLAN 30 Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/10 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(confi
36、g-if)#interface fastethernet 0/11 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#interface fastethernet 0/12 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 30 Switch_A(config-if)#end Step 10 显示VLAN 接
37、口信息Switch_A#show vlan Step 11 配置VTP 客户端Enter the following commands to configure Switch_B to be a VTP client: Switch_B#vlan database 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 17 页 - - - - - - - - - Switch_B(vlan)#vtp client Switch_B(vlan)#vtp domain group1
38、 Switch_B(vlan)#exit Step 12 创建trunk Switch_A(config)#interface fastethernet 0/1 Switch_A(config-if)#switchport mode trunk Switch_A(config-if)#end Switch_B(config)#interface fastethernet 0/1 Switch_B(config-if)#switchport mode trunk Switch_B(config-if)#end 2900: Note that it is necessary to specify
39、the encapsulation on a 2924XL, since it supports 802.1Qand ISL. Switch_A(config)#interface fastethernet0/1 Switch_A(config-if)#switchport mode trunk Switch_A(config-if)#switchport trunk encapsulation dot1q Switch_A(config-if)#end Switch_B(config)#interface fastethernet0/1 Switch_B(config-if)#switchp
40、ort mode trunk Switch_B(config-if)#switchport trunk encapsulation dot1q Switch_B(config-if)#end Step 13 测试trunk show interface fastethernet 0/1 switchport Step 14 显示VLAN 接口信息Switch_B#show vlan Step 15 安排端口 4,5,6到VLAN 10 Switch_B#configure terminal Switch_B(config)#interface fastethernet 0/4 Switch_B
41、(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 10 Switch_B(config-if)#interface fastethernet 0/5 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 10 Switch_B(config-if)#interface fastethernet 0/6 Switch_B(config-if)#switchport mode
42、access Switch_B(config-if)#switchport access vlan 10 Switch_B(config-if)#end Step 16 Assign ports to VLAN 20 Switch_B#configure terminal Switch_B(config)#interface fastethernet 0/7 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 20 Switch_B(config-if)#interface
43、fastethernet 0/8 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 20 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 17 页 - - - - - - - - - Switch_B(config-if)#interface fastethernet 0/9 Switch_B(config-if)#switchport mode a
44、ccess Switch_B(config-if)#switchport access vlan 20 Switch_B(config-if)#end Step 17 Assign ports to VLAN 30 Switch_B#configure terminal Switch_B(config)#interface fastethernet 0/10 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 30 Switch_B(config-if)#interface
45、fastethernet 0/11 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 30 Switch_B(config-if)#interface fastethernet 0/12 Switch_B(config-if)#switchport mode access Switch_B(config-if)#switchport access vlan 30 Switch_B(config-if)#end Step 18 显示VLAN 接口信息Switch_A#show
46、 vlan 四VLAN 间路由的配置本实验需要 2621 路由器一台, 2900 交换机一台, PC 机两台, console线一条Step 1 配置交换机参考上面的实验Step 2 配置连接到交换机上的主机a. 连接到 port 0/5上的PC: 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 17 页 - - - - - - - - - IP address 192.168.5.2 Subnet mask 255.255.255.0 Default gateway
47、192.168.5.1 b. 连接到 port 0/9上的PC: IP address 192.168.7.2 Subnet mask 255.255.255.0 Default gateway 192.168.7.1 Step 3 测试连通性Step 4 创建,命名两个 VLANs 2900:Switch_A#vlan database Switch_A(vlan)#vlan 10 name Sales Switch_A(vlan)#vlan 20 name Support Switch_A(vlan)#exit 1900: Switch_A#config terminal Switch_A
48、(config)#vlan 10 name Sales Switch_A(config)#vlan 20 name Support Switch_A(config)#exit Step 5 安排端口 5,6,7,8到VLAN 10 2900:Switch_A#configure terminal Switch_A(config)#interface fastethernet 0/5 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if
49、)#interface fastethernet 0/6 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/7 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#interface fastethernet 0/8
50、 Switch_A(config-if)#switchport mode access Switch_A(config-if)#switchport access vlan 10 Switch_A(config-if)#end 1900: Switch_A#configure terminal Switch_A(config)#interface ethernet 0/5 Switch_A(config-if)vlan static 10 Switch_A(config-if)#interface ethernet 0/6 Switch_A(config-if)vlan static 10 S