




已阅读5页,还剩46页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
交换实验第1章 交换机基本配置 1.1使用交换机的命令行管理界面实验设备:S2126G (1台)实验步骤:步骤1. 交换机命令行操作模式的进入 switchenable ! 进入特权模式switch# switch# configure terminal !进入全局配置模式 switch (config)# switch (config)# interface fastethernet 0/5 !进入交换机F0/5的接口模式 switch (config-if)# switch(config-if)# exit !退回到上一级操作模式 switch(config)# switch(config-if)#end !直接退回到特权模式 switch# 步骤2. 交换机命令行基本功能 帮助信息switch ? !显示当前模式下所有可执行的命令disable Turn off privileged commandsenable Turn on privileged commandsexit Exit from the EXEChelp Description of the interactive help systemping Send echo messagesrcommand Run command on remote switchshow Show running system informationtelnet Open a telnet connectiontraceroute Trace route to destinationswitvh#co? !显示当前模式下所有以co开头的命令configure copyswitch#copy ?flash: Copy from flash:file systemrunning-config Copy from current system configurationstartup-config Copy from startup configurationtftp: Copy from tftp:file systemxmodem Copy from xmodem file system命令的间写switch# conf ter !交换机命令行支持命令的简写,该命令代表configure terminalswitch(config)#命令的自动补齐Switch#con (按键盘的TAB键自动补齐configure ) !交换机支持命令的自动补齐Switch #configure命令的快捷键功能Switch(config-if) # Z !CTRL+Z 退回到特权模式Switch#Switch# ping Sending 5, 100-byte ICMP Echos to Timeout is 2000 milliseconds.Switch#1.2交换机的全局配置实验设备:S2126G(一台)实验步骤:步骤1. 交换机设备名称的配置 Switch enable Switch#configure terminalSwitch(config)#hostname 105_switch !配置交换机的设备名称为105_switch105_switch(config)#步骤2.交换机每日提示信息的配置105_switch(config) # banner motd & !配置每日提示信息 &为终止符2006-04-14 17:26:54 5-CONFIG:Configured from outbandEnter TEXT message. End with the character &.Welcome to 105-switch, if you are admin , you can config it.If you are not admin , please EXIT ! !输入描述信息& !以&符号结束终止输入验证测试:105_switch(config)#exit105_switch#exitPress RETURN to get startedwelcome to 105_switch, if you are admin, you can config it if you are not admin,please EIXT105_switch 1.3交换机端口的基本配置实验设备: S2126G(1台) 主机(1台) 直连线(1条)实验步骤:步骤1:交换机端口参数的配置。SwitchenableSwitch#configure terminalSwitch(config)#interface fastethernet 0/3 !进行的F0/3端口模式 Switch(config-if)#speed 10 !配置端口速率为10MSwitch(config-if)#duplex half !配置端口的双工模式为半双工Switch(config-if)#no shutdown !开启该端口,使端口转发数据 步骤2:查看交换机端口的配置信息Switch#show interface fastethernet 0/3Interface :FastEthernet100BaseTX 0/3Description:AdminStatus: up !查看端口的状态OperStatus:upHardware :10/100BaseTXMtu :1500LastChange :0d:0h:0m:0sAdminDuplex : Half !查看配置的双工模式OperSpeed :UnknownAdminSpeed :0 !查看配置的速率OperSpeed : UnknownFlowControlAdminStatus: offFlowControlOperStatus : off Priority : 0Broadcast blocked :DISABLEUnknow multicast blocked :DISABLEUnknow uicast blocked : DISABLE1.4产看交换机的系统和配置信息实验设备: S2126G (1台) 、主机(1台)、 直连线(1条)实验步骤:步骤1:交换机端口参数的配置 SwitchenableSwitch#configure terminalSwitch(config)#hostname 105_switch105_switch(config)#interface fastethernet 0/3105_switch(config-if)#speed 10105_switch(config-if)#duplex half105_switch(config-if)#no shutdown步骤2.查看交换机各项信息105_switch# show version 查看交换机的版本信息System description :Red-Gigabit Intelligent Switch(S2126G) By Ruijie Network !系统描述信息System uptime :0d:0h:43m:28sSystem hadware version : 3.0System software version :1.61(4) Build Sep 9 2005 ReleaseSystem ROOT version :RG-S2126G-BOOT 01-02-02System CREL veirson :RG-2126G-CTRL 03-09-03 !操作系统版本信息Running Switching Image : Layer2 !二层交换机105_switch# show mac-address-table !查看交换机的MAC地址表Vlan MAC Address Type Interface- - -1 00d0.f888.2be2 DYNAMIC Fa0/3105_switch# show running-config !查看交换机当前生效的配置信息System software version : 1.61(4) Build Sep 9 2005 ReleaseBuilding configurationCurrent configuration :117 bytes!Version 1.0!Hostname 105_switch !配置的主机名Vlan 1!Interface fastEthernet 0/3 !针对F0/3端口配置的参数Speed 10Duplex half ! end第2章 虚拟局域网VLAN2.1 交换机端口隔离实验步骤: S2126G9(1台) 、 PC(1台) 、 直连线(1条)实验步骤:步骤1。在未划VLAN 前两台PC相互ping可以通。下面创建VLAN Switch#configure terminal !进入交换机全局配置模式 Switch(config)# vlan 10 ! 创建vlan 10 Switch(config-vlan)# name test10 #将Vlan 10命名为test10Switdh(config-vlan)#exitSwitch(config)#valn 20 !创建vlan 20swtch(config-vlan) # name test20 !将Vlan 20 命名为test20验证测试:Switch# show vlan !查看已配置的VLAN信息 VLAN Name Status ports- - -1 default active Fa0/1, Fa0/2, Fa0/3 Fa0/4 ,Fa0/5 ,Fa0/6Fa0/7, Fa0/8, Fa0/9Fa0/10, Fa0/1, Fa0/12Fa0/13, Fa0/14, Fa0/15Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21Fa0/22, Fa0/23, Fa0/24Fa0/25, Fa0/26, Fa0/27 !默认情况下所有接口都属于VLAN110 test10 active !创建的VLAN10,没有端口属于VLAN1020 text20 active !创建的VLAN20,没有端口属于VLAN20步骤2.将接口分配到VLAN.Switch#configure terminal !将fastethernet 0/5端口加入vlan 10 中Switch(config)#interface fastethernet 0/5Switch(config-if)#switchport access vlan 10Switch(config-if)#exit !将fastethernet 0/15端口加入vlan 20中Switch(config)#interface fastethernet 0/15Switch(config-if)# switchport access vlan 20步骤3.两台pc相互ping不通验证测试: Switch#show vlanVLAN Name Status Ports- - -1 default active Fa0/1,Fa0/2,Fa0/3 Fa0/4,Fa0/6,Fa0/7, Fa0/8, Fa0/9Fa0/10, Fa0/1, Fa0/12Fa0/13, Fa0/14, Fa0/16, Fa0/17, Fa0/18,Fa0/19, Fa0/20, Fa0/21,Fa0/22, Fa0/23, Fa0/24 10 test10 active Fa0/5 20 test20 active Fa0/15 参考配置:Switch#show running-configBuilding configurationCurrent configuration:162 bytes!Version 1.0!Hostname SwitchVlan1!Vlan 10Name test10!Vlan 20Name test10!Interface fastEthernet 0/5Switchport access vlan 10!Interface fastEthernet 0/15Switchport access vlan 20! end2.2跨交换机实现VLAN实验设备:S2126G(两台) 、主机(3台)、直连线(4条)实验步骤:步骤1.在交换机SwitchA上创建Vlan 10,并将0/5端口划分到Vlan10中。SwicthA#configure terminalSwitchA(config)# vlan 10SwitchA(config-vlan)# name salesSwitchA(config-vlan)# exitSwitchA(config)# interface fastethernet0/5SwitchA(config-if)#switchport access vlan 10验证测试:验证已经创建了Vlan10,并将0/5端口已划分到Vlan 10中SwitchA#show vlan id 10 !查看某一个VLAN得信息VLAN Name Status Ports- - -10 sales actives Fa0/5步骤2.在交换机switchA上创建Vlan20,并将0/15端口划分到Vlan 20. SwitchA#(config)# vlan 20SwitchA(config-vlan) #name technicalSwitchA(config-vlan)#exitSwitchA(config)#interface fastethernet0/15SwitchA(config-if)#switchport access vlan 20验证测试:验证已创建了Vlan20, 并将0/15端口已划分到Vlan20中SwitchA#show vlan id 20VLAN Name Status Ports- - -20 technical actives Fa0/15步骤3.把交换机Switch与交换机Switch相连的端口(假设为0/24端口)定义为tag vlan模式SwitchA(config)#interface fastethernet0/24SwitchA(config-if)#switchport mode trunk !将fastethernet 0/24端口设为tag vlan 模式验证测试:验证fastethernet 0/24 端口已被设置为tag vlan 模式SwitchA#show interfaces fastEthernet0/24 switchportInterface switchport Mode Access Native Protected VLAN lists- - - -Fa0/24 Enabled Trunk 1 1 Disable All注:交换机Trunk接口默认情况下支持所有VLan步骤4.在交换机SwitchB上创建Vlan 10 ,并将0/5端口划分到Vlan 10中。SwitchB # configure terminalSwitchB(config) # vlan 10SwitchB(confif-vlan) #name salesSwitchB(confif-vlan) # exitSwitchB(config) #interface fastethernet0/5SwitchB(confif-if) # switchport access vlan 10验证测试:验证已在SwitchB上创建了Vlan 10 ,并将0/5端口已划分到Vlan10中SwitchB # show vlan id 10VLAN Name Status ports- - - -10 sales active Fa0/5步骤5.把交换机SwichB与交换机SwitchA相连的端口(假设为0/24端口)定义为tag vlan 模式SwitchB(config)# interface fastethernet 0/24SwitchB(config-if) # switchport mode trunk验证测试:验证fastethernet0/24端口已被设置为tag vlan 模式SwitchB#show interface fastethernet 0/24 switchportInterface Switchport Mode Access Native Protected VLAN lists- -Fa0/24 Enable Trunk 1 1 Disabled All步骤6.验证PC1与PC2能互相通信,但PC2与PC3不能相互通信C: ping 0 !在PC1的命令行方式下能验证能Ping通PC3Pinging 0 with 32 bytes of data:Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 timeping 0 !在PC2的命令行方式下能验证能Ping通PC3Pinging 0 with 32 bytes of data:Request timed out.Request timed out.Request timed out.Ping statistics for 0: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0ms参考配置:SwitchA#show running-config !显示交换机SwitchA的全部配置Building configuration.Current configuration : 284 bytes!version 1.0!hostname SwitchAvlan 1!vlan 10 !创建VLAN10 name sales!vlan 20 !创建VLAN20 name technical!interface fastEthernet 0/5 switchport access vlan 10 !将F0/5加入VLAN10!interface fastEthernet 0/15 switchport access vlan 20 !将F0/15加入VLAN20!interface fastEthernet 0/24 switchport mode trunk !将F0/15设为TRUNK,支持TAG VLAN!EndSwitchB#show running-config !显示交换机SwitchB的全部配置Building configuration.Current configuration : 284 bytes!version 1.0!hostname SwitchBvlan 1 !vlan 10 !创建VLAN10 name sales!interface fastEthernet 0/5 switchport access vlan 10 !将F0/5加入VLAN10!interface fastEthernet 0/24 switchport mode trunk !将F0/24设为TRUNK,技术TAG VLAN!End第3章 提供交换网络中的余链路3.1 端口聚合提供备份链路实验设备: S2126G(两台) PC(两台) 直连线(4条) 按照拓扑图连接网络时注意,两台交换机都配置完端口聚合后,再将两台交换机连接起来。如果先连线再配置会造成广播风暴,影响交换机的正常工作。实验步骤: 步骤1.交换机A的基本配置Switch#configure terminalSwitchA(config)#vlan 10SwitchA(config-vlan)#name salesSwitchA(config-vlan)#exitSwitchA(config)#interface fastethernet 0/5SwitchA(config-if)#switchport access vlan 10验证测试:验证以创建了VLan10,并将0/5端口以划分到VLan 10 中。SwitchA#show vlan id 10VLAN Name Status Ports- - - -10 sales active Fa0/5SwitchA(config)#interface aggregatePort 1 !创建聚合端口AG1SwitchA(config-if)#switchport mode trunk !配置AG模式为trunkSwitchA(config-if)#exitSwitchA(config)#interface range fastethernet 0/1-2 !进入接口0/1 和0/2SwitchA(config-if-range)#port-group 1 !配置接口0/1和0/2属于AG1验证测试:验证接口fastethernet0/1和0/2属于AG1SwitchA # show aggregateport 1 summary !查看端口聚合组1的信息AggregatePort MaxPorts SwitchPort Mode Ports- - - - -Ag1 8 Enabled Trunk Fa0/1 , Fa0/2注:AG1,最大支持端口数为8个,当前VLAN模式为Trunk,组成员有F0/1、F0/2.步骤3。交换机B的基本配置SwitchB#configure terminalSwitchB(config)#vlan 10SwitchB(config-vlan)#name salesSwitchB(config-vlan)#exitSwitchB(config)#interface fastethernet0/5SwitchB(config-if)#switchport access vlan 10验证测试:验证已在SwitchB上创建了Vlan10,并将0/5端口划分到Vlan 10中。SwitchB#show vlan id 10VLAN Name Status Ports- - - -10 sales active Fa0/5步骤4.在交换机SwitchB上配置聚合端口。SwitchB(config)#interface aggregateport 1 !创建聚合端口AG1SwitchB(config-if)#switchport mode trunk !配置AG模式为trunkSwitchB(config-if)#exitSwitchB(config)#interface range fastethernet 0/1-2 !进入接口0/1 和0/2SwitchB(config-if-range)#port-group 1 !配置接口0/1和0/2属于AG1验证测试:验证接口fastethernet0/1和0/2属于AG1.SwitchB#show aggregatePort 1 summaryAggregatePort MaxPorts SwitchPort Mode Ports- - - - -Ag1 8 Enabled Trunk Fa0/1 , Fa0/2步骤5.验证当交换机之间的一条链路断开时,PC1与PC2仍能相互通信C:ping 0 -tPinging 0 with 32 bytes of data:Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128Reply from 0: bytes=32 time1ms TTL=128参考配置:SwitchA#show running-config !显示交换机SwitchA的全部部署Building configuration.Current configuration : 497 bytes!version 1.0!hostname SwitchAvlan 1!vlan 10 name sales!interface aggregatePort 1 !聚合端口1的VLAN模式为Trunk switchport mode trunk!interface fastEthernet 0/1 !将F0/1加入聚合组1 port-group 1!interface fastEthernet 0/2 !F0/2加入聚合组1 port-group 1!interface fastEthernet 0/5 switchport access vlan 10!endSwitchB#show running-config !显示交换机SwitchB的全部配置Building configuration.Current configuration : 497 bytes!version 1.0!hostname SwitchBvlan 1!vlan 10 name sales!interface aggregatePort 1 switchport mode trunk!interface fastEthernet 0/1 port-group 1!interface fastEthernet 0/2 port-group 1!interface fastEthernet 0/5 switchport access vlan 10!End3.2 快速生成树配置实验设备:S2126G (两台) 主机(两台) 直连线(4条)实验步骤:步骤1.交换机A的基本配置Switch#configure terminalSwitch(config)#hostname switchAswitchA(config)#vlan 10switchA(config-vlan)#name slaesswitchA(config-vlan)#exitswitchA(config)#interface fastethernet0/3switchA(config-if)#switchport access vlan 10switchA(config-if)#exitswitchA(config)#interface range fastethernet 0/1-2switchA(config-if-range)#switchport mode trunk步骤2.交换机B上的基本配置Switch#configure terminalSwitch(config)#hostname switchBswitchB(config)#vlan 10switchB(config-vlan)#name slaesswitchB(config-vlan)#exitswitchB(config)#interface fastethernet0/3switchB(config-if)#switchport access vlan 10switchB(config-if)#exitswitchB(config)#interface range fastethernet 0/1-2switchB(config-if-range)#switchport mode trunk步骤3.配置快速生成树协议switchA#configure terminalswitchA(config)#spanning-treeswitchA(config)#spanning-tree mode rstpswitchB#configure terminalswitchB(config)#spanning-treeswitchB(config)#spanning-tree mode rstp验证测试:验证快速生成树协议已经开启switchA#show spanning-treeStpVersion : RSTPSysStpStatus : EnabledBaseNumPorts : 24MaxAge : 20HelloTime : 2ForwardDelay : 15BridgeMaxAge : 20BridgeHelloTime : 2BridgeForwardDelay : 15MaxHops : 20TxHoldCount : 3PathCostMethod : LongBPDUGuard : DisabledBPDUFilter : DisabledBridgeAddr : 001a.a907.41ebPriority : 32768TimeSinceTopologyChange : 0d:0h:0m:23sTopologyChanges : 0DesignatedRoot : 8000001AA9074111RootCost : 200000RootPort : Fa0/1switchB#show spanning-treeStpVersion : RSTPSysStpStatus : EnabledBaseNumPorts : 24MaxAge : 20HelloTime : 2ForwardDelay : 15BridgeMaxAge : 20BridgeHelloTime : 2BridgeForwardDelay : 15MaxHops : 20TxHoldCount : 3PathCostMethod : LongBPDUGuard : DisabledBPDUFilter : DisabledBridgeAddr : 001a.a907.4111Priority : 32768TimeSinceTopologyChange : 0d:0h:0m:33sTopologyChanges : 0DesignatedRoot : 8000001AA9074111RootCost : 0RootPort :
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论