一、堆叠端口状态验证
(一)基础堆叠信息查看
查看堆叠成员信息:
Switch# show switch
Switch# show switch detail
示例输出:
Switch/Stack Mac Address :001a.2b3c.4d5e-LocalMac Address
Mac persistency waittime: Indefinite
H/WCurrent
Switch# Role Mac Address Priority Version State
----------------------------------------------------------
*1Master001a.2b3c.4d5e 150 3 Ready
2 Member001b.2c3d.4e5f 120 3 Ready
3 Member001c.2d3e.4f5a 100 3 Ready
(二)堆叠端口详细状态
查看堆叠端口摘要:
Switch# show switch stack-port summary
示例输出:
Switch# Port 1 Port 2
------------------------
1Ok Ok
2Ok Ok
3Ok Ok
查看特定成员的堆叠端口:
Switch# show switch stack-port 1
Switch# show switch stack-port 2
Switch# show switch stack-port 3
(三)堆叠拓扑验证
查看堆叠环网状态:
Switch# show switch stack-ring
查看堆叠邻居关系:
Switch# show switch neighbors
查看堆叠链路状态:
Switch# show switch stack-link
二、普通端口状态验证
(一)所有端口状态概览
查看所有接口状态:
Switch# show interfaces status
示例输出:
PortName Status Vlan Duplex Speed Type
Gi1/0/1connected 1 a-full a-10010/100/1000BaseTX
Gi1/0/2notconnect 1 auto auto10/100/1000BaseTX
Gi2/0/1connected 1 a-full a-10010/100/1000BaseTX
Gi3/0/1err-disabled1 a-full a-10010/100/1000BaseTX
(二)按成员查看端口
查看特定成员的端口状态:
Switch# show interfaces status | include Gi1/
Switch# show interfaces status | include Gi2/
Switch# show interfaces status | include Gi3/
查看特定端口详细信息:
Switch# show interfaces gigabitEthernet1/0/1status
Switch# show interfaces gigabitEthernet2/0/1status
(三)端口连接状态详细检查
查看端口详细信息:
Switch# show interfaces gigabitEthernet1/0/1
Switch# show interfaces gigabitEthernet1/0/1switchport
查看端口错误统计:
Switch# show interfaces gigabitEthernet1/0/1| include error
Switch# show interfaces gigabitEthernet1/0/1| include CRC
三、VLAN和端口配置验证
(一)VLAN状态检查
查看VLAN信息:
Switch# show vlan brief
查看特定VLAN的端口成员:
id[vlan-id] show vlan
查看端口VLAN分配:
Switch# show interfaces status | include connected
(二)端口VLAN配置验证
查看端口VLAN配置:
Switch# show interfaces gigabitEthernet1/0/1switchport
Switch# show interfaces gigabitEthernet2/0/1switchport
查看Trunk端口配置:
Switch# show interfaces trunk
四、性能和统计信息验证
(一)端口流量统计
查看端口统计信息:
Switch# show interfaces gigabitEthernet1/0/1| include rate
Switch# show interfaces gigabitEthernet1/0/1| include packets
查看端口利用率:
Switch# show interfaces gigabitEthernet1/0/1| include input|output
清除统计计数器(用于测试):
Switch# clear counters gigabitEthernet1/0/1
(二)堆叠性能统计
查看堆叠端口统计:
Switch# show switch stack-port statistics
查看堆叠带宽使用:
Switch# show switch stack-port bandwidth
查看堆叠延迟:
Switch# show switch stack-port delay
五、故障状态识别
(一)错误端口识别
查看错误禁用端口:
Switch# show interfaces status err-disabled
查看所有非连接端口:
Switch# show interfaces status | include notconnect
查看端口错误信息:
Switch# show interfaces status | include err
(二)端口详细错误检查
查看端口错误详细信息:
Switch# show interfaces gigabitEthernet1/0/1| include error|crc|collision
查看端口日志:
Switch# show logging | include Gi1/0/1
查看端口事件历史:
Switch# show interfaces gigabitEthernet1/0/1| include Last
六、实时监控命令
(一)实时端口状态监控
实时监控端口状态变化:
Switch# show interfaces status | begin [port-name]
持续监控(按Ctrl+C退出):
Switch# terminal monitor
Switch# show interfaces status refresh 5
(二)端口速率监控
查看端口输入输出速率:
Switch# show interfaces gigabitEthernet1/0/1| include bits
查看端口利用率:
Switch# show interfaces gigabitEthernet1/0/1| include load
查看端口队列统计:
Switch# show interfaces gigabitEthernet1/0/1| include queue
七、高级验证命令
(一)端口安全验证
查看端口安全配置:
Switch# show port-security interface gigabitEthernet1/0/1
查看安全地址表:
Switch# show port-security address
查看违规统计:
Switch
(二)端口通道验证
查看端口通道状态:
Switch# show etherchannel summary
查看端口通道详细信息:
Switch# show etherchannel 1 detail
查看端口通道负载均衡:
Switch# show etherchannel load-balance
(三)QoS配置验证
查看端口QoS配置:
Switch# show mls qos interface gigabitEthernet1/0/1
查看队列统计:
Switch# show mls qos interface gigabitEthernet1/0/1| include queue
查看流量策略:
Switch# show policy-map interface gigabitEthernet1/0/1
八、诊断和测试命令
(一)端口连通性测试
端口环回测试:
Switch# test cable-diagnostics tdr interface gigabitEthernet1/0/1
查看测试结果:
Switch# show cable-diagnostics tdr interface gigabitEthernet1/0/1
端口自检:
Switch# show interfaces gigabitEthernet1/0/1| include loopback
(二)端口配置一致性检查
比较运行配置和启动配置:
Switch# show archive config differences
查看配置变更历史:
Switch# show archive log config
验证配置同步状态:
Switch
九、监控脚本示例
(一)批量端口状态检查
创建检查脚本:
Switch# show interfaces status | exclude notconnect|err-disabled|disabled
查看活动端口:
Switch# show interfaces status | include connected
统计各状态端口数量:
Switch# show interfaces status | count
(二)定期健康检查
检查关键端口状态:
Switch# show interfaces status | include Gi1/0/1|Gi2/0/1
检查上联端口:
Switch# show interfaces status | include uplink
检查管理端口:
Switch# show interfaces status | include Vlan
十、常见问题排查
(一)端口状态异常处理
端口重新初始化:
Switch# configure terminal
Switch(config)# interface gigabitEthernet 1/0/1
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
清除端口错误状态:
Switch# clear etherchannel counters
Switch# clear counters
(二)堆叠端口问题处理
重置堆叠端口:
Switch# configure terminal
Switch(config)# interface stack-port 1/1
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
查看堆叠端口错误:
Switch
状态标识说明
-
connected:端口正常连接
-
notconnect:端口未连接设备
-
disabled:端口被管理员关闭
-
err-disabled:端口因错误被禁用
-
monitoring:端口处于监控模式
-
channel:端口是端口通道成员
-
suspended:端口通道成员被挂起
通过以上命令,您可以全面验证堆叠配置后交换机的端口状态,确保网络正常运行。希望这篇文章能帮助您更好地管理和优化您的网络环境!
发表回复