计算机网络实验二 虚拟局域网Word格式.docx
- 文档编号:16766676
- 上传时间:2022-11-25
- 格式:DOCX
- 页数:8
- 大小:24.54KB
计算机网络实验二 虚拟局域网Word格式.docx
《计算机网络实验二 虚拟局域网Word格式.docx》由会员分享,可在线阅读,更多相关《计算机网络实验二 虚拟局域网Word格式.docx(8页珍藏版)》请在冰豆网上搜索。
在未划VLAN前两台PC互相ping可以通。
第二步:
创立VLAN。
Switch#configureterminal!
进入交换机全局配置模式。
Switch(config)#vlan10!
创立vlan10。
Switch(config-vlan)#nametest10!
将Vlan10命名为test10。
Switch(config)#vlan20!
创立vlan20。
Switch(config-vlan)#nametest20!
将Vlan20命名为test20。
第三步:
将接口分配到VLAN。
Switch(config)#interfacefastethernet0/5!
进入fastethernet0/5的接口配置模式。
Switch(config-if)#switchaccessvlan10!
将fastethernet0/5端口参加vlan10中。
Switch(config)#interfacefastethernet0/15!
进入fastethernet0/15的接口配置模式。
Switch(config-if)#switchaccessvlan20!
将fastethernet0/15端口参加
vlan20中。
第四步:
两台PC互相ping不通。
验证测试:
Switch#showvlan
VLANNameStatusPorts
----------------------------------------------------------------------------
1defaultactiveFa0/1,Fa0/2,Fa0/3
Fa0/4,Fa0/6,Fa0/7
Fa0/8,Fa0/9,Fa0/10
Fa0/11,Fa0/12,Fa0/13
Fa0/14,Fa0/16,Fa0/17
Fa0/18,Fa0/19,Fa0/20
Fa0/21,Fa0/22,Fa0/23
Fa0/24
10test10activeFa0/5
20test20activeFa0/15
如下列图在未划VLAN前两台PC互相ping可以通。
但是划分VLAN之后两台PC互相ping不通。
六、实验心得
实验一的时候那个交换机根本配置的实验根本看不懂,一直输入错误,原来要先输入enable,然后那些前缀的东西,例如Switch(config)#、Switch(config-if)#,你进入了下一层,就要输入e*it退出返回上一层,不然就会错误。
对那些语句也有了更好的理解。
实验2.2
理解VLAN如何跨交换机实现。
使在同一VLAN里的计算机系统能跨交换机进展相互通信,而在不同VLAN里的计算机系统不能进展相互通信。
三、
实验拓扑
SwitchASwitchB
PC1PC3
PC2
S2126G(2台)
在交换机SwitchA上创立Vlan10,并将0/5端口划分到Vlan10中。
SwitchA#configureterminal!
进入全局配置模式。
SwitchA(config)#vlan10!
创立Vlan10。
SwitchA(config-vlan)#namesales!
将Vlan10命名为sales。
SwitchA(config-vlan)#e*it
SwitchA(config)#interfacefastethernet0/5!
进入接口配置模式。
SwitchA(config-if)#switchportaccessvlan10!
将0/5端口划分到Vlan10。
验证已创立了Vlan10,并将0/5端口已划分到Vlan10中。
SwitchA#showvlanid10
10salesactiveFa0/5
在交换机SwitchA上创立Vlan20,并将0/15端口划分到Vlan20中。
SwitchA(config)#vlan20!
创立Vlan20。
SwitchA(config-vlan)#nametechnical!
将Vlan20命名为technical。
SwitchA(config)#interfacefastethernet0/15!
SwitchA(config-if)#switchportaccessvlan20!
将0/15端口划分到Vlan20。
验证已创立了Vlan20,并将0/15端口已划分到Vlan20中。
SwitchA#showvlanid20
20technicalactiveFa0/15
在交换机SwitchA上将与SwitchB相连的端口〔假设为0/24端口〕定义为tagvlan模式。
SwitchA(config)#interfacefastethernet0/24!
SwitchA(config-if)#switchportmodetrunk!
将fastethernet0/24端口设为tagvlan模式。
验证fastethernet0/24端口已被设置为tagvlan模式。
SwitchA#showinterfacesfastEthernet0/24switchport
InterfaceSwitchportModeAccessNativeProtectedVLANlists
-------------------------------------------------------------------------
Fa0/24EnabledTrunk11DisabledAll
在交换机SwitchB上创立Vlan10,并将0/5端口划分到Vlan10中。
SwitchB#configureterminal!
SwitchB(config)#vlan10!
SwitchB(config-vlan)#namesales!
SwitchB(config-vlan)#e*it
SwitchB(config)#interfacefastethernet0/5!
SwitchB(config-if)#switchportaccessvlan10!
验证已在SwitchB上创立了Vlan10,并将0/5端口已划分到Vlan10中。
SwitchB#showvlanid10
第五步:
在交换机SwitchB上将与SwitchA相连的端口〔假设为0/24端口〕定义为tagvlan模式。
SwitchB(config)#interfacefastethernet0/24!
SwitchB(config-if)#switchportmodetrunk!
SwitchB#showinterfacesfastEthernet0/24switchport
第六步:
验证PC1与PC3能互相通信,但PC2与PC3不能互相通信。
理解了那些语句就没有则难了,在上一个实验的根底上,很快就做出来了。
教师给的实验步骤都很相信跟着做根本都能做出来。
实验2.3
通过三层交换机实现VLAN间互相通信。
使在同一VLAN里的计算机系统能跨交换机进展相互通信,而在不同VLAN里的计算机系统也能进展相互通信。
S2126G〔1台〕、S3550-24〔1台〕
在虚拟环境下配置时会出错,解决方法:
先配置封装,再设置为trunk模式,命令:
SwitchA(config-if)#Switchporttrunkencapsulationdotlq
SwitchA(config-if)#switchportmodetrunk
第七步:
设置三层交换机VLAN间通讯。
SwitchA(config)#intvlan10!
创立虚拟接口vlan10
SwitchA(config-if)#e*it!
返回到全局配置模式
SwitchA(config)#intvlan20!
创立虚拟接口vlan20
第九步:
测试结果
不同VLAN的主机可以互相PING通
IP地址与网关必须设置在同一网段,三层的交换机才有路由功能,二层交换机不具备路由功能。
这两条信息必须严格遵守,不然实验做不出来。
通过整个实验二,提高太多了,之前看着那些代码没有什么感觉,现在根本都能看懂了,知道是要干什么。
然后不得不说这些实验容不得一点错误,必须一步一步跟着来做。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机网络实验二 虚拟局域网 计算机网络 实验 虚拟 局域网
![提示](https://static.bdocx.com/images/bang_tan.gif)