实验三 通过配置路由器或三层交换机实现VLAN间的通信_第1页
实验三 通过配置路由器或三层交换机实现VLAN间的通信_第2页
实验三 通过配置路由器或三层交换机实现VLAN间的通信_第3页
实验三 通过配置路由器或三层交换机实现VLAN间的通信_第4页
实验三 通过配置路由器或三层交换机实现VLAN间的通信_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、实验三 实现VLAN间的通信一、通过路由器实现vlan间通信(单臂路由)实验拓扑图【准备知识】在路由器与交换机的端口上配置子接口,每个子接口的IP地址是每个VLAN的网关地址(也可以理解为下一跳地址),并在子接口上封装802.1Q协议。也可以封装ISL协议(cisco专用协议,不兼容802.1Q)。【实验步骤】1、交换机配置如下:Switch>enSwitch#conf tSwitch(config)#vlan 2Switch(config-vlan)#vlan 3Switch(config-vlan)#exitSwitch(config)#int fa0/2Switch(config-

2、if)#sw ac vlan 2 /switchport access vlan 2的简写,端口fa0/2划到vlan 2中Switch(config-if)#int fa0/3Switch(config-if)#sw ac vlan 3Switch(config-if)#exitSwitch(config)#int fa0/1Switch(config-if)#switchport mode trunk /设置f0/1端口为trunk模式2、路由器配置如下:Router>enRouter#conf tRouter(config)#int fa0/0Router(config-if)#n

3、o shutdownRouter(config-if)#exitRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1q 2 /封装协议802.1Q,2为vlan 2Router(config-subif)#ip address 192.168.1.1 255.255.255.0Router(config-subif)#exitRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1q 3 /封装协议802.1Q,3为vlan 3Router(con

4、fig-subif)#ip address 192.168.2.1 255.255.255.0Router(config-subif)#exitRouter(config)#【检测实验结果】VLAN 2中的pc1能ping 通VLAN 3中的pc2。二、通过路由器实现跨交换机vlan间通信实验拓扑图【实验步骤】1、交换机BJ上的配置如下:BJ>enBJ#conf tBJ(config)#int f0/2BJ(config-if)#vlan 2BJ(config-vlan)#vlan 3BJ(config-vlan)#exitBJ(config)#int f0/2BJ(config-if)

5、#sw ac vlan 2BJ(config-if)#exitBJ(config)#int f0/3BJ(config-if)#sw ac vlan 3BJ(config-if)#exitBJ(config)#int f0/1BJ(config-if)#sw mode trunkBJ(config)#int f0/24BJ(config-if)#sw mode trunk2、交换机SH上的配置如下:SH>enSH#conf tSH(config)#vlan 2SH(config-vlan)#vlan 3SH(config-vlan)#exitSH(config)#int f0/2SH(c

6、onfig-if)#sw ac vlan 2SH(config-if)#exitSH(config)#int f0/3SH(config-if)#sw ac vlan 3SH(config-if)#exitSH(config)#int f0/1SH(config-if)#sw mode trunk3、路由器上的配置如下:Router>enRouter#conf tRouter(config)#int f0/0Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#int fa0/0.1Router(config-

7、subif)#encapsulation dot1q 2Router(config-subif)#ip address 192.168.10.1 255.255.255.0Router(config-subif)#exitRouter(config)#int fa0/0.2Router(config-subif)#encapsulation dot1q 3Router(config-subif)#ip address 192.168.20.1 255.255.255.04、各pc的配置如下:pc1:pc2:pc3:pc4:【检测实验结果】1.设好各pc的IP地址后,pc1能ping通pc3,p

8、c2能ping通pc4。2.设pc归属vlan后,pc1ping不通pc3。3.设交换机BJ和SH的f0/1为trunk,pc1能ping通pc3。4.配置r1后,pc1ping不通pc2。5.设BJ的f0/24端口为trunk,pc1ping不通pc2。6.分别对pc1和pc2加设对应网关,pc1能通pc2,pc1不通pc4。7.对pc4加设网关,pc1能通pc4。8VLAN 2中的pc1和pc3能ping 通VLAN 3中的pc2和pc4。三、通过三层交换机实现跨交换机vlan间通信实验拓扑图【实验目的】1、同一VLAN里的计算机系统能跨交换机相互通信. 2、不同VLAN里的计算机系统也可

9、以相互通信. 3、各vlan配置如下:vlan 10:192.168.10.1/24vlan 20:192.168.20.1/24vlan 30:192.168.30.1/244、各pc配置如下:pc机 ip地址 网关 pc1 192.168.10.2/24 192.168.10.1 pc2 192.168.20.2/24 192.168.20.1 pc3 192.168.10.3/24 192.168.10.1 pc4 192.168.20.3/24 192.168.20.1 pc5 192.168.30.2/24 192.168.30.1 pc6 192.168.20.4/24 192.1

10、68.20.1 pc7 192.168.30.3/24 192.168.30.1【实验步骤】1、交换机s0的配置如下:Switch#Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#int fa0/2Switch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#int fa0/3Switch(config-if)#sw ac vlan 20Switch(config-if)

11、#exitSwitch(config)#int fa0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#2、交换机s1的配置如下:Switch>Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#vlan 30Switch(conf

12、ig-vlan)#exitSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#sw ac vlan 20Switch(config-if)#exitSwitch(config)#int f0/4Switch(config-if)#sw ac vlan 30Switch(config-if)#exitSwitch(config)#int f0/1Switch(config-if)#sw mod

13、e trunk3、交换机s2的配置如下:Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 20Switch(config-vlan)#vlan 30Switch(config-vlan)#exitSwitch(config)#int fa0/2Switch(config-if)#switchport access vlan 20Switch(config-if)#exitSwitch(config)#int fa0/3Switch(co

14、nfig-if)#switchport access vlan 30Switch(config-if)#exitSwitch(config)#int fa0/1Switch(config-if)#switchport mode trunk4、三层交换机3560的配置如下:Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#vlan 30Switch(config-vlan)#exitSwitch(config)#int vlan 10Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#int vlan 20Switch(config-if)#ip address 192.168.20.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论