思科设备三层交换机的vlan间通信配置.docx

上传人:scccc 文档编号:13384649 上传时间:2021-12-24 格式:DOCX 页数:6 大小:132.40KB
返回 下载 相关 举报
思科设备三层交换机的vlan间通信配置.docx_第1页
第1页 / 共6页
思科设备三层交换机的vlan间通信配置.docx_第2页
第2页 / 共6页
思科设备三层交换机的vlan间通信配置.docx_第3页
第3页 / 共6页
思科设备三层交换机的vlan间通信配置.docx_第4页
第4页 / 共6页
思科设备三层交换机的vlan间通信配置.docx_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《思科设备三层交换机的vlan间通信配置.docx》由会员分享,可在线阅读,更多相关《思科设备三层交换机的vlan间通信配置.docx(6页珍藏版)》请在三一文库上搜索。

1、本次主要讲解三层交换实现vian间的相互通信:Laptop-PT192.168-2.2'24本例配置模型图命令行:swA配置命令:Switch>e nableSwitch#vlandatabase / 进入 vian 配置模式% Warning: It is recomme nded to con figure VLAN from config mode, as VLAN database mode is being deprecated. Please con sult user docume ntati on for con figuri ng VTP/VLAN in con

2、fig mode.Switch(vlan)#vlan 2 name TztA / 在 swA 上创建 vlan 2 名为 TztAVLAN 2 added:Name: TztASwitch(vlan)#vlan 3 name TztB / 在 swA 上创建 vlan 3 名为 TztB VLAN 3 added:Name: TztBSwitch(vla n)#exitAPPLY completed.Exit in g.Switch#co nf tEn ter con figurati on comma nds, one per line. End with CNTL/Z.Switch(co

3、nfig)#i nt fO/2Switch(c on fig-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 3/ 将 f0/2 划分给 vlan 2/ 将 f0/3 划分给 vlan 3Switch(config-if)#exitSwitch(config)

4、#int f0/1Switch(config-if)#switchport mode trunk/ 配置与三层设备连接的f0/1 为 trunk 模式%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state todown %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#switchport trunk allowed vlan all / 允

5、许所有vlan 通过 f0/1 端口 Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#wrBuilding configuration.OKSwitch#( 三层交换机) M sw 命令配置:Switch>Switch>enableSwitch#vlandatabase / 进入 vlan 配置模式% Warning: It is recommended to configure VLAN from config mod

6、e, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 2 name TztA /在Msw 上创建vian 2 名为TztA VLAN2 added:Name: TztASwitch(vlan)#vlan 3 name TztB /在Msw 上创建vian 2 名为TztAVLAN 3 added:Name: TztBSwitch(vla n)#exitAPPLY comple

7、ted.Exit in gSwitch#co nf tEn ter con figurati on comma nds, one per line. End with CNTL/Z.Switch(co nfig)#i nt fO/1Switch(config-if)# switchport mode trunk / 配置三层设备与二层设备连接的fO/1 为trunk 模式Comma nd rejected: An in terface whose trunk en capsulati on is "Auto" can not be con figured to "

8、tr unk" mode.Switch(config-if)# switchport trunk allowed vlan all/ 允许所有vlan 通过 f0/1 端口Switch(config-if)#no shutdown/ 激活端口Switch(c on fig-if)#exitSwitch(config)# ip routing/使用三层设备的路由功能Switch(config)#intvlan 2/ 进入 vlan 2 配置模式虚拟端口%LINK-5-CHANGED: In terface Vla n2, cha nged state to upSwitch(co nf

9、ig-if)#%LINEPROTO-5-UPDOWN: Line protocol on In terface Vla n2, changed state to upSwitch(config-if)#ip address 192.168.1.1 255.255.255.0/ 配置 vlan 2 的 ip 地址Switch(config-if)#no shutdown/ 激活端口Switch(c on fig-if)#exitSwitch(config)#intvlan 3/ 配置 vlan 3 虚拟端口Switch(co nfig-if)#%LINK-5-CHANGED: In terfac

10、e Vla n3, cha nged state to up%LINEPROTO-5-UPDOWN: Line protocol on In terface Vla n3, changed state to upSwitch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(c on fig-if)# no shutdow nSwitch(c on fig-if)#exitSwitch(c on fig)#do show ip routeCodes: C - conn ected, S - static, I - IGRP, R - R

11、IP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF in ter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 -IS-IS level-2, ia - IS-IS in ter area * - can didate de

12、fault, U - per-user static route, o - ODRP - periodic dow nl oaded static routeGateway of last resort is not set上述的配置成果C 192.168.1.0/24 is directly connected, Vlan2 /C 192.168.2.0/24 is directly conn ected, Vla n3 Switch(co nfig)#Switch(c on fig)#exitSwitch# %SYS-5-CONFIG_l: Con figured from con sole by con soleSwitch#wrBuildi ng con figurati on.OK以上配置结束完成后,两台 PC能够相互通信(如图)注意:通信基础需要配置网关本次讲解结束!

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1