2010年6月18日 星期五

NẠP IOS IMAGE TỪ TFTP SERVER CHO CISCO ROUTER CHẠY TỪ FLASH

1. Giới thiệu :
Flash là 1 bộ nhớ có thể xóa, được dùng để lưu trữ hệ điều hành và một số mã lệnh.Bộ nhớ Flash cho phép cập nhật phần mềm mà không cần thay thế chip xử lý.Nội dung Flash vẫn được giữ khi tắt nguồn.
Bài lab này giúp bạn thực hiện việc nạp IOS (Internetwork Operating System) Image từ Flash trong Router Cisco vào TFTP server để tạo bản IOS Image dự phòng và nạp lại IOS Image từ từ TFTP sever vào Cisco Router chạy từ Flash(khôi phục phiên bản củ hay update phiên bản mới) thông qua giao thức truyền TFTP (Trivial file transfer protocol)

2. Mô tả bài lab và đồ hình :

Đồ hình bài lab như hình vẽ, PC nối với router bằng cáp chéo và một cáp console (để điều
khiển router).
PC hoạt động như 1 TFTP Server và được nối với Router thông qua môi trường
Ethernet,lúc này Router hoạt động như là TFTP Client. IOS sẽ đươc copy từ Router lên
Server( trong tình huống backup IOS) hay từ Server vào Router( trong tình huống update hay
cài đặt IOS mới). Đối với trường hợp nạp IOS cho Router khi Flash Router bị xoá ta có thể
vào mode ROMMON để cấu hình lấy IOS từ Server.

3. Các bước thực hiện:
Chúng ta sẽ cấu hình cho router Vsic và PC (đóng vai trò như một TFTP server) như sau :
PC :
IP Address : 192.168.14.2
Subnetmask : 255.255.255.0
Gateway : 192.168.14.1
Router Vsic :
no service password-encryption
hostname vsic
!
ip subnet-zero
no ip finger
!
interface Ethernet0
ip address 192.168.14.1 255.255.255.0
!
interface Serial0
no ip address
shutdown
no fair-queue
!
interface Serial1
no ip address
shutdown
!
ip kerberos source-interface any
ip classless
ip http server
!
line con 0
transport input none
line aux 0
line vty 0 4
!
end
Bạn thực hiện lệnh Ping để đảm bảo việc kết nối giữa Router và TFTP server
vsic#ping 192.168.14.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.14.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
Dùng lệnh Show version để xem phiên bản IOS hiện hành:
vsic#show ver
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JK8OS-L), Version 12.2(1d), RELEASE
SOFTWARE (fc1) Router đang s ử d ụng IOS version 12.2(1d)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Sun 03-Feb-02 22:01 by srani
Image text-base: 0x0307EEE0, data-base: 0x00001000
ROM: System Bootstrap, Version 11.0(10c), SOFTWARE
BOOTFLASH: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c),
RELEASE SOFT
WARE (fc1)
vsic uptime is 15 minutes
System returned to ROM by bus error at PC 0x100D042, address 0xFFFFFFFC
System image file is "flash:/c2500-jk8os-l.122-1d.bin" Tên tập tin IOS image được nạp từ flash- loạI Cisco 2500 sử dụng hệ điều hành phiên bản12.2(1d)
cisco 2500 (68030) processor (revision N) with 14336K/2048K bytes of memory. Router có 16MB RAM,14 MB dùng cho bộ nhớ xử lý, 2 MB dùng cho bộ nhớ I/O
Processor board ID 08030632, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
SuperLAT software (copyright 1990 by Meridian Technology Corp).
TN3270 Emulation software.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read ONLY) Router có 16 MB flash
Configuration register is 0x2102 Thanh ghi hiện hành
Dùng lệnh Show Flash để xem bộ nhớ Flash
vsic#show flash
System flash directory:
File Length Name/status
1 16505800 /c2500-jk8os-l.122-1d.bin
[16505864 bytes used, 271352 available, 16777216 total]
16384K bytes of processor board System flash (Read ONLY)
Ý nghĩa tên File IOS Image:
  • c2500:loại thiết bị Cisco 2500
  • jk8os:các tính năng
  • j :enterprise subnet
  • k8 : reserved for huture encrytion capapilities
  • o : fire wall
  • s : suorce router switch
  • 1.122 : lọai phiên bản IOS
Bạn thực hiện việc nạp IOS image từ Flash vào TFTP server:
vsic#copy flash tftp
Source filename []? /c2500-jk8os-l.122-1d.bin
Address or name of remote host []? 192.168.14.2 địa chỉ TFTP server
Destination filename [c2500-jk8os-l.122-1d.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16505800 bytes copied in 232.724 secs (71145 bytes/sec)
Quá trình nạp thành công, file IOS image được lưu vào chương trình chứa TFTP server

Bạn đã thực hiện xong việc nạp IOS từ Flash vào TFTP server, sau đây bạn thực hiện
lại việc nạp một IOS có sẵn từ TFTP server vào lại flash của một Router.
Các bước thực hiện: Bạn cấu hình Router và Host như trên.chạy chương trình
TFTP từ PC.
Giả sử bạn có 2 file IOS có sẵn trong TFTP server

File IOS Image c2500-i-l.121-26.bin có dung lượng 7,85 MB.
File IOS Image c2500-jk80os-l.122-1d.bin có dung lượng 16MB
  • Bạn thực hiện kiểm tra Flash:

vsic#show flash
System flash directory:
File Length Name/status
1 8039140 /c2500-i-l.121-26.bin
[8039204 bytes used, 349404 available, 8388608 total]
8192K bytes of processor board System flash (Read ONLY)
Nhận xét : Bộ nhớ Flash của bạn có dung lượng là 8 MB, bạn có thể lưu file IOS image
c2500-i-l.121-26.bin vào Flash
  • Thực hiên quá trình copy flash

vsic#copy tftp flash
**** NOTICE ****
Flash load helper v1.0
This process will accept the copy options and then terminate
the current system image to use the ROM based image for the copy.
Routing functionality will not be available during that time.
If you are logged in via telnet, this connection will terminate.
Users with console access can see the results of the copy operation.
---- ******** ----
Proceed? [confirm] xác nhận việc copy
Address or name of remote host []? 192.168.14.2 tên hay địa chỉ nơi lưu Flash (TFTP Server)
Source filename []? c2500-i-l.121-26.bin Tên file nguồn
Destination filename [c2500-i-l.121-26.bin]? Tên file đích
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessing tftp://192.168.14.2/c2500-i-l.121-26.bin...
Erase flash: before copying? [confirm]
00:09:43: %SYS-5-RELOAD: Reload requested
%SYS-4-CONFIG_NEWER: Configurations from version 12.1 may not be correctly
under
stood.
%FLH: c2500-i-l.121-26.bin from 192.168.14.2 to flash ...
System flash directory:
File Length Name/status
1 8039140 /c2500-i-l.121-26.bin
[8039204 bytes used, 349404 available, 8388608 total]
Accessing file 'c2500-i-l.121-26.bin' on 192.168.14.2...
Loading c2500-i-l.121-26.bin from 192.168.14.2 (via Ethernet0): ! [OK]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased quá trình xóa flash
Loading c2500-i-l.121-26.bin from 192.168.14.2 (via Ethernet0): !!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!! quá trình nạp Flash
[OK - 8039140/8388608 bytes]
Verifying checksum... OK (0x9693)
Flash copy took 0:03:57 [hh:mm:ss]
%FLH: Re-booting system after download
F3: 7915484+123624+619980 at 0x3000060
Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-I-L), Version 12.1(26), RELEASE SOFTWARE
(fc1)
Copyright (c) 1986-2004 by cisco Systems, Inc.
Compiled Sat 16-Oct-04 02:44 by cmong
Image text-base: 0x03042000, data-base: 0x00001000
cisco 2500 (68030) processor (revision N) with 6144K/2048K bytes of memory.
Processor board ID 17553463, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read ONLY)
Press RETURN to get started!
Sau khi nạp Flash hoàn thành, Router sẽ reset lại để thay đổi Flash mới, lúc này IOS
trong Flash sẽ là file IOS bạn vừa copy vào.
  • Quá trình nạp Flash trong TFTP server

Lưu ý : là trong cả quá trình copy flash từ TFTP server vào Router hay từ Router vào TFTP server bạn đều phải chạy chương trình TFTP server trên PC.

沒有留言:

張貼留言