Packet Tracer

Cisco 명령어 정리 (CIsco Command Organize)

ZUNJA 2022. 10. 30. 01:54

IOS CLI

Router> enable

Router# configure terminal

Router(config)#

 

save

Router# write memory

Router(config)# do write memory

Router# copy running-config startup-config

Router(config)# copy running-config startup-config

 

reload

Router# reload

Router(config)# do reload

 

hostname change

Router(config)# hostname [호스트 이름]

 

Clock Rate

Router(config)#interface [인터페이스]

Router(config-if)#clock rate 64000

//clock rate를 64k로 만드는 경우

 

enable password

Router(config)# enable password [패스워드] 

Router(config)# enable secret [패스워드]

//secret = 패스워드를 암호화

 

IP Assignment

Router(config)# interface [포트]

Router(config-if)# ip address [IP 주소] [서브넷마스크]

Router(config-if)# no shutdown

 

Static Routing

Router(config)# ip route [목적지 네트워크 주소] [서브넷 마스크] [이웃 라우터의 IP 주소]

 

Default Routing

Router(config)# ip route 0.0.0.0 0.0.0.0 [인터페이스 주소]

 

Dynamic Routing - RIPv2

Router(config)# router rip

Router(config-network)# version 2

// 버전 지정

Router(config-network)# no auto-summary

// 경로 축약 해제

Router(config-network)# network [네트워크 주소]

 

Dynamic Routing - EIGRP

Router(config)# router eigrp [process-ID]

// process-ID = 네트워크 관리자에 의해 관리되는 라우터 그룹

// 1 ~ 65535의 범위 내에서 지정, 다르면 통신 불가능

Router(config-network)# network [네트워크 주소] [와일드카드 마스크]

// 와일드카드 마스크 = 서브넷마스크 반대

 

Dynamic Routing - OSPF

Router(config)# router ospf [process-ID]

// process-ID 달라도 통신 가능

Router(config-network)# network [네트워크 주소] [와일드카드 마스크] area [번호]

// 서로 다른 area끼리 통신하기 위해선 area 들의 중간에 area 0 이 존재해야함

 

Router Redistribute - RIP

Router(config-router)# redistribute [다른 라우팅 프로토콜] [process-ID] metric [메트릭 수]

// RIP metric = Hop 수 = Router 수

 

Router Redistribute - EIGRP

Router(config-router)# redistribute [다른 라우팅 프로토콜] [process-ID] metric 1544 10 255 1 1500

// EIGRP metric = 순서대역폭, 지연, 신뢰도, 부하, MTU (순서대로)

 

Router Redistribute - OSPF

Router(config-router)# redistribute [다른 라우팅 프로토콜] [process-ID] subnets

 

Vlan produce

Switch# vlan database

Switch(vlan)# vlan [VLAN ID] name [VLAN NAME]

 

Vlan - Access

Switch(config)# int [포트]

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan [VLAN ID]

 

Vlan - Trunk

Switch(config)# int [포트]

Switch(config-if)# switchport mode trunk

 

Inter-Vlan

Router(config)# int [가상 인터페이스]

Router(config-subif)# encapsulation dot1Q [VLAN 번호]

Router(config-subif)# ip add [IP 주소] [서브넷마스크]

 

VTP

Switch(config)# vtp mode [VTP 모드] // 모드 설정

Switch(config)# vtp domain [domain-name]  // 도메인

Switch(config)# vtp password [password]  // 비밀번호

 

PPP - PAP

Router(config)# username [상대 이름] password [공용 비번]

Router(config)# int [포트] R0(config-if)#encapsulation ppp

Router(config-if)# ppp authentication pap

Router(config-if)# ppp pap sent-username [자신 이름] Password [공용 비번]

 

PPP - CHAP

Router(config)# username [상대 이름] password [공용 비번]

Router(config)# int [포트]

Router(config-if)# encapsulation ppp

Router(config-if)# ppp authentication chap

 

AAA Server

Router(config)# aaa new-model

Router(config)# aaa authentication login default group radius

Router(config)# radius-server host [서버 IP 주소]

Router(config)# radius-server key [Shared Secret]

Router(config)# line console 0

Router(config-line)# login authentication default

Router(config-line)# exit

Router(config)# line vty 0 4

Router(config-line)# login authentication default

 

Router DHCP

Router(config)# ip dhcp excluded-address [IP 주소]

Router(config)# ip dhcp pool [pool name]

Router(dhcp-config)# network [네트워크 주소] [서브넷마스크]

Router(dhcp-config)# dns-server [DNS 서버 주소]

Router(dhcp-config)# default-router [디폴트 게이트웨이]

 

SYSLOG Server

Router(config)# loggin on

Router(config)# loggin host [IP 주소]

Router(config)# no logging console

Router(config)# service timestamps log datetime msec

// Timestamp가 milliseconds까지 기록

 

NTP Server

Router(config)# ntp server [서버 IP 주소]

 

Frame Relay

Router(config)# int [실제 인터페이스]

Router(config-if)# encapsulation frame-relay

Router(config)# int [가상 인터페이스] point-to-point

Router(config-if)# frame-relay interface-dlci [DLCI]

// DLCI, Name 작성
// DLCI 연결

 

Frame Relay - MultiPoint

Router(config)# int [실제 인터페이스]

Router(config-if)# encapsulation frame-relay

Router(config-if)# frame-relay interface-dlci [DLCI]

Router(config-if)# frame-relay map ip [반대쪽 라우터 IP] [DLCI] broadcast

 

Router(config)# int [가상 인터페이스] multipoint

Router(config-if)# no ip split-horizon // 라우팅 정보 교환

Router(config)# frame-relay interface-dlci [DLCI]

// DLCI, Name 작성
// DLCI 연결

No Inverse - ARP

Router(config)# no frame-relay inverse-arp

 

GRE Tunneling

Router(config)# interface tunnel 0

Router(config-if)# ip add [IP 주소] [서브넷 마스크]

Router(config-if)# tunnel source [물리적 인터페이스]

Router(config-if)# tunnel destination [도착지 주소]

 

mGRE Tunneling

공통

Router(config)# interface tunnel 0

Router(config-if)# ip address [IP 주소] [서브넷마스크]

Router(config-if)# tunnel source [물리적 인터페이스]

Router(config-if)# tunnel mode gre multipoint

Router(config-if)#ip nhrp network-id [network-id] 

// ↑ 네트워크 ID 다르면 통신 불가능 

 

HQ

Router(config-if)# ip nhrp map multicast dynamic

Router(config-if)# no ip split-horizon [라우팅 프로토콜] [process-ID]

 

BR

Router(config-if)# ip nhrp map multicast [HQ 물리적 인터페이스 주소] 

Router(config-if)# ip nhrp map [HQ 터널 주소] [HQ 물리적 인터페이스 주소] 

Router(config-if)# ip nhrp nhs [HQ 터널 주소]

// 위에서 HQ는 허브 라우터를 의미한다.

 

IPsec

공통
1. Router(config)# crypto isakmp policy 10
2. Router(config-isakmp)# encryption aes
3. Router(config-isakmp)# authentication pre-shared
4. Router(config-isakmp)# hash sha
5. Router(config-isakmp)# group 14

6. Router(config)# crypto ipsec transform-set strong esp-des esp-sha-hmac 

7. Router(config)# crypto ipsec key [key] addresss [상대 ip]

8. Router(config)# access-list 100 permit gre host [내 물리 인터페이스 ip] host [상대 물리 인터페이스 ip]
// access-list이기에 당연하게도 host 대신 [IP 주소] [서브넷 마스크]도 된다.

9. Router(config)# crypto map TS 10 IPsec-isakmp
10. Router(config-crypto-map)# match address 100
11. Router(config-crypto-map)# set transform-set [transform name]
12. Router(config-crypto-map)# set peer [상대 물리 인터페이스 ip]

13. Router(config)# int [적용할 인터페이스]
14. Router(config-if)# crypto map TS

 

Standard ACL 

Router(config)# access-list [번호] deny [대상] [와일드카드마스크]

or

Router(config)# access-list [번호] deny host [IP]

 

Router(config)# access-list [번호] permit any

Router(config)# int [인터페이스]

Router(config-if)# ip access-group [번호] in

 

Extended ACL

Router(config)# access-list [번호] deny [프로토 콜] host [출발지] host [목적지] [옵션 프로토 콜]

Router(config)# access-list [번호] permit ip any any

 

Static NAT

Router(config)# ip nat inside source static [사설IP] [공인IP]

Router(config)# int [외부 인터페이스]

Router(config)# ip nat outside

Router(config)# int [내부 인터페이스]

Router(config)# ip nat inside

 

Dynamic NAT

Router(config)# ip nat pool [NAT 이름] [공인 IP 대역 첫 번째] [공인 IP 대역 마지막 주소] netmask [서브넷마스크]

Router(config)# ip nat inside source list [번호] pool [이름]

Router(config)# access-list [번호] permit [사설 IP] [와일드카드 마스크]

 

PAT

Router(config)# ip nat inside source list [번호] interface [인터페이스] overload

Router(config)# access-list [번호] permit [사설 IP] [와일드카드 마스크]

 

IOS Restore

rommon 1 > tftpdnld

//tftpdnld하면 다 나온다.

 

Password Lost

rommon 1 > confreg 0x2142

rommon 2 > reset

 

EtherChannel - PAgP - https://johyungen.tistory.com/89

Switch(config)# interface range [인터페이스]

Switch(config-if-range)# channel-protocol pagp

Switch(config-if-range)# channel-group [n] mode desirable

// Switch(config-if-range)# channnel-group [n] mode auto ← 이것도 가능

 

EtherChannel - LACP - https://johyungen.tistory.com/89

Switch(config)# interface range [인터페이스]

Switch(config-if-range)# channel-protocol lacp

Switch(config-if-range)# channel-group [n] mode active

// Switch(config-if-range)# channnel-group [n] mode passive ← 이것도 가능

 

EtherChannel - mode

desirable : 무조건 PAgP 사용

auto : 상대 스위치 포트가 PAgP를 사용할 때만 PAgP를 활성화

active : 무조건 LACP 사용

passive : 상대 스위치 포트가 LACP를 사용할 때만 LACP를 활성화

on : 이더채널 멤버 포트 모두 활성화, 상대 스위치도 on으로 설정해야한다.

 

Router SSH - https://krwkrw1975.tistory.com/21

 

Switch IP Assignment - https://jeongzzang.com/26

Switch(config)# interface vlan 1

Switch(config-if)# ip address [IP 주소] [서브넷마스크]

Switch(config-if)# no shutdown

Switch(config)# ip default-gateway [게이트웨이 주소]

 

Port Security - https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=beom0116&logNo=221178531757

 

Settings Check

Router# show running-config

Router# show ip route

Router# show vlan

Router# show vtp status

Router# debug ppp authentication

do sh etherchannel summary