组网工程实验报告0.docx
- 文档编号:13372962
- 上传时间:2023-06-13
- 格式:DOCX
- 页数:12
- 大小:227.15KB
组网工程实验报告0.docx
《组网工程实验报告0.docx》由会员分享,可在线阅读,更多相关《组网工程实验报告0.docx(12页珍藏版)》请在冰点文库上搜索。
组网工程实验报告0
实验二交换机VLAN配置及VLAN间的路由
实验目的
1.熟悉交换机的VLAN配置
2.单个交换机划分VLAN
3.跨交换机划分VLAN
4.VLAN间的通信
实验背景
网络实验室
Pc0,pc1,pc3属于VLAN10;pc2属于VLAN20;pc4,pc5属于VLAN30。
实验设备
5台pc,2台二层交换机,1台三层交换机。
实验拓扑
2.1单个交换机划分VLAN
1、switch0创建VLAN10、VLAN20
Switch>en
Switch#conft
Switch(config)#vlan10
Switch(config-vlan)#exit
Switch(config)#vlan20
Switch(config-vlan)#exit
Switch(config)#intf0/1
Switch(config-if)#switchportaccessvlan10
Switch(config-if)#exit
Switch(config)#intf0/2
Switch(config-if)#switchportaccessvlan10
Switch(config-if)#exit
Switch(config)#intf0/3
Switch(config-if)#switchportaccessvlan20
Switch(config-if)#end
Switch#showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/4,Fa0/5,Fa0/6,Fa0/7
Fa0/8,Fa0/9,Fa0/10,Fa0/11
Fa0/12,Fa0/13,Fa0/14,Fa0/15
Fa0/16,Fa0/17,Fa0/18,Fa0/19
Fa0/20,Fa0/21,Fa0/22,Fa0/23
Fa0/24
10VLAN0010activeFa0/1,Fa0/2
20VLAN0020activeFa0/3
2、测试VLAN10内主机的通信
PC0pingPC1通
3、测试VLAN10、VLAN20间主机的通信
PC0pingPC2不通
PC1pingPC2不通
VLAN10VLAN20之间的主机不能通信
小结
交换机可以划分VLAN,同一VALN中主机间可以ping通,不同VLAN主机间不能ping通。
2.2跨交换机划分VLAN
1、switch1创建VLAN10、VLAN30
Switch>en
Switch#conft
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Switch(config)#vlan10
Switch(config-vlan)#exit
Switch(config)#vlan30
Switch(config-vlan)#exit
Switch(config)#intf0/1
Switch(config-if)#switchportaccessvlan10
Switch(config-if)#exit
Switch(config)#intf0/2
Switch(config-if)#switchportaccessvlan30
Switch(config-if)#exit
Switch(config)#intf0/3
Switch(config-if)#switchportaccessvlan30
Switch(config-if)#end
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Switch#showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/4,Fa0/5,Fa0/6,Fa0/7
Fa0/8,Fa0/9,Fa0/10,Fa0/11
Fa0/12,Fa0/13,Fa0/14,Fa0/15
Fa0/16,Fa0/17,Fa0/18,Fa0/19
Fa0/20,Fa0/21,Fa0/22,Fa0/23
Fa0/24
10VLAN0010activeFa0/1
30VLAN0030activeFa0/2,Fa0/3
2、测试switch0、switch1VLAN10内主机的通信
Pc0,pc1pingpc3不通
3、配置trunk口
Switch0,switch1的配置
1916-2#conft
Enterconfigurationcommands,oneperline.EndwithCTRL/Z.
1916-2(config)#intf0/16
0d:
0h:
37m:
59s@5-CONFIG:
Configuredfromoutband
1916-2(config-if)#switchportmodetrunk
0d:
0h:
38m:
13s@5-CONFIG:
Configuredfromoutband
1916-2(config-if)#end
1916-2#showinttrunk
InterfaceModeNativeVLANVLANlists
---------------------------------------------------------
Fa0/1Off1All
……
Fa0/16On1All
三层交换机的Trunk配置
3760-2#con
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
3760-2(config)#vlan10
2011-03-2114:
32:
39@5-CONFIG:
Configuredfromoutband
3760-2(config-vlan)#exit
2011-03-2114:
32:
44@5-CONFIG:
Configuredfromoutband
3760-2(config)#vlan20
2011-03-2114:
32:
51@5-CONFIG:
Configuredfromoutband
3760-2(config-vlan)#exit
2011-03-2114:
32:
53@5-CONFIG:
Configuredfromoutband
3760-2(config)#vlan30
2011-03-2114:
32:
59@5-CONFIG:
Configuredfromoutband
3760-2(config-vlan)#exit
2011-03-2114:
33:
01@5-CONFIG:
Configuredfromoutband
3760-2(config)#end
2011-03-2114:
33:
19@5-CONFIG:
Configuredfromoutband
3760-2#showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/1,Fa0/2,Fa0/3,Fa0/4
Fa0/5,Fa0/6,Fa0/7,Fa0/8
Fa0/9,Fa0/10,Fa0/11,Fa0/12
Fa0/13,Fa0/14,Fa0/15,Fa0/16
Fa0/17,Fa0/18,Fa0/19,Fa0/20
Fa0/21,Fa0/22,Fa0/23,Fa0/24
Gi0/25,Gi0/26,Gi0/27,Gi0/28
10VLAN0010active
20VLAN0020active
30VLAN0030active
3760-2#con
Enterconfigurationcommands,oneperline.EndwithCNT
3760-2(config)#intfa0/1
2011-03-2114:
35:
46@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#switchportmodetrunk
2011-03-2114:
36:
05@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#exit
2011-03-2114:
36:
15@5-CONFIG:
Configuredfromoutband
3760-2(config)#intf0/2
2011-03-2114:
36:
22@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#switchportmodetrunk
2011-03-2114:
36:
37@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#end
2011-03-2114:
36:
41@5-CONFIG:
Configuredfromoutband
3760-2#showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/1,Fa0/2,Fa0/3,Fa0/4
Fa0/5,Fa0/6,Fa0/7,Fa0/8
Fa0/9,Fa0/10,Fa0/11,Fa0/12
Fa0/13,Fa0/14,Fa0/15,Fa0/16
Fa0/17,Fa0/18,Fa0/19,Fa0/20
Fa0/21,Fa0/22,Fa0/23,Fa0/24
Gi0/25,Gi0/26,Gi0/27,Gi0/28
10VLAN0010activeFa0/1,Fa0/2
20VLAN0020activeFa0/1,Fa0/2
30VLAN0030activeFa0/1,Fa0/2
4、测试VLAN10内主机的通信
pc0pingPc3能通
Pc0pingPc4不通
小结
跨交换机划分VLAN,VLAN内,VLAN间的都不通;
但是配置Trunk后,跨交换机的VLAN内的主机能ping通。
2.3VLAN间的路由
1、三层交换机的配置
3760-2#cont
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
3760-2(config-if)#noshutdown
2011-03-2114:
49:
16@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#ipaddress192.168.100.1255.255.255.0
2011-03-2114:
49:
50@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#exit
2011-03-2114:
50:
08@5-CONFIG:
Configuredfromoutband
3760-2(config)#intvlan20
2011-03-2114:
50:
16@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#ipaddress192.168.200.1255.255.255.0
2011-03-2114:
50:
31@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#exit
2011-03-2114:
50:
38@5-CONFIG:
Configuredfromoutband
3760-2(config)#intvlan30
2011-03-2114:
50:
43@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#ipaddress192.168.250.1255.255.255.0
2011-03-2114:
51:
30@5-CONFIG:
Configuredfromoutband
3760-2(config-if)#end
2011-03-2114:
51:
32@5-CONFIG:
Configuredfromoutband
3760-2#showrunning-config
Systemsoftwareversion:
RGNOSV4.11(3)BuildOct102006Release
Buildingconfiguration...
Currentconfiguration:
527bytes
!
version1.0
!
hostname3760-2
vlan1
!
vlan10
!
vlan20
!
vlan30
!
enablesecretlevel145'T>H.Y*T3UC,tZ[V4^D+S(\W54G1X)sv
enablesecretlevel155*83j9=G1[89R:
>H.Z83_;C,tT1U0 ! interfaceFastEthernet0/1 switchportmodetrunk interfaceFastEthernet0/2 switchportmodetrunk ! interfaceVlan10 ipaddress192.168.100.1255.255.255.0 interfaceVlan20 ipaddress192.168.200.1255.255.255.0 interfaceVlan30 ipaddress192.168.250.1255.255.255.0 end 2、测试主机之间的通信 各个主机改好ip地址和网关,用ping命令进行通信测试,结果显示: 不同交换机,不同VLAN间的主机全能通。 3、查看switch0的mac-address-table 1916-1#showmac-address-table VlanMACAddressTypeInterface --------------------------------------------------------- 10001e.901e.1279DYNAMICFa0/1 10001e.901f.f7f6DYNAMICFa0/2 20001e.901f.faf5DYNAMICFa0/3 4、查看主机的mac表 arp–a 192.168.100.99001e.901e.1279dynamic 192.168.100.199001e.901f.f7f6dynamic 总结 在同一交换机下可以划分VLAN,同一VALN中主机间可以ping通,不同VLAN主机间不能ping通。 跨交换机划分VLAN时,VLAN内,VLAN间的主机都不通;但是配置Trunk后,跨交换机的VLAN内的主机能ping通。 配置路由后,不同交换机,不同VLAN间的主机全能通
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 组网 工程 实验 报告