본문 바로가기

broko Blog!

CCNA Router 기본 명령어

반응형

CCNA Router 기본 명령어



호스트네임 변경
# conf t
# hostname router

enable 패스워드 변경
# conf t
# enable secret router

Line Console Password 설정
router#config term
Enter configuration commands, one per line.  End with CNTL/Z.
router(config)#line console 0
router(config-line)#password password
router(config-line)#^Z

telnet 패스워드 변경
# conf t
# line vty 0 4
# password router

Password Encryption 하기
router#config term
Enter configuration commands, one per line.  End with CNTL/Z.
router(config)#service password-encryption
router(config)#^Z

라우터 재부팅
router>enable
password
router# write memory(wr)
router# reload

인터페이스 IP어드레스 변경
# conf t
# int eth0 (fasteth0, s0)
# no ip address
# ip address 192.168.0.1 255.255.255.0

라우팅 프로토콜 변경
# conf t
# no router rip
# router eigrp 10
# network 192.168.0.0

현재 메모리에 있는 설정 보기
# show running-config(sh run)

NVRAM에 저장되 있는 설정 보기
# show startup-config(sh star)

메모리에 있는 설정 내용을 NVRAM에 저장
# copy running-config startup-config(write memory, wr)

라우터 설정내용을 TFTP서버로 보내기
# write net

ROM, FLASH, TFTP로 부터의 라우터 부팅
# conf t
# boot system flash
# boot system rom
# boot system router.conf 192.168.0.1

인터페이스 연결상태 확인(라우팅 경로)
# show ip route

accress-list 사용법
access-list 1 deny ip x.x.x.x (막고싶은 addr) x.x.x.x (netmask)
.......
access-list 1 permit ip any any
int s 0 (inet 쪽 serial interface)
ip access-grop 1 out

여기서 permit 과 deny 는 명시적인 수행뿐 아니라 묵시적인 수행이 뒤따른다.
하나의 address를 permit하면 그 외 모든 address는 묵시적으로 deny가 되어 버린다
그리고 순서는 일반적으로 deny가 먼저이고 permit이 나중에 온다


※ access-list 번호가 101번 이상의 경우에서는 TCP의 port 번호에 대한 Access control 이
    가능.
Access List(routerB에서 routerC로의 접근불가)
routerA 192.168.1.0
serial    192.168.2.0
routerB 192.168.3.0
serial    192.168.4.0
routerC 192.168.5.0
routerC# conf t
routerC# access-list 1 deny 192.168.3.0 0.0.0.255
routerC# access-list 1 permit 0.0.0.0 255.255.255.255
routerC# int s0
routerC# ip access-group 1 out

라우팅 프로토콜 보기
# show ip protocol

LoopBack interface
# conf t
# int loopback0
# ip address 192.168.0.1 255.255.255.0

SNMP 설정
# conf t
# snmp-server community public ro(read only)





NAT
routerA# conf t(외부와 연결된 라우터에서 설정)
routerA# int eth0
routerA# ip nat outside
routerA# conf t
routerA# int s0
routerA# ip nat inside
routerA# conf t
routerA# ip nat pool net-20 210.220.16.1 210.220.16.255 netmask 255.255.255.0
routerA# ip nat inside source list 1 pool net-20
routerA# access-list 1 permit 192.168.1.0 0.0.0.255

사설 2개의 C클레스 적용
routerA# conf t(외부와 연결된 라우터에서 설정)
routerA# int eth0
routerA# ip nat outside
routerA# conf t
routerA# int s0
routerA# ip nat inside
routerA# conf t
routerA# ip nat pool net-20 210.220.16.1 210.220.16.255 netmask 255.255.255.0
routerA# ip nat inside source list 1 pool net-20
routerA# access-list 1 permit 192.168.1.0 0.0.0.255
routerA# access-list 1 permit 192.168.2.0 0.0.0.255

10.0.1.0/24 네트웍에서 온 패킷으로 속임
routerA# conf t(외부와 연결된 라우터에서 설정)
routerA# int eth0
routerA# ip nat outside
routerA# conf t
routerA# int s0
routerA# ip nat inside
routerA# conf t
routerA# ip nat pool net-20 210.220.16.1 210.220.16.255 netmask 255.255.255.0
routerA# ip nat pool net-10 10.0.1.0 10.0.10.255 netmask 255.255.255.0
routerA# ip nat inside source list 1 pool net-20
routerA# access-list 1 permit 192.168.1.0 0.0.0.255



ip accounting

즉, 누가 어디를 얼마나 접속하는지 packet갯수와 Byte수를 조사할 때 쓰는 것이지요. 물론 RMON이나 Proxy를 사용하면 자세히 볼 수 있지만, cisco router에서의 ip accounting은 간단하게 어디서든지 특별할 설치없이 조사할 수 있다는 장점이 있습니다.

1) 가장 중심경로가 되는 interface에 accounting설정

예) #config t
#interface ethernet 0
#ip accounting
#^z
#

2) 어떻게 되나 확인

예) #show ip accounting

    Source           Destination              Packets               Bytes
203.248.40.46    203.239.32.49                    1                  56
150.50.50.51     203.239.32.162                 302               61081
150.50.50.51     203.239.32.165                 349               73226


IP Address 를 아끼고자 할때

흔히 Serial Connection도 하나의 Network으로 인식되기 때문에 IP Address가 낭비되기 마련이죠. 그렇다고 무작정 Subnetting하기도 간단하지 않구요.

그래서 나온 Solution이 unnumbered라는 것입니다.

그럼 어떻게 하면 unnumbered를 구현할 수 있을까요???

일단 Ethernet 0 에 IP Address를 주고

conf t
int serial 0
ip unnumbered ethernet 0

이렇게 하면 Ethernet에서 사용한 Address가 overlap 됩니다.

만약 Subnetting하지 않았다면 그 다음은 ip route명령으로 static처리만 해 주면 되죠.
Logging in to the Router
10분동안 키입력이 없으면 자동으로 로그아웃
Automatically Exec Mode
>logout
The Default Interval the Router waits for input is 10 Minutes
# no exec-timeout  =  # exec-timeout 0 0

>enable
#exit (or logout)


Loading Configuration File (TFTP Server)
Tftp서버에서의 설정파일 로드
Router# copy tftp running-config
Host or network configuration file [host]?
Address of remote host [255.255.255.255]? 150.21.32.254
Name of Configuration File? Rcfg1
Configure Using rcfg1 from 150.21.32.254? Y
Booting rcfg1 from 150.21.32.254:!! [OK-874/1600 bytes]

#copy tftp startup-config
#copy running-config tftp

'broko Blog!' 카테고리의 다른 글

아이폰15 동작 버튼으로 번역을 빠르게 사용 가능!  (0) 2024.01.21
awk  (0) 2016.02.19
cisco 패스워드 설정  (0) 2016.02.19
팁 모음  (1) 2016.02.18
락걸린 세션 Kill  (0) 2016.02.18