IOS(Internetwork Operating System)

: IOS는 시스코 시스템의 운영체제이면서 시스템 소프트웨어

- CLI(Command Line Interface)와 GUI가 모두 지원
- GUI의 설정은 CLI에 비해서 쉬우나 모든 기능을 지원하지 않음으로 반드시 CLI 작업에 익숙해야 한다.
- PT의 경우 CLI 설정은 장비와 동일하지만 GUI는 PT만의 별도 인터페이스임으로 실습은 CLI를 이용한다.

 

IOS - Mode

▶ 접속 모드
• 사용자 모드 : User EXEC Mode
 - 장치 설정 불가
 - show 등의 명령어
 - Router>, Switch>


• 관리자 모드 : Privileged EXEC Mode
 - 설정이나 동작 확인 (네트워크 상태 확인시)
 - 제한적인 설정 명령
 - 네트워크 확인 : ping, telnet, traceroute
 - 설정 저장이나 재시작 : write memory, reload
 - Router#, Switch#

 

• 전역 설정 모드 : Global Configuration Mode
 - 장치 설정 모드
 - EXEC 모드의 모든 명령어 사용 가능
 - Switch나 Router의 설정 모드
 - Router(config)#, Switch(config)#

Switch>                    → User Mode
Switch>enable  
Switch#                    → Privileged Mode
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#            → Global Configuration Mode

 

▶ help command
• ? : 각 모드에서 사용가능한 명령어
• 명령어 + ?
ex) conf? 또는 configure ?
- conf로 시작하는 명령어나 configure 이후 옵션에 대한 도움말 기능
• 명령 완성 기능
- [TAB] 키를 이용해서 리눅스 터미널과 같은 명령 완성 기능을 제공

 

▶ 장치 이름 설정
• hostname [장치명]

라우터 설정

Router>
Router>ena
Router>enable 
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname gw001
gw001(config)#

switch 설정

Switch>enable
Switch#conf
Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname sw001
sw001(config)#

 

▶ 관리자 모드 진입 비밀번호
• enable password
- 평문으로 저장된다.
- 형식 : enable password [패스워드]

gw001(config)#enable password pass
gw001(config)#exit
gw001#
%SYS-5-CONFIG_I: Configured from console by console

gw001#disable
gw001>enable
Password: ← 암호입력
gw001#

 

• enable secret
- enable password보다 우선하며 해시코드로 저장된다.
- 형식 : enable secret [패스워드]

Router(config)# enable secret secr
.......
Router> enable
Password:  ← 암호입력
Router#

 

▶ show 명령
• 장비의 다양한 정보를 확인하는데 사용한다.
• show [옵션]
   - running‐config : RAM의 현재 설정 정보 확인
   - startup‐config : NVRAM(하드드라이브)에 저장된 설정 내용 확인
   - version : IOS 버전 정보
   - flash : Flash 정보
   - ip interface brief : 인터페이스별 설정 정보
   - interface [if명] : 인터페이스의 통계 정보
   - cdp neighbor : 주변 장비 확인
   - cdp neighbor detail : 인접 장비 정보 확인

 

show running‐config 명령을 이용한 설정 확인

Router# show ru
Building configuration...
.......
.......
enable secret 5 $1$mERr$Xk4cDQq6dF18bdESpMtqO.
enable password password
.......
.......
line con 0
password password
login

 

▶ 비밀번호 해제
• 설정 명령어 앞에 no를 추가하면 설정이 해제된다.
• 해제명령은 설정 명령과 동일한 모드에서 실행한다.
• disable password
  - no enable password

gw001(config)#no enable password
gw001(config)#

• disable secret
  - no enable secret

 

*장비에 설정된 내용은 RAM(running config)에 저장되고 이 내용은 리부팅하면 사라진다. 

설정된 내용을 영구적으로 저장하기 위해서는 NVRAM(startup config)에 저장해야 한다.

 

▶ NVRAM에 설정 저장 명령
• copy running‐config startup‐config

 

▶ NVRAM의 설정 삭제 명령
• erase startup‐config

 

▶ 장비 재부팅
• reload

 

IOS - 설정 내역 저장 확인

Router# show running‐config
.......
Router# show startup‐config
startup‐config is not present   ← NVRAM에 startup 설정이 저장되지 않았다.
Router# copy running‐config startup‐config
Destination filename [startup‐config]?
Building configuration...
[OK]
Router# show startup‐config
.......        
                                ← NVRAM에 저장된 startup 설정이 출력된다.

 

IOS - 메모리

▶ DRAM
• RAM으로 현재 설정정보가 저장된다.
• CPU가 IOS를 실행하고 running config, routing table등이 저장된다.


▶ NVRAM (하드드라이브)
• startup configuration file이 저장된다.
• 장치가 부팅할 때 파일이 저장된다.


▶ EPROM
• ROM으로 PC의 BIOS와 기능이 동일하다.
• Flash memor에 IOS image 파일이 작동하지 않을때 필요한 S/W가 저장된다.


▶ Flasch memory
• IOS image 파일이 저장된다.(운영체제 저장)
• PC의 SSD와 동일한 기능을 제공한다.

 

ISO - 추가 명령어

▶ DNS lookup 기능 해제 (이상한 명령을 치면 오래걸리는 것을 방지)
• no ip domain‐lookup

Router(config)# no ip domain‐lookup
Router(config)# exit
Router# abc
Translating "abc"
% Unknown command or computer name, or unable to find computer address

gw001#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
gw001#show startup-config 
...
no ip domain-lookup

 

이것을 NVRAM에 저장해줘야 한다. (copy running-config startup-config)


IP 설정

라우터에 시리얼 포트 추가한다.

config에 보면 serial 포트가 두개 추가 된 것을 확인

 

▶ IP 할당
• 라우터는 인터페이스(네트워크 인터페이스 : LAN카드)별로 IP를 갖는다.
• 스위치는 장치에 IP가 할당된다.
 - VLAN 별로 IP가 할당된다.

 - 원래는 ip를 세팅할 필요가 없다. 스위치허브는 2 Layer 장치

 - 장치에 접근해서 config해야하므로 손쉽게 하기 위해 ip 세팅 

*스위치는 컴퓨터X

 

이더넷 : 네트워크의 한 방식 (통신규격) > Link Layer

리눅스 ip 2개 세팅? > 물리적인 랜카드가 하나지만 가상 인터페이스를 추가해서 ens32:0, ens32:1 생성 (MAC address가 같음)

 

▶ IP 설정 - PC

Desktop - IP configuration

 

▶ IP 설정 - Router, Switch

▷ 인터페이스 모드
• interface [if명 | range if범위]
- switch는 vlan에 IP를 할당한다.
ex) (config)# interface gigabitEthernet0/0
       (config)# interface range fa0/1‐10, fa0/21  ← 범위 설정


▷ 인터페이스 활성화/비활성화
• no shutdown/shutdown
ex) (config‐if)# no shutdown
       (config‐if)# shutdown


▷ IP 할당
• ip address [ip] [netmask]
ex) (config‐if)# ip address 192.168.10.1 255.255.255.0

 

라우터 ip 할당 (네트워크 인터페이스에 할당)

Router>
Router>enable
Router#configure t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip domain-lookup 
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy 
Router#copy ?
  flash:          Copy from flash: file system
  ftp:            Copy from ftp: file system
  running-config  Copy from current system configuration
  scp:            Copy from scp: file system
  startup-config  Copy from startup configuration
  tftp:           Copy from tftp: file system
Router#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#
% Unknown command or computer name, or unable to find computer address

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface gigabitEthernet0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown 

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
	
Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#

 

스위치 ip 할당 (vlan 장치에 할당)

Switch>
Switch>enable
Switch#configure t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#no ip domain-lookup 
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface vlan1
Switch(config-if)#ip addre
Switch(config-if)#ip address 192.168.10.201
Switch(config-if)#ip address 192.168.10.201 255.255.255.0
Switch(config-if)#no shutdown 

Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch#

 

▷ Telnet 접속

라우터나 스위치에 설정된 IP를 이용하면 콘솔이외에 telnet과 같은 네트워크 접속이 가능하다.
• 외부 네트워크 접속을 위해서는 반드시 관리자 모드에 대한 패스워드가 설정되어 있어야 한다.
• 명령
   line vty 0 4
   login
   password [패스워드]
• 설정 이후 설정 내용은 반드시 저장한 다음 접속을 테스트 한다.

 

- 라우터 telnet 접속 설정

Router(config)#line vty 0 4
Router(config-line)#login
% Login disabled on line 388, until 'password' is set
% Login disabled on line 389, until 'password' is set
% Login disabled on line 390, until 'password' is set
% Login disabled on line 391, until 'password' is set
% Login disabled on line 392, until 'password' is set
Router(config-line)#password routerpw

 

- 스위치 telnet 접속 설정

Switch(config)#line vty 0 4
Switch(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
Switch(config-line)#password switchpw

 

- telnet 접속 test

router

C:\>telnet 192.168.10.1
Trying 192.168.10.1 ...Open


User Access Verification

Password: 
Router>enable
% No password set.
Router>
Router>exit

 

switch hub

 

C:\>telnet 192.168.10.201
Trying 192.168.10.201 ...Open


User Access Verification

Password: 
Switch>enable
% No password set.
Switch>

'네트워크 공부 기록' 카테고리의 다른 글

STP  (0) 2022.01.11
Switch  (0) 2022.01.11
네트워크 12 - 네트워크 관련 프로토콜 (ICMP, ARP)  (0) 2021.10.18
네트워크 11 - NAT  (0) 2021.10.18
네트워크 10 - 네트워크 분할(서브네팅) 및 VLSM  (1) 2021.10.15

+ Recent posts