一、堆叠基础概念
(一)堆叠优势
-
统一管理多个交换机:通过堆叠,可以将多个物理交换机当作一个逻辑设备进行管理,大大简化了管理复杂性。
-
增加端口密度:堆叠多个交换机可以快速扩展端口数量,满足大规模网络环境的需求。
-
提供冗余和高可用性:堆叠中的主交换机故障时,可以自动切换到备用交换机,确保网络的高可用性。
-
简化网络拓扑:堆叠减少了网络中的设备数量,使网络拓扑更加清晰。
(二)支持堆叠的交换机系列
-
Catalyst 2960-X/XR 系列
-
Catalyst 3560-X 系列
-
Catalyst 3750/3750-E 系列
-
Catalyst 3850/9300 系列
-
Nexus 3000 系列等
二、堆叠配置步骤
(一)物理连接
使用专用堆叠电缆连接交换机,通常标记为StackPort 1和StackPort 2。连接方式为:
-
主交换机StackPort 1 → 从交换机 StackPort 2
-
主交换机StackPort 2 → 从交换机 StackPort 1
(二)基本堆叠配置
1. 配置主交换机
Switch> enable
Switch# configure terminal
Switch(config)# switch 1 renumber 1
Switch(config)# switch 1 priority 150
Switch(config)# interface stack-port 1/1
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface stack-port 1/2
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# end
Switch# copy running-config startup-config
2. 配置从交换机
Switch> enable
Switch# configure terminal
Switch(config)# switch 1 renumber 2
Switch(config)# switch 2 priority 100
Switch(config)# interface stack-port 2/1
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface stack-port 2/2
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# end
Switch# copy running-config startup-config
(三)高级堆叠配置
1. 配置堆叠环网(3台以上交换机)
Switch(config)# switch 1 priority 150
Switch(config)# switch 2 priority 120
Switch(config)# switch 3 priority 100
Switch# show switch stack-ring
2. 配置堆叠带宽
Switch# show switch stack-port summary
Switch(config)# interface stack-port 1/1
Switch(config-if)# stack-port speed 10g
三、堆叠验证命令
(一)基本信息查看
Switch# show switch
Switch# show switch detail
Switch# show switch stack-port summary
Switch# show switch stack-port [member-id]
Switch# show switch stack-ring
(二)详细状态检查
Switch# show version | include Switch
Switch# show switch mac
Switch# show switch neighbors
Switch# show switch stack-port statistics
四、堆叠删除操作
(一)安全删除堆叠成员
1. 从堆叠中移除特定成员
Switch# show switch
Switch# switch [member-id] provision
Switch# switch [member-id] ready
# 断开堆叠电缆连接
Switch# reload slot [member-id]
2. 重置交换机为独立模式
Switch# configure terminal
Switch(config)# no switch [member-id] stack
Switch(config)# switch [current-id] renumber [new-id]
Switch(config)# switch [member-id] priority 1
Switch(config)# end
Switch# copy running-config startup-config
Switch# reload
(二)完全拆除堆叠
1. 逐个分离
Switch# copy running-config tftp:
Switch# show switch
Switch# switch [member-id] priority 200
Switch# switch [remove-id] provision
# 物理断开连接
Switch# reload slot [remaining-id]
2. 完全重置
Switch# delete flash:config.text
Switch# erase startup-config
Switch# reload
# 或者使用
Switch# write erase
Switch# reload
五、堆叠故障排除
(一)常见问题诊断
Switch# show switch stack-port summary
Switch# show switch stack-port [member-id] neighbors
Switch# show interfaces stack-port [member-id]/[port-id]
Switch# show switch stack-ring redundancy
Switch# show version | include "Cisco IOS"
(二)堆叠端口故障处理
Switch# configure terminal
Switch(config)# interface stack-port [member-id]/[port-id]
Switch(config-if)# shutdown
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch# clear switch stack-port statistics
Switch# switch [member-id] priority [new-priority]
六、最佳实践配置
(一)推荐配置模板
Switch# configure terminal
Switch(config)# hostname Stack-Master
Switch(config)# switch 1 priority 150
Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config)# switch 2 priority 120
Switch(config)# switch 3 priority 100
Switch(config)# end
Switch# copy running-config startup-config
(二)堆叠监控配置
Switch(config)# logging trap notifications
Switch(config)# logging facility local0
Switch(config)# snmp-server community public RO
Switch(config)# snmp-server host [ip-address] public
Switch(config)# event manager applet Stack-Down
Switch(config-applet)# event track 1 state down
Switch(config-applet)# action 1.0 syslog msg "Stack member down"
七、不同系列特殊配置
(一)3750系列堆叠
Switch# show switch stackwise
Switch(config)# stackwise bandwidth 32g
Switch(config)# stackwise bandwidth 64g
(二)3850/9300系列堆叠
Switch# show switch stackwise-320
Switch(config)# switch 1 provision ws-c3850-24t
Switch(config)# switch 2 provision ws-c3850-24t
八、维护命令
(一)日常维护
Switch# show switch
Switch# show switch stack-port summary
Switch# show switch stack-port statistics
Switch# copy running-config tftp:
(二)性能优化
Switch(config)# switch [member-id] priority [priority-value]
Switch(config)# stack-mac persistent timer 0
Switch# show switch stack-port summary
注意事项
-
物理连接:确保使用正确的堆叠电缆。
-
版本兼容:所有成员必须使用相同IOS版本。
-
优先级设置:合理设置主交换机优先级。
-
备份配置:操作前务必备份现有配置。
-
电源管理:确保所有成员电源稳定。
-
环境要求:注意散热和空间要求。
通过以上步骤和注意事项,您可以高效地完成Cisco交换机的堆叠配置、验证、删除以及故障排除。希望这篇文章能帮助您更好地管理和优化您的网络环境!
发表回复