# Cisco IOS CLI 4 단계 모드 및 기본 명령어

 - TAB Key : 명령어 완성 기능
 - 축약 기능 제공
 - ? : 도움말
 - Ctrl + a : 커서를 맨 앞으로 이동
 - Ctrl + e : 커서를 맨 뒤로 이동
 - Ctrl + c : 해당 라인 취소

 - 명렁어 오타인 경우 오류 메세지

Router#sg run
           ^
% Invalid input detected at '^' marker.

 - 명령어 축약 정보가 빈약한 경우 오류 메세지

Router#sh ru
% Ambiguous command:  "sh ru"

Router>   [User Mode] 사용자 모드
   - 기본적인 정보 확인 및 테스트 가능
   - 라우터 영향을 주는 정보 확인 및 설정 불가능
Router> enable
-------------------------------------------------------------
Router#    [Privilege Exec Mode] 관리자 모드
   - 'show' 접두어 명령어를 이용하여 정적 정보 확인
   - 'debug' 접두어 명령어를 이용하여 동적 정보 확인
   - 'copy' 접두어 명령어를 이용하여 저장 가능
   - 'erase' 접두어 명령어를 이용하여 삭제 가능
   - 'reload' 명령어를 이용하여 재부팅 가능
   - 'ping' 명령어를 이용하여 IP 데이터 도달 가능성 확인
   - 'telnet' 명령어를 원격 접속이 가능
   - 정보 확인, 저장, 삭제, 재부팅, 테스트, 접속 가능
   - 라우터에 영향을 주는 설정 불가능
 

[참고] RAM & NVRAM

 1) RAM

  - 라우터에 설정을 실시하면 자동으로 설정 내용이 저장되며, 라우터는 RAM에
     저장된 설정 내용을 기반으로 동작한다.

  - RAM에 저장된 설정 내용을 'Running-Config'라고 한다.

  - 라우터에서는 'show running-config' 명령어를 사용한다. (sh run)

  - 라우터가 재부팅되면 저장된 설정 내용이 다 삭제된다. <- 휘발성 메모리

 2) NVRAM

  - RAM에 저장된 설정 내용(Running-Config)을 수동적인 방법으로 'Startup-Config'
    로 저장하여 보관하는 메모리이다.

  - NVRAM에 저장된 설정 내용을 'Startup-Config'라고 한다.

  - 라우터에서는 'show startup-config' 명령어를 사용한다. (sh start)

  - 라우터가 재부팅되면 저장딘 설정 내용이 삭제되지 않는다. <- 비휘발성 메모리

  - NVRAM 사용 시기

 [라우터 부팅 순서]

    1. POST
    2. BootStrap
    3. IOS 찾음 (플래시 메모리 -> TFTP 서버 요청 -> ROM<Mini IOS>)
    4. OS 로딩
    5. NVRAM 참조

     if) NVRAM 참조시 저장된 설정 내용이 있다면, RAM으로 설정 내용을 로딩한다.
     if) NVRAM 참조시 저장된 설정 내용이 없다면, 다음과 같다.

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: no

 3) NVRAM 저장 방법

  Router# copy running-config startup-config <- copy run start
  Router# show start

 4) NVRAM 삭제

  Router# erase startup-config <- erase start
  Router# show start

 5) 라우터 재부팅

  Router# reload (다이나믹스에서는 'dynagen' 실행창에서 reload R1 또는 Reload /all 실시)


Router# configure terminal <- conf t
----------------------------------------------------------------
Enter configuration commands, one per line.  End with CNTL/Z
Router(config)#  [Global Exec Mode] 설정 모드
   - 라우터 설정이 시작되는 모드
----------------------------------------------------------------
# 호스트 네임 설정

Router(config)# hostname R1
R1(config)#
----------------------------------------------------------------
# 라우터 패스워드 설정

 1) Console 패스워드 설정

Router(config)# line console 0
Router(config-line)# password ciscocon
Router(config-line)# login

 2) Aux 패스워드 설정

Router(config)# line aux 0
Router(config-line)# password ciscoaux
Router(config-line)# login

 3) VTY(텔넷) 패스워드 설정 (텔넷 패스워드 설정을 해야지만 접속 가능)

Router(config)# line vty 0 4
Router(config-line)# password ciscotel
Router(config-line)# login

 4) 라우터 패스워드

Router> enable   [User Mode]

password : <- 'Enable Secret' & 'Enable Password'

Router#   [Privilege Exec Mode]

 Router(config)# enable secret cisco <- 'cisco' 문자 암호화 O
 Router(config)# enable password ciscofan <- 'ciscofan' 문자 암호화 X

Ex) 패스워드

User Access Verification

Password:  <- 콘솔 패스워드

R1>enable
Password:  <- 'Enable Secret' 패스워드
R1#
----------------------------------------------------------------------------------------
# 인터페이스 IP 주소 설정 및 활성화 실시

R1(config)# interface fastEthernet 0/0 <- int fa0/0
R1(config-if)# ip address x.x.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface serial 1/0 <- int s1/0
R1(config-if)# ip address x.x.12.1 255.255.255.0
R1(config-if)# clock rate 64000 <- DCE 타입인 경우(다이나믹스에서는 설정 X)
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface loopback 172 <- int lo172
R1(config-if)# ip address 172.16.1.1 255.255.255.0
R1(config-if)# Ctrl + Z
R1# show run

R2(config)# int s1/1
R2(config-if)# ip address x.x.12.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# int fa0/0
R2(config-if)# ip address x.x.2.1 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# int s1/0
R2(config-if)# ip address x.x.23.2 255.255.255.0
R2(config-if)# clock rate 64000 <- DCE 타입인 경우(다이나믹스에서는 설정 X)
R2(config-if)# no shutdown
R2(config-if)# Ctrl + z
R2# show run

R3(config)# int s1/1
R3(config-if)# ip address x.x.23.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit
R3(config)# int fa0/0
R3(config-if)# ip address x.x.3.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit
R3(config)# int lo 172
R3(config-if)# ip address 172.16.3.1 255.255.255.0
R3(config-if)# Ctrl + z
R3# show run

[참고] 설정시 유용한 팁

 - 라인 리플래시 기능

Router(config)# line console 0
Router(config-line)# logging synchronous <- logg syn

 - 콘솔 대기 타임 삭제

Router(config)# line console 0
Router(config-line)# exec-timeout 0 0

 - 오타 입력시 DNS 요청 단계 삭제

Router(config)# no ip domain-lookup
-----------------------------------------------------------------
# show ip interface brief

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            13.13.1.1       YES manual up                    up     
Serial1/0                  13.13.12.1      YES manual up                    up     
Serial1/1                  unassigned      YES NVRAM  administratively down down   
Serial1/2                  unassigned      YES NVRAM  administratively down down   
Serial1/3                  unassigned      YES NVRAM  administratively down down   
FastEthernet2/0            unassigned      YES NVRAM  administratively down down   
Loopback172                172.16.1.1      YES manual up                    up     

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            13.13.2.1       YES manual up                    up     
Serial1/0                  13.13.23.2      YES manual up                    up     
Serial1/1                  13.13.12.2      YES manual up                    up     
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
FastEthernet2/0            unassigned      YES unset  administratively down down   

R3#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            13.13.3.1       YES manual up                    up     
Serial1/0                  unassigned      YES unset  administratively down down   
Serial1/1                  13.13.23.3      YES manual up                    up     
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
FastEthernet2/0            unassigned      YES unset  administratively down down   
Loopback172                172.16.3.1      YES manual up                    up     


[참고] 'show ip interface brief' 명령어 상태

Ex1) 정상적으로 동작하는 경우

 - 1계층 동작/2 계층 동작
 - 전기 신호 교류 가능/프레임 송수신 처리 가능

R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                   Protocol 
Serial1/0                  13.13.12.1      YES manual up                        up 

Ex2) 비정상적으로 동작하는 경우

R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                    Protocol 
Serial1/0                  13.13.12.1      YES manual administratively down   down 

 - 원인 : S1/0 인터페이스를 'shutdown'인 경우
 - 해결책 : S1/0 인터페이스에 들어가서 'no shutdown' 실시

Ex2) 비정상적으로 동작하는 경우

R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                    Protocol 
Serial1/0                  13.13.12.1      YES manual  down           down

 - S1/0 인터페이스로 전기 신호 교류 불가능한 경우(1계층 동작 불가능)
 - 원인 : 인터페이스 불량, 자신이 케이블 연결 X, 상대방과 케이블 연결 X, 케이블 장애

Ex3) 비정상적으로 동작하는 경우

R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                    Protocol 
Serial1/0                  13.13.12.1      YES manual  up                      down

 - S1/0 인터페이스로 전기 신호 교류가 가능한 경우(1계층 동작 가능)
 - S1/0 인터페이스로 프레임 송수신 처리가 불가능한 경우(2계층 동작 불가능)
 - 원인 : DTE 장비가 Clock Rate을 수신하지 못할 경우
            Layer 2 계층 프로토콜이 상대방과 다른 경우
 10초 주기로 'Keepalive' 메세지를 교환하지 못할 경우

2008/05/15 14:30 2008/05/15 14:30
dhappy 이 작성.
TAGS