4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

備忘録:Cisco機器のIOSのバックアップ方法

Posted at

Cisco機器のIOSをバックアップする(いわゆる吸い出し)

概要

IOSが壊れてしまったときや、GNS3でのエミュレートに使用するためIOSのバックアップをとっておこうと思いました。(壊れることあるのか・・・?と思うけど、噂では"あるらしい")
まだまだ初心者なので一つ一つ備忘録として残していきます。誰かの役にも立てると良いな。

今回の使用機材

  • PC・・・私の場合はWindows環境です。IPアドレスは"192.168.1.50"にしております。
  • TFTPサーバーソフトウェア・・・使いやすいものを選んでください。使える状態にしておきます。今回はSolarWinds TFTP Serverを使わせていただきました。
  • Cisco Catalyst 3750X-48T-L・・・どこの誤家庭にもあるCisco製品の一つ。長いのでスイッチと呼びます。
  • RTX1200・・・割とどこの誤家庭にもあるYAMAHAルーター。なくても良いですが、私はDHCP配布で楽をするためにいつも使っているLAN環境下で行いました。
  • LANケーブル(Copper,UTP,CAT.5e~)・・・PCとルーター、ルーターとスイッチを繋ぐために使用します。

やり方

調べると"適当にTFTPサーバー立ててコピーすればいいよ"と書いてあって、試してみたら"本当にそのとおりだった"
スイッチのFlashからTFTP先にIOSをコピーするイメージです。

PCでTFTPサーバーを起動します。(ファイアウォールなど気をつける)
image.png

ロールオーバーケーブルを接続しCisco機器を起動して、CLIにアクセスする。
image.png

Configを削除したため、"Would you like to enter the initial configuration dialog? [yes/no]:"と訊かれるが、"no"とする。
image.png
ユーザーモードから特権モードに変更し、グローバルコンフィギュレーションモードに変更

Would you like to enter the initial configuration dialog? [yes/no]:no
Switch>ena
Switch#conf t

まっさらな状態なので、インターフェースコンフィギュレーションモードに入り、デフォルトVLAN(VLAN1)にIPアドレスを入力します。ここでは簡単にするために既にあるルーターからDHCPにてIPアドレス情報を取得します。また、インターフェースを有効化し、グローバルコンフィギュレーションモードに戻ります。このデフォルトVLANに設定したIPアドレスで通信を行います。

Switch(config)#int vlan1
Switch(config-if)#ip add
Switch(config-if)#ip address dhcp
Switch(config-if)#no shutdown
Switch(config-if)#end
Switch#

ルーターから伸ばしたLANケーブルを繋ぎます。

*Mar  1 00:17:27.569: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/48, changed state to up
*Mar  1 00:17:28.575: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/48, changed state to up
*Mar  1 00:17:55.604: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
*Mar  1 00:18:03.791: %DHCP-6-ADDRESS_ASSIGN: Interface Vlan1 assigned DHCP address 192.168.1.15, mask 255.255.255.0, hostname

物理インターフェースも理論インターフェースも無事UPしたログが表示されました。DHCPで"192.168.1.15"を取得したようです。
念の為show interface vlan1をします。

Switch#show interfaces vlan 1
Vlan1 is up, line protocol is up
  Hardware is EtherSVI, address is 6073.5c6f.e3c0 (bia 6073.5c6f.e3c0)
  Internet address is 192.168.1.15/24
  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 not supported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, 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 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     201 packets input, 14644 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
     43 packets output, 3571 bytes, 0 underruns
     0 output errors, 2 interface resets
     0 unknown protocol drops
     0 output buffer failures, 0 output buffers swapped out
Switch#

問題ないようです。
続いて、IOSのコピーをします。
copyコマンドでflashにあるIOSをtftpにコピーします。
コマンドが長いので実際には"Switch#$versalk9-mz.150-1.SE3/c3750e-universalk9-mz.150-1.SE3.bin tftp:"と省略されます。
Address or name of remote host []?と訊かれたらPCのIPアドレス"192.168.1.50"を入力します。
Destination filename [c3750e-universalk9-mz.150-1.SE3.bin]?と訊かれるのですが、特にファイル名を変える必要がなければそのままEnterを押します。

Switch#copy flash:c3750e-universalk9-mz.150-1.SE3/c3750e-universalk9-mz.150-1.SE3.bin tftp:
Address or name of remote host []? 192.168.1.50
Destination filename [c3750e-universalk9-mz.150-1.SE3.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18591722 bytes copied in 72.133 secs (257742 bytes/sec)
Switch#

TFTPサーバー側でも開始と完了のログが残っており、実際のディレクトリにも保存されていました。
image.png
これでバックアップは完了です。おつかれさまでした。

ルーター無しで直接スイッチとPCを繋げる場合は、それぞれ通信できるようIPアドレスの設定が必要です。
例えばVLAN1に対して192.168.1.12を割り当てる場合、

Switch(config-if)#ip address DHCP

としていたところを

Switch(config-if)#ip address 192.168.1.12 255.255.255.0

と入力します。

(理解不足)IOSについて

今回吸い出したIOSは"c3750e-universalk9-mz.150-1.SE3.bin"
調べてみると、バージョンは15.0(1)SE3です。
命名規則から、トレイン=15.0SE、スロットル15.0(1)SE、リビルド=3となるようです。
IOS名からリリースノートを確認すると、
image.png
らしいです。
Release Notes for Catalyst 3750-X, 3750-E, 3560-X, and 3560-E Switches, Cisco IOS Release 15.0(1)SE and Later

要するに"暗号化使えて割と何でもそつなくできるIOSですよ"ってことなのかな・・・。
もうちょっと勉強しよ・・・。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?