作業環境
- 対象機器:WS-C2960X-24TS-L
- 作業前バージョン:15.2(4)E4
- 作業後バージョン:15.2(4)E7
作業手順
- TFTPサーバの用意とサーバ側へOSファイルをダウンロード
- スイッチ側で容量を確認
- サーバ – スイッチ間で疎通確認し、ファイルを転送
- BOOT path-listを新しいOSファイルで指定し、再起動
- バージョン確認と不要ファイル削除
TFTPサーバの用意とサーバ側へOSファイルをダウンロード
まずTFTPサーバを用意します。対象のスイッチと疎通の取れるサーバがある場合は、そちらへOSファイルを入れていただければ良いです。
ない場合は自身のPCをサーバ代わりにすればいいので、
https://software.cisco.com/download/home
こちらにログインし、対象OSファイルをPCへダウンロードしてください。
次にTFTPを使用できるソフト(今回は3CDaemon)をインストールします。※セットアップは割愛。
ソフト内で新OSファイルのあるディレクトリを指定するだけでOKです。
スイッチ側で容量を確認
事前に対象機器で容量の確認をします。
- show flash:
Switch#sh flash:
Directory of flash:/
3 -rwx 676 Apr 13 2000 20:52:04 +09:00 vlan.dat
4 drwx 512 Jul 21 2017 17:23:34 +09:00 c2960x-universalk9-mz.152-4.E4
692 drwx 512 Jul 21 2017 17:23:35 +09:00 dc_profile_dir
694 -rwx 5 Apr 13 2000 20:46:48 +09:00 private-config.text
697 -rwx 2072 Apr 13 2000 20:52:10 +09:00 multiple-fs
696 -rwx 4102 Apr 13 2000 20:46:47 +09:00 config.text
122185728 bytes total (91321856 bytes free)
今回のスイッチは約1.22GB空き容量があるので問題なさそうです。
サーバ – スイッチ間で疎通確認し、ファイルを転送
今回はスイッチと疎通の取れるサーバがある場合と、PCから転送する場合の二つを解説します。
スイッチと疎通の取れるサーバがある場合
事前の段階でサーバへOSファイルをダウンロードしていただいたので、スイッチ側でSCPで転送するコマンドを打ちます。
- copy scp://(ユーザー名)@(サーバIP)/(新OSファイルのあるディレクトリ) flash:
switch#copy scp://admin@10.1.1.1//home/c2960x-universalk9-mz.152-7.E7.bin flash: Destination filename [c2960x-universalk9-mz.152-7.E7.bin]? Password: Sending file modes: …… !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 505827585 bytes] 505827585 bytes copied in 970.894 secs (829985 bytes/sec)
転送した新OSファイルがあることを確認します。
- show flash:
switch#show flash: 略 -#- --length-- ---------date/time--------- path 略 2 -rwx 26788864 Apr 13 2000 21:20:47 +09:00 c2960x-universalk9-mz.152-7.E7.bin 758885120 bytes available (1098552576 bytes used)
PCから転送する場合
LANケーブルでPC-スイッチ間の接続をして疎通が可能になっていることを確認します。
PC側とスイッチ側でアドレスを振った後、pingが通らない場合は
・ファイヤーウォールをオフにする。
・wifiを切る。
・VPNを使用している場合は完全に切断する。
等をやるとうまくいくと思います。
疎通が確認できたらスイッチ側で以下コマンドを実行します。
- copy tftp://(PCのIPアドレス)/(新OSファイル) flash:
switch#copy tftp://10.10.1.1/c2960x-universalk9-mz.152-7.E7.bin flash: Destination filename [c2960x-universalk9-mz.152-7.E7.bin]? Password: Sending file modes: …… !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 505827585 bytes] 505827585 bytes copied in 970.894 secs (829985 bytes/sec)
転送した新OSファイルがあることを確認します。
- show flash:
switch#show flash: 略 -#- --length-- ---------date/time--------- path 略 2 -rwx 26788864 Apr 13 2000 21:20:47 +09:00 c2960x-universalk9-mz.152-7.E7.bin 758885120 bytes available (1098552576 bytes used)
BOOT path-listを新しいOSファイルで指定し、再起動
boot時の内容を下記コマンドで確認します。
- show boot
switch#sh boot
BOOT path-list : flash:/c2960x-universalk9-mz.152-4.E4/c2960x-universalk9-mz.152-4.E4.bin
Config file : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break : yes
Manual Boot : no
Allow Dev Key : yes
HELPER path-list :
Auto upgrade : yes
Auto upgrade path :
Boot optimization : disabled
NVRAM/Config file
buffer size: 524288
Timeout for Config
Download: 0 seconds
Config Download
via DHCP: disabled (next boot: disabled)
BOOT path-listの内容が現在の古いOSを参照しているので設定で書き換えます。
その後コンフィグを保存し、再起動します。
- conf t
- boot system switch all flash:(新OSファイル)
- end
- write memory
- reload
switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#boot system switch all flash:c2960x-universalk9-mz.152-7.E7.bin
switch(config)#end
switch#
switch#sh boot
BOOT path-list : flash:c2960x-universalk9-mz.152-7.E7.bin
Config file : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break : yes
Manual Boot : no
Allow Dev Key : yes
HELPER path-list :
Auto upgrade : yes
Auto upgrade path :
Boot optimization : disabled
NVRAM/Config file
buffer size: 524288
Timeout for Config
Download: 0 seconds
Config Download
via DHCP: disabled (next boot: disabled)
switch#write memory
Building configuration...
[OK]
switch#reload
バージョン確認と不要ファイル削除
再起動後、正常に立ち上がったらバージョンの確認をします。
switch#sh version Cisco IOS Software, C2960X Software (C2960X-UNIVERSALK9-M), Version 15.2(7)E7, RELEASE SOFTWARE (fc10) (略) Switch Ports Model SW Version SW Image ------ ----- ----- ---------- ---------- * 1 30 WS-C2960X-24TS-L 15.2(7)E7 C2960X-UNIVERSALK9-M Configuration register is 0xF
古いバージョンのIOS(ディレクトリとその中身全て)を下記コマンドで削除します。
- delete /force /recursive flash:(旧OSファイル)
switch#sh flash:
Directory of flash:/
2 -rwx 26788864 Apr 13 2000 21:20:47 +09:00 c2960x-universalk9-mz.152-7.E7.bin
3 -rwx 676 Apr 13 2000 21:43:43 +09:00 vlan.dat
4 drwx 512 Jul 21 2017 17:23:34 +09:00 c2960x-universalk9-mz.152-4.E4
692 drwx 512 Jul 21 2017 17:23:35 +09:00 dc_profile_dir
697 -rwx 2072 Apr 13 2000 21:43:49 +09:00 multiple-fs
695 -rwx 4102 Apr 13 2000 21:32:33 +09:00 config.text
696 -rwx 5 Apr 13 2000 21:32:33 +09:00 private-config.text
122185728 bytes total (64316928 bytes free)
switch#$delete /force /recursive flash:c2960x-universalk9-mz.152-4.E4
switch#sh flash:
Directory of flash:/
2 -rwx 26788864 Apr 13 2000 21:20:47 +09:00 c2960x-universalk9-mz.152-7.E7.bin
3 -rwx 676 Apr 13 2000 21:43:43 +09:00 vlan.dat
692 drwx 512 Jul 21 2017 17:23:35 +09:00 dc_profile_dir
697 -rwx 2072 Apr 13 2000 21:43:49 +09:00 multiple-fs
695 -rwx 4102 Apr 13 2000 21:32:33 +09:00 config.text
696 -rwx 5 Apr 13 2000 21:32:33 +09:00 private-config.text
122185728 bytes total (94968832 bytes free)
これでバージョンアップ作業完了になります。


コメント