1. 升级前准备工作
网络设备升级前需要进行充分的准备工作,包括设备评估、版本规划、风险评估等。更多学习教程www.fgedu.net.cn
$ ssh admin@switch01
switch01# show version
Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 12.2(55)SE10, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Fri 03-Jan-14 14:53 by prod_rel_team
ROM: Bootstrap program is C3560 boot loader
BOOTLDR: C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(44)SE5, RELEASE SOFTWARE (fc1)
switch01 uptime is 1 year, 23 weeks, 4 days, 18 hours, 30 minutes
System returned to ROM by power-on
System restarted at 15:30:45 CST Thu Mar 28 2024
System image file is “flash:/c3560-ipservicesk9-mz.122-55.SE10/c3560-ipservicesk9-mz.122-55.SE10.bin”
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
compliance with U.S. and local country laws, return this product
immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/
If you require further assistance please contact us by sending email to
export@cisco.com.
License Level: ipservices
License Type: Permanent
Next reload license Level: ipservices
cisco WS-C3560-24PS (PowerPC405) processor (revision B0) with 131072K bytes of memory.
Processor board ID FOC12345678
Last reset from power-on
24 FastEthernet/IEEE 802.3 interface(s)
2 Gigabit Ethernet/IEEE 802.3 interface(s)
32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address : 00:11:22:33:44:55
Motherboard assembly number : 73-9822-15
Power supply part number : 341-0097-02
Motherboard serial number : FOC12345678
Power supply serial number : DTN12345678
Model revision number : B0
Motherboard revision number : B0
Model number : WS-C3560-24PS
System serial number : FOC12345678
switch01# show hardware
Switch# Ports Model Serial No. MAC Address Hw Ver. Sw Ver.
—— —– —– ———- ———– ——- ——-
1 26 WS-C3560-24PS FOC12345678 00:11:22:33:44:55 B0 12.2(55)SE10
# 检查设备内存使用情况
switch01# show memory statistics
Memory usage for Process: 25895224 bytes
buffers: 1147616 bytes, 1007 buffers
Processor Pool Total: 134217728 bytes
Used: 36459008 bytes, Free: 97758720 bytes
I/O Pool Total: 33554432 bytes
Used: 11580768 bytes, Free: 21973664 bytes
Driver text: 0x10000000 – 0x106B2FFF
Driver data: 0x106B3000 – 0x108E0FFF
Processor text: 0x20000000 – 0x20B73FFF
Processor data: 0x20B74000 – 0x20E17FFF
Processor BSS: 0x20E18000 – 0x211B7FFF
PCI IO: 0x80000000 – 0x807FFFFF
IO (physical): 0x40000000 – 0x41FFFFFF
Flash: 0x50000000 – 0x53FFFFFF
NVRAM: 0x54000000 – 0x5400FFFF
Bootflash: 0x58000000 – 0x5BFFFFFF
2. 升级方案设计
升级方案设计需要考虑升级时间、升级顺序、回滚策略等因素,确保升级过程对业务影响最小。学习交流加群风哥微信: itpux-com
$ cat > upgrade-plan.sh << 'EOF' #!/bin/bash # 网络设备升级计划 # 1. 升级前准备 # - 备份当前配置 # - 下载新版本固件 # - 验证固件完整性 # - 制定回滚计划 # 2. 升级顺序 # - 核心交换机 # - 汇聚交换机 # - 接入交换机 # - 路由器 # - 防火墙 # 3. 升级时间窗口 # - 非业务高峰期 # - 周末凌晨2:00-6:00 # 4. 回滚策略 # - 保留原版本固件 # - 备份配置文件 # - 制定回滚步骤 EOF $ chmod +x upgrade-plan.sh $ ./upgrade-plan.sh
$ wget http://192.168.1.100/firmware/c3560-ipservicesk9-mz.122-55.SE12.bin
$ md5sum c3560-ipservicesk9-mz.122-55.SE12.bin
2a3b4c5d6e7f8g9h0i1j2k3l4m5n6o7p c3560-ipservicesk9-mz.122-55.SE12.bin
# 上传固件到设备
$ scp c3560-ipservicesk9-mz.122-55.SE12.bin admin@switch01:flash:
3. 升级执行步骤
升级执行步骤需要严格按照计划进行,包括备份配置、上传固件、执行升级等操作。
switch01# copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK] 4194 bytes copied in 0.920 secs
# 备份配置到TFTP服务器
switch01# copy running-config tftp:
Address or name of remote host []? 192.168.1.100
Destination filename [switch01-confg]? switch01-config-20260403
!!
4194 bytes copied in 1.234 secs
# 检查闪存空间
switch01# show flash:
Directory of flash:/
2 -rw- 15892480 Mar 28 2024 15:30:45 +08:00 c3560-ipservicesk9-mz.122-55.SE10.bin
3 -rw- 4194 Mar 28 2024 15:31:22 +08:00 config.text
4 -rw- 4194 Mar 28 2024 15:31:22 +08:00 private-config.text
126976K bytes total (111360K bytes free)
# 验证新固件
switch01# verify /md5 flash:c3560-ipservicesk9-mz.122-55.SE12.bin
verify /md5 (flash:c3560-ipservicesk9-mz.122-55.SE12.bin) = 2a3b4c5d6e7f8g9h0i1j2k3l4m5n6o7p
# 设置启动映像
switch01# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch01(config)# boot system flash:c3560-ipservicesk9-mz.122-55.SE12.bin
switch01(config)# exit
# 保存配置
switch01# write memory
Building configuration…
[OK]
# 重启设备
switch01# reload
Proceed with reload? [confirm]
switch01# show version
Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 12.2(55)SE12, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Fri 03-Jan-14 14:53 by prod_rel_team
ROM: Bootstrap program is C3560 boot loader
BOOTLDR: C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(44)SE5, RELEASE SOFTWARE (fc1)
switch01 uptime is 10 minutes
System returned to ROM by reload
System restarted at 02:15:30 CST Thu Apr 3 2026
System image file is “flash:/c3560-ipservicesk9-mz.122-55.SE12.bin”
# 检查配置
switch01# show running-config | include boot system
boot system flash:c3560-ipservicesk9-mz.122-55.SE12.bin
4. 网络设备迁移策略
网络设备迁移需要考虑网络拓扑变更、IP地址规划、路由配置等因素,确保迁移过程平滑过渡。学习交流加群风哥QQ113257174
$ ssh admin@core-switch
core-switch# show running-config > migration-backup.txt
# 新设备预配置
$ ssh admin@new-core-switch
new-core-switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
new-core-switch(config)# hostname new-core
new-core(config)# interface range GigabitEthernet1/0/1-24
new-core(config-if-range)# switchport mode trunk
new-core(config-if-range)# switchport trunk allowed vlan all
new-core(config-if-range)# exit
new-core(config)# interface Vlan1
new-core(config-if)# ip address 192.168.1.1 255.255.255.0
new-core(config-if)# no shutdown
new-core(config-if)# exit
new-core(config)# router ospf 1
new-core(config-router)# network 192.168.1.0 0.0.0.255 area 0
new-core(config-router)# exit
new-core(config)# exit
new-core# write memory
# 1. 连接新设备到网络
# 2. 同步配置
# 3. 验证新设备功能
# 4. 切换流量到新设备
# 5. 监控网络状态
# 流量切换命令
core-switch# configure terminal
core-switch(config)# interface GigabitEthernet1/0/1
core-switch(config-if)# shutdown
core-switch(config-if)# exit
core-switch(config)# exit
# 验证新设备流量
new-core# show interface GigabitEthernet1/0/1
GigabitEthernet1/0/1 is up, line protocol is up (connected)
Hardware is Gigabit Ethernet, address is 0011.2233.4455 (bia 0011.2233.4455)
Description: Uplink to Distribution Switch
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 1000Mb/s, media type is 1000BaseLX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:05, output 00:00:01, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 10000 bits/sec, 10 packets/sec
5 minute output rate 15000 bits/sec, 12 packets/sec
1000 packets input, 100000 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 0 multicast, 0 pause input
1200 packets output, 120000 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 pause output
0 output buffer failures, 0 output buffers swapped out
5. 回滚方案
回滚方案是升级和迁移过程中的重要保障,当出现问题时可以快速恢复到之前的状态。
switch01# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch01(config)# boot system flash:c3560-ipservicesk9-mz.122-55.SE10.bin
switch01(config)# exit
switch01# write memory
Building configuration…
[OK]
# 回滚重启
switch01# reload
Proceed with reload? [confirm]
# 回滚后验证
switch01# show version
Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 12.2(55)SE10, RELEASE SOFTWARE (fc1)
6. 测试与验证
升级和迁移后需要进行全面的测试和验证,确保网络设备正常运行。更多学习教程公众号风哥教程itpux_com
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=0.567 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=0.456 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=0.432 ms
— 192.168.1.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.432/0.485/0.567/0.062 ms
# 路由测试
$ traceroute 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops max, 60 byte packets
1 192.168.1.1 (192.168.1.1) 0.567 ms 0.456 ms 0.432 ms
2 192.168.1.254 (192.168.1.254) 1.234 ms 1.123 ms 1.098 ms
3 192.168.2.1 (192.168.2.1) 2.345 ms 2.234 ms 2.123 ms
# 端口状态检查
switch01# show interface status
Port Name Status Vlan Duplex Speed Type
Gi1/0/1 connected 1 a-full a-1000 10/100/1000BaseTX
Gi1/0/2 connected 1 a-full a-1000 10/100/1000BaseTX
Gi1/0/3 connected 10 a-full a-1000 10/100/1000BaseTX
Gi1/0/4 connected 10 a-full a-1000 10/100/1000BaseTX
$ iperf3 -c 192.168.1.1 -t 10
Connecting to host 192.168.1.1, port 5201
[ 5] local 192.168.1.100 port 50000 connected to 192.168.1.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 2.00-3.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 7.00-8.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 939 Mbits/sec 0 320 KBytes
– – – – – – – – – – – – – – – – – – – – – – – – –
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 939 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 939 Mbits/sec receiver
iperf Done.
7. 最佳实践
网络设备升级与迁移的最佳实践包括:
- 制定详细的升级计划和回滚方案
- 选择合适的升级时间窗口
- 充分备份配置和固件
- 验证新版本的兼容性
- 分阶段执行升级和迁移
- 升级后进行全面测试
- 监控设备运行状态
- 记录升级过程和结果
$ ssh admin@switch01
switch01# show process cpu history
111111111122222222223333333333444444444455555555556666666666777777777788
2345678901234567890123456789012345678901234567890123456789012345678901
Load Average
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*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