라우터나 스위치들은 IOS(Internetwork Openating System)을 사용한다. 동작과정을 살펴보면
1. 전원을 키면 POST(Power On Self Test)를 실시하여 장치의 이상유무를 확인한다.
2. 다음으로 ROM에 있는 BootStrap(bootloader)를 RAM으로 옮긴다.
3. 만약 Bootloader가 FLASH에 있는 IOS를 RAM부팅을 하는데 ios가 없거나 손상되면 rom에서 서브셋 ios를 읽어들여 rommon모드로 실행된다.
4, IOS를 통한 부팅이 정상적으로 실행되면, NVRAM의 설정파일(Startup-config)을 읽어 들여 이를 적용
패스워드 복구 및 ios업로드 예제
show version: 버전 확인
Router#show version
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
ROM: System Bootstrap, Version 12.1(3r)T2
System image file is "flash:c2600-i-mz.122-28.bin"---> flash에 특정파일을 저장가능
대표적인 시스코 운영체제...
압축된 이미지 파일을 해제해서 사용
Cisco 2621 (MPC860) processor (revision 0x200) with 253952K/8192K bytes of memory
--> D램.. 256MB, 라우팅 테이블의 경로도 디램에..
Processor board ID JAD05190MTZ(제품번호)
2 FastEthernet/IEEE 802.3 interface(s)
32K bytes of non-volatile configuration memory(용량이 클필요 없다)
63488K bytes of ATA CompactFlash (Read/Write) 플래시 메모일 파일...
---> 리눅스 기반.....커널 C2600장비...
Router#show flash
System flash directory:
File Length Name/status
3 5571584 c2600-i-mz.122-28.bin 시스코 운영체제 용량 5.5MB
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[5827403 bytes used, 58188981 available, 64016384 total 약 :64MB]
63488K bytes of processor board System flash (Read/Write)
EX) 2911
-DRAM 용량? 491520K/32768K bytes of memory. 다더해야 함 512MB
-flash 용량?249856K bytes,,, 256Mb
-Cisco IOS 이름/버전?Version 15.1(4)M4,cisco2911
c2900-universalk9-mz.SPA.151-1.M4
-인터페이스 유형?3 Gigabit Ethernet interfaces 기가 이더넷이 3개가 있다.
-NVRAM 용량?255K bytes,,, 256K
-메인보드 제품 번호?Processor board ID FTX152400KS
-Config-Register 번호? Configuration register is 0x2102
show version
show flash
show ip int brief
EX) 2941
-DRAM 용량? 491520K/32768K bytes of memory. 다더해야 함 512MB
-flash 용량?249856K bytes,,, 256Mb
-Cisco IOS 이름/버전?Version 15.1(4)M4, Cisco CISCO1941/K9 (revision 1.0)
flash0:c1900-universalk9-mz.SPA.151-1.M4.bin
-인터페이스 유형?2 Gigabit Ethernet interfaces 기가 이더넷이 3개가 있다.
-NVRAM 용량?255K bytes,,, 256K
-메인보드 제품 번호?Processor board ID FTX152400KS
-Config-Register 번호? Configuration register is 0x2102
show version
show flash
show ip int brief
show diag
@0x2102 (부팅모드)----기본모드.....
1. POST(POWER OF SELF TEST) : 장치의 이상 유무를 판단
2. ROM에 있는 BOOT(bootstrap)를 RAM으로 옮긴다.
3. flash에 ios가 없거나 손상되었을 경우 rom에 있는 서브셋 ios를 읽어들여 (rommon) 모드 부팅
4. OS를 RAM로 로딩
5. NVRAM 참조
- 'startup-config' 파일 X -> 질문이 나오며
- 'startup-config' 파일 O -> 설정 내용 -> 'running-config' 복사하게 된다.(부팅시)
@ 0x2101
1. POST(Power on Self Test) : 장치의 이상 유무를 판단
2. Bootstrap -> 부팅
3. ROM -> Mini IOS 로딩
4. NVRAM 참조
@0x2142(1~4번까지만) 라우터 패스워드 복구할때......
1. POST(POWER OF SELF TEST)
2. BOOT(bootstrap)
3. IOS 찾기(flash -> tftp 서버 요청 -> rom 모드 부팅)
4. OS를 RAM 로딩
Ex1) 패스워드 복구 예제
- R1에서 동작하기 위한 설정들은 유지되어야 한다.
1) Rommon 모드
conf t
config-register 0x2142
Configuration register is 0x2102 (will be 0x2142 at next reload)
Self decompressing the image :
##############---> ctrl+break...
monitor: command "boot" aborted due to user interrupt
rommon 1 > ?
boot boot up an external process
confreg configuration register utility
dir list files in file system
help monitor builtin command help
reset system reset
set display the monitor variables
tftpdnld tftp image download
unset unset a monitor variable
rommon 2 > confreg 0x2142(복구모드로 변경....기본모드는 0x2102)
rommon 3 >
rommon 3 > reset
show start
2)startup-config -> running-config why? 동작하기 이전 설정을 유지하기 위해
Router#copy start run 스타트에서 러닝으로 바뀐다...
3) 사용중 인터페이스 및 패스워드 재설정 no shutdown실시
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#no shutdown ---> 사용 중인 인터페이스를 no shotdown한다.
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#enable secret cisco
R1(config)#
R1(config)#line con 0
R1(config-line)#password ciscocon
R1(config-line)#login
R1(config-line)#line vty 0 4
R1(config-line)#password ciscovty
R1(config-line)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
4) NVRAM 설정 저장
R1#copy run start(nvram으로 옮김)
0x2142-> 0x2102(기본모드)로 변경
5) 부팅 모드 0x2102변경
R1#conf t
R1(config)#config-register 0x2102
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#
show version
reload
show version
2. Cisco IOS 다운로드 예제
- R1 Flash 메모리에 저장되어 있는 'c2600-i-mz.122-28.bin' Cisco IOS를 TFTP 서버-2에 저장하도록 하자.
R2#show flash----운영체제 확인
System flash directory:
File Length Name/status
3 5571584 c2600-i-mz.122-28.bin
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[5827403 bytes used, 58188981 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
R2#copy flash tftp---- 다운실시
Source filename []? c2600-i-mz.122-28.bin
Address or name of remote host []? 192.168.2.250
Destination filename [c2600-i-mz.122-28.bin]? 엔터
Writing c2600-i-mz.122-28.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 5571584 bytes]
5571584 bytes copied in 0.106 secs (52562000 bytes/sec)
R2#
3. Cisco IOS 업로드 예제
R3#show flash
System flash directory:
File Length Name/status
3 5571584 c2600-i-mz.122-28.bin
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[5827403 bytes used, 58188981 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
R3#copy flash tftp 기존 ios 파일을 서버로 복사한다......(백업실시)
Source filename []? c2600-i-mz.122-28.bin
Address or name of remote host []? 192.168.3.250
Destination filename [c2600-i-mz.122-28.bin]?
Writing c2600-i-mz.122-28.bin....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 5571584 bytes]
5571584 bytes copied in 3.113 secs (1789000 bytes/sec)
새로운 IOS로 업그레이드
R3#copy tftp flash
Address or name of remote host []? 192.168.3.250
Source filename []? c2600-advipservicesk9-mz.124-15.T1.bin -------> 새로 올릴 ios
Destination filename [c2600-advipservicesk9-mz.124-15.T1.bin]? 엔터
Accessing tftp://192.168.3.250/c2600-advipservicesk9-mz.124-15.T1.bin...
Loading c2600-advipservicesk9-mz.124-15.T1.bin from 192.168.3.250: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ~ 중간 생략 ~
4.현재 R3 Flash 메모리에 IOS가 없는 상태이다. R3 TFTP 버-4를 이용하여 'c2600-advipservicesk9-mz.124-15.T1.bin'
를 업로드하도록 하자
rommon 1 >
rommon 1 > dir flash:
File size Checksum File name
28282 bytes (0x6e7a) 0x6e7a sigdef-category.xml
227537 bytes (0x378d1) 0x78d4 sigdef-default.xml
rommon 3 > tftpdnld
Missing or illegal ip address for variable IP_ADDRESS
Illegal IP address.
usage: tftpdnld
Use this command for disaster recovery only to recover an image via TFTP.
Monitor variables are used to set up parameters for the transfer.
(Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
"ctrl-c" or "break" stops the transfer before flash erase begins.
The following variables are REQUIRED to be set for tftpdnld:
IP_ADDRESS: The IP address for this unit
IP_SUBNET_MASK: The subnet mask for this unit
DEFAULT_GATEWAY: The default gateway for this unit
TFTP_SERVER: The IP address of the server to fetch from
TFTP_FILE: The filename to fetch
The following variables are OPTIONAL:
TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=7)
TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)
TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)
FE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx, 4=Auto(deflt)
rommon 4 >
rommon 4 > IP_ADDRESS=192.168.4.250(현재 사용하고 있는 인터페이스 주소로 해야함)
rommon 5 > IP_SUBNET_MASK=255.255.255.0
rommon 6 > DEFAULT_GATEWAY=192.168.4.254
rommon 7 > TFTP_SERVER=192.168.4.250
rommon 8 > TFTP_FILE=c2600-advipservicesk9-mz.124-15.T1.bin
rommon 9 > tftpdnld
Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: y
~ 중간 생략 ~
rommon 10 > dir flash:
File size Checksum File name
33591768 bytes (0x20091d8) 0x93d8 c2600-advipservicesk9-mz.124-15.T1.bin
rommon 11 > reset
'네트워크/서버/모의해킹 > 네트워크' 카테고리의 다른 글
17.2.24 10일차(EIGRP: eigrp동작과정, 네이버 성립조건, 토폴로지 테이블,메트릭,수동요약,외부경로,디폴트설정) (1029) | 2017.02.24 |
---|---|
17.2.23 9일차(ip 라우팅, 라우팅 업데이트 방식 ,서브넷 처리 방식,자동클래스풀요약,RIP) (1183) | 2017.02.23 |
17.2.21 7일차(정적 경로 및 기본 경로) (503) | 2017.02.21 |
17.2.20 6일차(1~5일차 복습, 시스코 명령어 복습) (509) | 2017.02.20 |
17.2.17 5일차(ip주소 요약 및 시스코 명령어) (526) | 2017.02.17 |