본문 바로가기

Network

Xmodem Console Download Procedure Using ROMmon

주말 정말 간단한 Cisco 3745 Router 의 IOS Upgrade 작업이 문제가 생기는 바람에 고생 좀 했어요.
정말 간단히 Router 에 TFTP 로 IOS 를 upload 해 주고 boot system 위치를 지정해 주고 reload 해주고 정상적으로 booting 이 되었는지 확인 하고 정상적인 동작을 확인 하면 끝나는 대략 10분 정도의 일이 었는데 문제가 생겨 버린 거죠. ^^

문제는 이 녀석이 정상적으로 부팅이 되지 않아 멈추어 버린 겁니다. 컴퓨터로 얘기하자면 OS 설치하다가 뻑난 거죠 -_-.
ROMmon mode에서 이 녀석의 사용 가능한 devices 들을 확인 할 수 있습니다.

rommon 1 >dev
Devices in device table:
idname
flash:flash
slot0:PCMCIA slot 0
slot1:PCMCIA slot 1
eprom:EPROM
rommon 2 >

여기서 dir flash: 라고 입력 하면 flash 에 올라가 있는 ios 를 확인 할 수 있구요.

rommon 3 >dir flash:
         File size           Checksum   File name
   35823432 bytes (0x804b4c)   0x6ba0    c3745-ipvoice-mz.123-22.bin
rommon 4 >

image가 정상적으로 올라가 있다면 아래와 같이 입력해 주고 제대로 booting 만 된다면 작업은 끝

rommon 5 >boot flash:c3745-ipvoice-mz.123-22.bin
program load complete, entry point: 0x80008000, size: 0x804a30
Self decompressing the image : ###################################
########...

참고 url:
http://cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a008009429f.shtml





하지만 역시 한 번 꼬이기 시작한 일은 절대 쉽게 풀려 주지 않는 법.
올라가 있는 image로는 정상적으로 booting 이 되지 않아 이전 image 로 다시 back out 하기로 했죠.

ROMmon에서 tftp를 이용한 ios download 는 Cisco 3800 only 라는 말에 (Download Using tftpdnld ROMmon command (Cisco 3800 only)) 눈물을 머금고 xmodem 을 이용해 upload 했습니다.

Download a Software Image via TFTP Using the tftpdnld ROMMON Command.(http://cisco.com/en/US/products/hw/routers/ps259/products_tech_note09186a008015bf9e.shtml)





아래와 같은 방법을 이용하면 console 에서 9600bps 가 아닌 115200bps 로 image를 upload 할 수 있습니다.

1.
rommon 2 > confreg
do you wish to change the configuration? y/n [n]:  y
enable  "diagnostic mode"? y/n  [n]: n 
enable  "use net in IP bcast address"? y/n  [n]: n
disable "load rom after netboot fails"? y/n  [n]: n
enable  "use all zero broadcast"? y/n  [n]: n
enable  "break/abort has effect"? y/n  [n]: n
enable  "ignore system config info"? y/n  [n]: n
change console baud rate? y/n  [n]:  y
enter rate: 0 = 9600,  1 = 4800,  2 = 1200,  3 = 2400
            4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200  [7]:  7
change the boot characteristics? y/n  [n]:  y
enter to boot:
 0 = ROM Monitor
 1 = the boot helper image
 2-15 = boot system
    [0]:  0

    Configuration Summary

enabled are:
load rom after netboot fails
console baud: 115200
boot: the ROM Monitor
do you wish to change the configuration? y/n  [n]: n
You must reset or power cycle for new config to take effect
rommom 2 > reset

2.
Open a new hyperterminal with these settings:

Bits per second - 115200
Data bits - 8
Parity - None
Stop bits - 1
Flow control - Hardware

3.
After setting the hyperterminal, you receive a rommon prompt. Enter the xmodem command. Before you enter an xmodem command, there should be a software image residing in your terminal or your local hard drive.

rommon 2 > xmodem -c c3640-i-mz.121-7.bin

Do not start the sending program yet...
         File size           Checksum   File name

   4936800 bytes (0x4b5460)   0x2dd7    c3640-i-mz.121-7.bin (bad checksum: 0x13eb)

WARNING: All existing data in flash will be lost!

Invoke this application only for disaster recovery.

Do you wish to continue? y/n  [n]:  y

Ready to receive file c3640-i-mz.121-7.bin ...

4.After this message appears, you have to download the file using xmodem and this procedure:

Go to Hyperterminal and click the Transfer menu.

Select Send File.

In the dialog box which appears, click on browse and look for the file name on your local hard drive.

Under the filename field is the Protocol drop-down box. Choose Xmodem.

Click Send to initiate the file transfer.

5.
After the transfer completes, the router will reload itself. When the reload completes, press the return key to be taken to a prompt and to reset the configuration register and the console line speed.

Router> enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#configure terminal
Router(config)#config-register 0x2102
Router(config)#line con 0
Router(config-line)# speed 9600

6.
Upon changing the console speed, you will lose connectivity. Go to your terminal program, change the baud rate to 9600, and reconnect to the router console.

Router(config-line)#ctrl z
Router #write mem
Router #reload

참고 url:
http://cisco.com/en/US/products/hw/routers/ps259/products_tech_note09186a008015bfac.shtml#proc_3600





다행히 정상적으로 ios 가 download 된 후 booting 이 되었고 정상 작동을 해 주더군요.
colsole로 5k/s 정도가 나와 1시간이 넘게 20mega가 넘는 iso 가 전송 되는 걸 지켜보고 있었지만요.

반응형