Cisco交换机配置手册_第1页
Cisco交换机配置手册_第2页
Cisco交换机配置手册_第3页
Cisco交换机配置手册_第4页
Cisco交换机配置手册_第5页
已阅读5页,还剩18页未读, 继续免费阅读

付费下载

下载本文档

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

文档简介

1、2950交换机简明配置维护手册目录说明3产品特性3配置端口 4配置一组端口 4配置二层端口 6配置端口速率及双工模式 6端口描述7监控及维护端口 8监控端口和控制器的状态 8刷新、重置端口及计数器 10关闭和打开端口 10配置 VLAN 11理解 VLAN 11可支持的VLAN 12配置正常范围的 VLAN 12生成、修改以太网 VLAN 13删除 VLAN 14将端口分配给一个 VLAN 15配置 VLAN Trunks 16使用STP实现负载均衡19配置 Cluster 23说明本手册只包括日常使用的有关命令及特性,其它未涉及的命令及特性请参考英文的详细配置手册。产品特性2950是只支持二

2、层的交换机支持VLAN 到 250 个 VLAN 支持 VLAN ID 从 1 至V 4094 ( IEEE 802.1Q 标准) 支持ISL及IEEE 802.1Q 封装安全支持IOS标准的密码保护支持标准及扩展的访问列表来定义安全策略 支持基于VLAN的访问列表监视 交换机LED指示端口状态 SPAN及远端SPAN (RSPAN)可以监视任何端口或 VLAN的流量*内置支持四组的 RMON监控功能(历史、统计、告警及事件)配置端口配置一组端口命令目的Step 1configure terminal进入配置状态Step 2interface range port-range 进入组配置状态S

3、tep 3可以使用平时的端口配置命令 进行配置Step 4end退回Step 5show interfaces interface-id 验证配置Step 6copy running-config startup-config保存当使用interface range 命令时有如下的规则:有效的组范围:o vlan 从 1 至V 4094o fastethernet 槽位 /(first port - ( last port,槽位为 0o gigabitethernet 槽位 /(first port - ( last port,槽位为 0o port-channel port-channel-

4、number - port-channel-number , port-channel 号从 1 到64 端口号之间需要加入空格,如: interface range fastethernet 0/1 - 5是有效的,而 interface range fastethernet 0/1-5 是无效的. interface range 命令只能酉己置已经存在的interface vlan*所有在同一组的端口必须是相同类别的。见以下例子:Switch# configure terminalSwitch(config)# interface range fastethernet0/1 - 5Swit

5、ch(config-if-range)# no shutdownSwitch(config-if-range)#*Oct6 08:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet0/1,changed stateto up*Oct6 08:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet0/2,changed stateto up*Oct6 08:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet0/3,changed stateto up*Oct6 08:24:35:%LINK-3-UP

6、DOWN:InterfaceFastEthernet0/4,changed stateto up*Oct6 08:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet0/5,changed stateto up*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/05, changed state to up*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet

7、0/3,changedstate to up*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4,changedstate to up以下的例子显示使用句号来配置不同类型端口的组:Switch# configure terminalSwitch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2Switch(config-if-range)# no shutdownSwitch(config-if-ra

8、nge)#*Oct6 08:29:28:%LINK-3-UPDOWN:Interface FastEthernet0/1, changed state toup*Oct6 08:29:28:%LINK-3-UPDOWN:Interface FastEthernet0/2, changed state toup*Oct6 08:29:28:%LINK-3-UPDOWN:Interface FastEthernet0/3, changed state toup*Oct6 08:29:28:%LINK-3-UPDOWN:Interface GigabitEthernet0/1, changed st

9、ateto up*Oct6 08:29:28:%LINK-3-UPDOWN:Interface GigabitEthernet0/2, changed stateto up*Oct 6 08:29:29: %LINEPROTO-5-UPDOWNine protocol on Interface GigabitEthernet。/ 1, changed state to up*Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/ 2, changed state to up*Oct 6 08:

10、29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/ 3, changed state to up配置二层端口2950的所有端口缺省的端口都是二层口,如果此端口已经配置成三层端口的话,则需要用switchport来使其成为二层端口。配置端口速率及双工模式可以配置快速以太口的速率为10/100Mbps及千兆以太口的速率为10/100/1000-Mbps;但对丁 GBIC端口则不能配置速率及双工模式,有时可以配 置nonegotiate,当需要联接不支持自适应的其它千兆端口时命令目的Step 1configure

11、 terminal进入配置状态.Step 2interface interface-id进入端口配置状态.Step 3speed (10 | 100 | 1000 | auto | nonegotiate 设置端口速率注1000只工作在千兆口 . GBIC模块只工作在 1000 Mbps下.nonegotiate 只 能在这些 GBIC上用 1000BASE-SX, -LX, and -ZX GBIC.Step 4duplex (auto | full | half 设置全双工或半双工.Step 5end退出Step 6show interfaces interface-id显示有关配置情况S

12、tep 7copy running-config startup-config保存Switch# configure terminal命令目的Step 1configure terminal进入配置模式Step 2interface interface-id进入要加入描述的端口Step 3description string加入描述(最多240个 字符).Step 4end退回.Step 5show interfaces interface-id descriptionorshow running-config验证.Step 6copy running-config startup-confi

13、g保存Switch(config-if)#speed 10Switch(config-if)#端口描述duplex halfUse the no description interface configuration command to delete the description.This example shows how to add a description on Fast Ethernet interface 0/4 and to verify the description:Switch# config terminalEnter configuration commands,

14、 one per line. End with CNTL/Z.Switch(config)#interface fastethernet0/4Switch(config-if)#description Connects to MarketingSwitch(config-if)# endSwitch# show interfaces fastethernet0/4 descriptionInterface Status Protocol DescriptionFa0/4 up down Connects to Marketing监控及维护端口监控端口和控制器的状态主要命令见下表:Show Co

15、mmands for Interfaces Command目的show interfaces interface-id 显小所有端口或某一端口的状态和配 置.showinterfaces interface-id status err-disabled 显示一系列端口的状态或错误一关闭 的状态show interfaces interface-id switchport显示二层端口的状态,可以用来决定 此口是否为二层或二层口。show interfaces interface-id description显示端口描述show running-config interfaceinterface-

16、id 显示当前酉己置中的端口配置情况show version显示软硬件等情况举例如下:Switch# show interfaces statusPort Name Status Vlan Duplex Speed TypeGi0/1connected routed a-full a-100 10/100/1000BaseTXGi0/2 wce server 20.20.2 disabled routed auto auto 10/100/1000Base TXGi0/3ip wccp web-cache notconnectroutedauto auto 10/100/1000Base TX

17、Gi0/4notconnectroutedautoauto 10/100/1000Base TXGi0/5notconnectroutedautoauto 10/100/1000Base TXGi0/6disabledroutedautoauto 10/100/1000Base TXGi0/7disabledroutedautoauto 10/100/1000Base TXGi0/8disabledroutedauto100 10/100/1000Base TXGi0/9notconnectroutedautoauto 10/100/1000Base TXGi0/10notconnectrou

18、tedautoauto 10/100/1000Base TXGi0/11disabledroutedautoauto unknownGi0/12notconnectroutedautoauto unknownSwitch# show interfaces fastethernet 0/1 switchportName: Fa0/1Switchport: EnabledAdministrative Mode: static accessOperational Mode: downAdministrative Trunking Encapsulation: dot1qNegotiation of

19、Trunking: OffAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Trunking VLANs Enabled: ALLPruning VLANs Enabled: 2-1001Protected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledVoice VLAN: dot1p (Inactive)Appliance trust: 5Switch# show running-config interf

20、ace fastethernet0/2Building erface FastEthernet0/2 switchport mode access switchport protected no ip address mls qos cos 7 mls qos cos override end刷新、重置端口及计数器Clear命令目的clear counters interface-id 活除端口计数器.clear line number | console 0 | vty number重置异步申口的硬件逻辑X Note clear counters命令只清除用

21、 show interface所显示的计数,不影响用 snmp得到 的计数举例如下:Switch# clear counters fastethernet0/5Clear "show interface" counters on this interface confirmySwitch#*Sep 30 08:42:55: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet0/5by vty1 (0)可使用clear line命令来活除或重置某一端口或申口,在大部分情况下并不需要这样做

22、:Switch# clear interface fastethernet0/5关闭和打开端口命令目的Step 1configure terminal进入配置状态Step 2interface vlan vlan-id | ( fastethernet | gigabitethernet interface-id | port-channel port-channel-number 选择要 关闭的 端口Step 3shutdown关闭Step 4end退出Step 5show running-config验证使用no shutdown命令重新打开端口 .举例如下:Switch# configu

23、re terminalSwitch(config)# interface fastethernet0/5Switch(config-if)# shutdownSwitch(config-if)#*Sep 30 08:33:47: %LINK-5-CHANGED: Interface FastEthernet0/5, changed state to a administratively downSwitch# configure terminalSwitch(config)# interface fastethernet0/5Switch(config-if)# no shutdownSwit

24、ch(config-if)#*Sep 30 08:36:00: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to up配置VLAN理解VLAN一个VLAN就是一个交换网,其逻辑上按功能、项目、应用来分而不必考虑用户的物理位 置。任何交换口都可以属于某一VLAN, IP包、广播包及组播包均可以发送或广播给在此VLAN内的最终用户。每一个 VLAN均可看成是一个逻辑网络,发往另一 VLAN的数据包必须由路由器或网桥转发(如下图)。由于VLAN被看成是一个逻辑网络,其具有自己的网 桥管理信息康(MIB)并可支持自己的生成树VLAN

25、作为逻辑定义的网络示意图VLANVLANVLANVLANS常与IP子网相联系,同一 IP子网届丁同一 VLAN在3550上VLA业问 的数据包可以由VLANS 口进行转发。可支持的VLANCatalyst 3550 交换机支持 250 个 VLAN,可以分别是 VTP client, server, 及 transparent modes. VLAN 号可以从 1 到 4094. VLAN 号 1002 到 1005保留给令 牌环及FDDI VLAN. VTP只能学习到普通范围的 VLAN,即从VLANKJ 1到1005;VLAW大丁 1005届丁扩展VLAN不存在VLA吸据犀中。 交换机必须

26、配置成 VTP透明模式当需要生成VLAN号从1006到4094.本交换机支持基丁每一 VLAN的生成树(PVST),最多支持128个生成树。本交换 机支持ISL及IEEE 802.1Q trunk 二种封装。配置正常范围的VLANVLAN 号1,1002到1005是自动生成的不能被去掉。VLAN# 1到1005的配置被写到文件vlan.dat 中,可以用showvlan命令查看, vlan.dat 文件存放在 NVRAlM.VLAN的不完整。如要删除vlan需要注意不要手工删除vlan.dat文件,可能造成 用有关的命令来进行生成、修改以太网 VLAN命令目的Step 1configure t

27、erminal进入配置状态Step 2vlan vlan-id输入一个VLAW,然后进入vlan配置状 态,可以输入一个新的 VLAN或旧的来 进行修改。Step 3name vlan-name(可选)输入一个VLANfe,如果没有配置 VLA*,缺省的名字是 VLAW前面用0 填满的4位数,如VLAN000掘VLAN4勺 缺省名字Step 4mtu mtu-size(可选)改变MTUfc小Step 5end退出Step 6show vlan name vlan-name | id vlan-id 验证Step 7copy running-config startup config(可选)保存

28、配置用 no vlan name或 no vlan mtu退回到缺省的 vlan 配置状态举例如下:Switch# configure terminalSwitch(config)#vlan 20Switch(config-vlan)#name test20Switch(config-vlan)# end也可以在enable状态下,进行VLAN0己置:命令目的Step 1vlan database进入VLANg己置状态Step 2vlan vlan-id name vlan-name加入 VLAN#及 VLANgStep 3vlan vlan-id mtu mtu-size(可选)修改MTU:

29、小Step 4exit更新VLANN据犀并退 出Step 5show vlan namevlan-name | id vlan-id 验证配置Step 6copy running-config startup config保存配置(可选)举例如下:Switch# vlan databaseSwitch(vlan)# vlan 20 name test20Switch(vlan)# exitAPPLY completed.Exiting.Switch#删除VLAN当删除一个处于 VTP服务器的交换机上删除 VLAN时,则此VLAN将在所有相同 VTP的 交换机上删除。当在透明模式下删除时,只在当

30、前交换机上删除。注意 当删除一个VLAN时,原来属于此 VLAN的端口将处于非激活的状态,直到将 其分配给某一 VLAN 。命令目的Step 1configure terminal进入配置状态Step 2no vlan vlan-id删除某一 VLAN.Step 3end退出Step 4show vlan brief验证Step 5copy running-config startup config保存也可用vlan database 进入VLAN配置状态,用no vlan vlan-id 来删除。将端口分配给一个 VLAN命令目的Step 1configure terminal进入配置状态S

31、tep 2interface interface-id进入要分配的端口Step 3switchport mode access定义二层口Step 4switchport access vlanvlan-id把端口分配给某一 VLANStep 5end退出Step 6show running-config interface interface-id验证端口的VLANStep 7show interfaces interface-id switchport验证端口的管理模式和VLAN情况Step 8copy running-config startup-config保存配置使用default i

32、nterface interface-id还原到缺省配置状态。举例如下:Switch# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface fastethernet0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2Switch(config-if)#Switch#end配置 VLAN Trunks命令目的Step 1conf

33、igure terminal进入配置状态Step 2interface interface-id进入端口配置状态Step 3switchport mode dynamic (auto | desirable | trunk 配置一层trunk模式。 dynamic auto自动协商是否成为 trunk dynamic desirable一把端口设置为trunk如果对方端口是trunk,desirable,或自动模式 trunk 设置端口为强制的trunk方式,而不理会对方端口是否为 trunkStep 4switchport access vlan vlan-id(可选)指定一个缺省VLAN,

34、如果此 端口、冉是trunkStep 5switchport trunk native vlan vlan-id指定 802.1Q native VLAN 号Step 6end退出Step 7show interfacesinterface-id switchport显小有关switchport 的配置Step 8show interfaces interface-id trunk显小有关trunk的配置Step 9copy running-config startup-config保存配置举例:Switch# configure terminalinterface fastethernet0

35、/4Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#Switch(config-if)#switchport mode trunkSwitch(config-if)#end定义trunk允许的VLAN缺省情况下trunk允许所有的VLANffi过。可以使用 switchport trunk allowed vlan remove vlan-list 来去掉某一 VLANCommandPurposeStep 1configure terminal进入配置状态Step 2interface in

36、terface-id进入端口配置Step 3switchport mode trunk配置二层口为trunkStep 4switchport trunk allowed vlan add |all | except | remove vlan-list(可选)配置trunk允 许的VLAN.使用 add, all , except, remove 关健字Step 5end退出Step 6show interfaces interface-id switchport验证VLAN0己置情况.Step 7copy running-config startup-config保存配置回到允许所有 VLA

37、N®过时,可用no switchport trunk allowed vlan 端口配 置命令.举例如下:Switch(config)# interface fastethernet0/1Switch(config-if)#switchport trunk allowed vlan remove 2Switch(config-if)#end配置 Native VLAN (802.1q)封装802.1q的trunk端口可以接受带有标签和不带标签的数据流,交换机向 native vlan传送不带标签的数据流,缺省情况下native VLAN是1。命令目的Step 1configure t

38、erminal进入配置状态Step 2interface interface-id进入配置成802.1qtrunk的端口Step 3switchport trunk native vlan vlan-id配置 native VLAN 号Step 4end退出Step 5show interfaces interface-id switchport验证native VLAN配置Step 6copy running-config startup-config保存配置使用no switchport trunk native vlan端口配置命令回到缺省的状态使用STP实现负载均衡负载均衡可以使用流量

39、分流到其它平行的 trunks上去.交换机为了避免环路, STP通常是阻断所有端口交换机之间只留一条链路。使用负载均衡后,可以把不同VLAN的流量分配到不同的trunk上。可以通过配置ST哪口权值STP路径值来实现负载均衡.如果使用ST哪口权值 来配置那么二条负载均衡的trunk必须联同一交换机上。使用路径值则即可以联 相同的交换机与可以联不同的交换机。使用STP端口权值的负载均衡当同一台交换机的二个口形成环路时, STP端口权值用来决定那个口是 enable 的,那个口是阻断的。 可以通过配置端口权值来决定二对 trunk各走那些VLAN, 有较高权值的端口(数字较小的)vlan,将处丁转发

40、状态,同一个 VLANft另一 个trunk有较低的权值(数字较大)则将处在阻断状态。 即同一 VLAN只在一个 trunk上发送接受。基于端口权值的负载均衡示意图trunkl将发送和接收VLAN& 10的数据,trunk2将发送和接收VLANJ 6的数据Stwilch 1Ihjrik 1 VLANs 010 (pnority 10) VLAN53- 6 (priority 128JSwitch 2VLANs 3-8 (pnorily IQ) VLANs 8- lOfprionty配置如下:CommandPurposeStep 1configure terminal进入Switch 1

41、配置状态Step 2vtp domain domain-name配置VTP®Step 3vtp server将 Switch 1 配置成 VTP server.Step 4end退出Step 5show vtp status验证VTP的配置Step 6show vlan验证VLANStep 7configure terminal进入配置状态Step 8interface fastethernet 0/1进入F0/1端口Step 9switchport mode trunk配置成trunk端口Step 10end退出Step 11show interfacesfastethernet0

42、/1 switchport验证VLAN®置Step 12在switch1上的F0/2上重复7到 11步骤Step 13在 Switch 2 的 F0/1,F0/2 上重复7到11步骤。Step 14show vlan当trunk已经起来,在switch2上验证已经学到相关的vlan配置Step 15configure terminal在Switch 1上进入配置状态Step 16interface fastethernet0/1进入要配置的端口Step 17spanning-tree vlan 8 port-priority 10将端口权值10赋与VLAN 8.Step 18spanning-tree vlan 9 port-priority 10将端口权值10赋与VLAN 9.Step 19spanning-tree vlan 10 port-priority 10将端口权值10

温馨提示

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

评论

0/150

提交评论