스위치 란?
네트워크 스위치는 컴퓨터와 같은 2개 이상의 IT디바이스가 서로 통신하도록 허용하는 장비입니다.
이에 여러 IT디바이스를 연결하면 통신 네트워크가 생성이 되며
컴퓨팅, 인쇄, 서버, 파일스토리지 등 네트워크상에서 패킷을 교환 할 수 있도록 도와주는 중요한 역할을 하는 만큼
가장 기본적인 필수 명령어를 알아보겠습니다.
스위치 모드 변경하기
① Switch>enable ➔ 유저모드(User Mode)
② Switch#config terminal ➔ 프리빌리지 모드(관리자모드)
③ Switch(config)#interface fastethernet 0/1 ➔ 구성모드(configuration mode)
④ Switch(config-if)# ➔ 인터페이스터
⑤ Switch(config-if)# exit ➔ 빠져나가기
⑥ Switch(config)#exit
⑦ Switch# exit
⑧ Switch>enable
⑨ Switch# show interface status ➔ 포트별 상태를 알아보기(해당 명령어는 반드시 관리자 모드에서 해야함)
⑩ Switch# show ? ➔ show 다음 입력할 수 있는 명령어 모음 표시
⑪ Switch# show interface ?
⑫ Switch# show interfaces ➔ 각 포트의 설정 보기
⑬ Switch# show interface ➔ 각 포토의 설정 보기
포트설정 바꾸기
① Switch>enable
② Switch# configure terminal
③ Switch(config)# interface fastethernet 0/1
④ Switch(config-if)# speed 100 ➔ 속도를 100메가로 설정
⑤ Switch(config-if)# duplex full ➔ 전송방식을 전이중으로 설정(송신을 하면서 동시에 수신도 할수 있는 방식)
⑥ Switch(config-if) exit ➔ 구성모드로 가기
⑦ Switch(config)# exit ➔ 관리자 모드로 가기
⑧ Switch# show interface stauts
⑨ Switch# show interface fastethernet 0/1 (speed {auto | 100 | 10 } duplex { auto | half | full} )
Host 설정하기
① Switch#config terminal
② Switch(config)# hostname 2F_NxSever (대부분 층별 스위치 역할로 지어주는게 좋음)
Secret 암호 설정하기
① Switch# config terminal
② Switch(config)# enable secret haha123 (암호는 구성모드에서 지정하며 자유롭게 지정함)
③ Switch(config)# exit
④ Switch# exit
⑤ Switch> enable
Password : haha123
Switch# ➔ 암호 설정을 위에서 했으므로 암호를 넣어야 관리자 모드로 접속 가능
스위치에 IP주소 설정하기
① Switch> enable
② Switch# config terminal
③ Switch(config)# interface vlan 1
④ Swtitch(config-if)# ip address 192.168.10.1 255.255.255.0
⑤ Switch(config-if)# exit
⑥ Switch(config)# exit
기본 게이트웨이 설정하기
① Switch# config terminal
② Switch(config)# ip default-gateway 192.168.10.1
③ Switch(config)# exit
④ Switch# show running-config ➔ 현재 스위치에 설정된 모든 내용 보여주기
암호 삭제하기
① Switch(config)# no enable secret password haha123(위에서 지정한 암호)
라우터 란?
라우터는 L3 계층에 해당하는 장치로 LAN 끼리 연결해주는 장치이며 LAN끼리 연결을 도와 WAN을 형성해주는 장치이다.
라우터 명렁어 집합
① Router>enable ➔ 사용자모드에서 관리자모드로 전환하기
현재 사용하고 있는 구성파일 보기 -RAM
① Router# show running-config 또는 write terminal
NVRAM에 저장된 구성파일 보기
NVRAM : 비휘발성, 즉 전원을 끈 상태에서도 정보가 날아가지 않는 RAM을 뜻함
① Router# show startup-config
현재 구성을 NVRAM에 저장하기
① Router# write memory 또는 copy running-config startup config
플래시 메모리 정보보기
① Router# show flash
라우터의 현재정보 보기
① Router# show version
인터페이스 정보보기
① Router# show interface
이더넷 인터페이스 0번 보기
① Router# show interface ethernet 0
라우터 CPU 사용률 보기
① Router# show processes cpu
라우터 메모리 상태보기
① Router# show memory
구성모드로 들어가기
① Router# configure terminal
라우터의 이름과 enable secret, enable password 설정하기
① Router(config)# hostname CISCO-2500
② CISCO-2500(config)# enable secret haha123
③ CISCO-2500(config)# enable password Jun
④ CISCO-2500(config)# exit
⑤ CISCO-2500# exit
⑥ CISCO-2500> enable
Password : 위의 암호만든 haha123 설정되어있으면 haha123 암호는 대소문자 구분함
⑦ CISCO-2500# show running-config (현재 설정된 구성정보보기) secret 암호와 패스워드 암호가 보인다.
텔넷 접속 패스워드 설정하기
① CISCO-2500> enable
② Router#> configure terminal
③ Router(config)# line vty 0 4
④ Router(config-line)#login (라인구성모드)
⑤ Router(config-line)#password korea
⑥ Router(config-line)# exit
⑦ Router(config)#
인터페이스 구성 모드에 들어가여 이더넷에 IP주소 할당하기
① Router# configure terminal
② Router(config)# interface ethernet 0
③ Router(config-if)# no shutdown (인터페이스 살리기)
④ Router(config-if)#ip address 211.23.156.30 255.255.255.224
⑤ Router(config-if)# exit
⑥ Router(config)# exit
시리얼 인터페이스 설정하기
① Router# configure terminal (구성모드로 들어가기)
② Router(config)# interface serial 0
③ Router(config-if)# no shutdown
④ Router(config-if)# ip address 10.123.51.41 255.255.255.252
⑤ Router(config-if)# exit
⑥ Router(config)# exit
⑦ Router# show running-config (현재 구성설정보기) ➔ ethernet 0 에 할당된 IP 주소를 확인하며 텔넷에 할당된 암호를 확인함
⑧ Router# show interface (현재 인터페이스 보기) ➔ 이더넷 0 가 up 으로 설정되어 있는지 확인함
라우팅 프로토콜 설정하기
① Router> enable
② Router# config terminal
③ Router(config)# router igrp 100
④ Router(conifg-router)# network 211.23.156.0
⑤ Router(conifg-router)# network 10.0.0.0
⑥ Router(conifg-router)# Ctrl+Z(exit) (프리빌리지모드로 나가기)
⑦ Router# show running-config (구성파일 보기)
RAM의 구성파일을 NVRAM에 저장하기
① Router# copy running-config startup-config
플래시 메모리 내용보기
① Router# show flash
IOS 이미지 파일을 TFTP 서버로 백업하기
① Router# copy flash tftp
TFTP 서버에 플래시메모리 IOs 파일 복원하기
① Router# copy tftp flash
라우터의 구성파일 백업하기
① Router# copy startup-config tftp
라우터의 구성파일 복원하기
① Router# copy tftp startup-config
라우팅 테이블 보기
① Router# show ip route
스태틱 라우팅 구현하기
① Router# configure terminal
② Router(config)# ip route 210.162.65.0 255.255.255.0 203.155.10.2 1
③ Router(config)# exit
④ Router# show ip route
디폴트 라우팅 설정하기
① Router>enable
② Router# configure terminal
③ Router(config)# interface ethernet 0
④ Router(config-if)# ip address 211.23.123.1 255.255.255.0
⑤ Router(config-if)# exit
⑥ Router(config)# interface serial 0
⑦ Router(config-if)# ip address 61.105.112.41 255.255.255.252
⑧ Router(config-if)# exit
⑨ Router(config)# ip route 0.0.0.0 0.0.0.0 61.105.112.42
⑩ Router(config)# exit
⑪ Router# write
⑫ Router#