思科交换机配置维护手册目录一、端口配置1.1 配置一组端口当使用interface range命令时有如下的规则:•有效的组范围:o vlan从1 到4094o fastethernet槽位/{first port} - {last port}, 槽位为0o gigabitethernet槽位/{first port} - {last port},槽位为0o port-channel port-channel-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 - 5Switch(config-if-range)# no shutdown以下的例子显示使用句号来配置不同类型端口的组:Switch# configure terminalSwitch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2 Switch(config-if-range)# no shutdown1.2 配置二层端口1.2.1 配置端口速率及双工模式Switch# configure terminalSwitch(config)# interface fastethernet0/3 Switch(config-if)# speed 10Switch(config-if)# duplex half1.2.2 端口描述1.2.3 配置三层口Catalyst 3750支持三种类型的三层端口: •SVIs: 即interface vlan•三层以太网通道口(EtherChannel)•.路由口:路由口是指某一物理端口在端口配置状态下用no switchport命令生成的端口所有的三层都需要IP地址以实现路由交换配置步骤如下:配置举例如下:Switch# configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0 Switch(config-if)# no shutdownSwitch(config-if)# endshow ip interface命令:Switch# show ip interface gigabitethernet0/2 GigabitEthernet0/2 is up, line protocol is upInternet address is 192.20.135.21/24Broadcast address is 255.255.255.255Address determined by setup commandMTU is 1500 bytesHelper address is not setDirected broadcast forwarding is disabled<output truncated>1.3 监控及维护端口1.3.1 监控端口和控制器的状态主要命令见下表:举例如下:Switch# show interfaces statusPort Name Status Vlan Duplex Speed TypeGi0/1 connected routed a-full a-100 10/100/1000Base TXGi0/2 wce server 20.20.2 disabled routed auto auto 10/100/1000Base TX Gi0/3 ip wccp web-cache notconnect routed auto auto 10/100/1000Base TX Gi0/4 notconnect routed auto auto 10/100/1000Base TX Gi0/5 notconnect routed auto auto 10/100/1000Base TX Gi0/6 disabled routed auto auto 10/100/1000Base TX Gi0/7 disabled routed auto auto 10/100/1000Base TX Gi0/8 disabled routed auto 100 10/100/1000Base TX Gi0/9 notconnect routed auto auto 10/100/1000Base TX Gi0/10 notconnect routed auto auto 10/100/1000Base TX Gi0/11 disabled routed auto auto unknownGi0/12 notconnect routed auto auto unknownSwitch# show interfaces fastethernet 0/1 switchportName: Fa0/1Switchport: EnabledAdministrative Mode: static accessOperational Mode: downAdministrative Trunking Encapsulation: dot1qNegotiation of 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 interface fastethernet0/2Building configuration...Current configuration : 131 bytes!interface FastEthernet0/2switchport mode accessswitchport protectedno ip addressmls qos cos 7mls qos cos overrideend1.3.2 刷新、重置端口及计数器Clear命令目的clear counters [interface-id] 清除端口计数器.clear interface interface-id重置某一端口的硬件逻辑clear line [number | console 0 | vty number] 重置异步串口的硬件逻辑Note clear counters 命令只清除用show interface所显示的计数,不影响用snmp得到的计数举例如下:Switch# clear counters fastethernet0/5Clear "show interface" counters on this interface [confirm] ySwitch#*Sep 30 08:42:55: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet0/5by vty1 (171.69.115.10)可使用clear interface或clear line命令来清除或重置某一端口或串口,在大部分情况下并不需要这样做:Switch# clear interface fastethernet0/51.3.3 关闭和打开端口使用no shutdown命令重新打开端口.举例如下:Switch# configure 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 shutdownSwitch(config-if)#*Sep 30 08:36:00: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to up二、配置VLAN2.1 VLAN论述一个VLAN就是一个交换网,其逻辑上按功能、项目、应用来分而不必考虑用户的物理位置。
任何交换口都可以属于某一VLAN, IP包、广播包及组播包均可以发送或广播给在此VLAN内的最终用户。
每一个VLAN均可看成是一个逻辑网络,发往另一VLAN的数据包必须由路由器或网桥转发(如下图)。
由于VLAN被看成是一个逻辑网络,其具有自己的网桥管理信息庫(MIB) 并可支持自己的生成树VLAN作为逻辑定义的网络示意图VLAN常常与IP子网相联系,同一IP子网属于同一VLAN。
在3550上VLAN之间的数据包可以由VLAN端口进行转发。
可支持的VLANCatalyst 3750交换机支持1005个 VLAN,可以分别是VTP client, server, 及transparent modes. VLAN号可以从1到4094. VLAN号1002到1005保留给令牌环及FDDI VLAN. VTP只能学习到普通范围的VLAN, 即从VLAN到1到1005; VLAN号大于1005属于扩展VLAN,不存在VLAN数据庫中。