[IT Trend]/Network

[펌] [CCNA] 시스코 라우터 처음 만지기

하늘을닮은호수M 2005. 7. 20. 13:06
반응형

시스코 라우터 처음 만지기

시스코 라우터 처음 만지기


CISCO 라우터 설정 방법 (초보자용)

CISCO ROUTER에는 disable (>), enable(#) mode의 2가지 모드가 있다.

라우터 콘솔 케이블에 케이블을 연결하고 윈도우즈의 하이퍼 터미날이나 기타 통신 에뮬레이터를 띄운다. 그리고 환경은 9600bps,no parity,com1(2)포트에 직접 연결로 설정하고 엔터를 치면 터미널 통신이 시작된다.

처음 라우터 설치시 setup 명령으로 대화식으로 설치한다.

2500모델의 경우 E0,S0,S1 각각 포트의 사용할 프로토콜의 주소와 라우터 이름, 패스워드등을 부여한다.

후에 show config로 setting 확인

기존 라우터 설정을 바꾸기 위해서는 다음과 같이 한다.

텔넷이나 콘솔로 연결하면,

passwd: XXXXX --> access 패스워드

> enable

passwd: XXXXX --> enable 패스워드

# --> enable mode prompt

모든 셋팅은 enable모드에서 가능하다.

# sh conf --> show config 를 줄여쓸수 있다.

# sh int --> current value 확인

다음의예를 보면

EX1> s0의 ip 주소를 203.226.22.10에서 203.226.23.10으로 변경하고자 함

sangpum # config terminal --> config 모드로 전환
sangpum(config)# int s0 --> interface serial 0
sangpum(config-if) no ip address 203.226.22.10
sangpum(config-if) ip address 203.226.23.10
^Z --> config모드 종료
nikki# write memory --> NV RAM에 저장
시스코 라우터 패스워드 복구하기 (2500 시리즈)


라우터의 패스워드가 기억이 안날때 복구하는 방법입니다.

1. 라우터 콘솔을 PC나 노트북의 com port에 console cable로 연결한다.

2. 이야기나 터미날을 실행한다. (9600bps, no parity로 환경 설정)

3. 라우터 power ON시킨다.

4. 파워 ON한 후 60초 이내에 BREAK 신호를 발생시킨다.

---> 통신 Emulator에 따라 다르지만 윈도우의 단말은 Ctrl+Break 이다.

5. boot mode로 ( >) 로 전환한다.

6. o/r 0x42를 입력한다.

7. i 를 입력하여 재부팅 한후 setup 질문에 NO 라고 대답한다.

8. 정상적인 부팅이 끝났으면 enable모드로 가서 sh conf 로 패스워드를 확인한다.

만일 secret enable 패스워드를 사용중이면 NVRAM에서 secret password를 지우고 enable password를 사용한다.

----> 주의!!! 만약 현재 셋업되어 있는 configuration 을 계속 사용해야 할경우 먼저 메모리로 환경을 로드한다. (conf mem)

9. configuration register값을 0x2102로 변경한다.

# config-reg 0x2102

10. ctrl+Z으로 config mode 나감

11. 재부팅한다. (reload)
시스코 라우터 플래시 IOS 업그레이드 하기



Cisco Router는 Flash Memory에 Router Software를 가지고 있습니다. 그러므로 TFTP 를 이용하여 IOS 버젼을 올릴 수가 있죠..

1. Upgrade할 Router에 Flash Memory가 충분한지 Check합니다.
show flash

2. Source Router를 tftp Server로 만듭니다.
config t
tftp-server flash file_name

3. Target router에서
copy tftp flash
ip address : source-router ip address
file name : file_ name

4. Target Router에서
config t
boot system flash file_name

5. Target Router Rebooting
reload

위와 같이 하면 두개의 Router의 Software를 똑같이 할수가 있죠. Cisco라우터는 software serial no.를 check하지 않더군요.

flash쪽의 작업은 매우 위험하므로 신중을 기해서 작업해야 합니다. 그리고, 작업할때 재대로 적어놓지 않았기 때문에 위에 이야기한 방법과 정확하기 일치하지 않을 수 있지만 기본 개념을 같으므로 어려움 없이 하실 수 있습니다.
시스코 라우터 메모리의 종류



* ( )괄호안은 2500 시리즈의 용량
1. Boot Rom : Booting

2. flash memory : IOS version (4M ; Max=8M)

3. Main Memory (2M ; Max=18MB)
- shared memory : packet in/out 시 저장 용도
- primary DRAM memory : Routing Table, Cache, Queue, Packets

4. NV RAM : configuration (128K)

로드 밸런싱 설정



시스코 라우터의 load balancing처리하는 방법입니다.

config t

ipx maximum-paths 3

^z

write

위와 같이하면 3개의 경로를 가지는 라우터의 경우 만약 1MB의 Data를 보낼때 각각의 link에 나누어서 보내기 때문에 속도가 빨라지죠.
시스코 라우터 부팅이 안될때 부팅시키기



CISCO Router 2500시리즈 모델중 처음 부팅을 시키면 부트롬에서 부트스트랩을 한 3줄만 실행시키고 계속 루프를 돌때는 다음과 같이 하세요.

1. 라우터를 부팅후 60초이내에 Ctrl-Break키를 누른다.

2. >모드에서 s를 입력한다.

그러면 기존 NVRAM에 가지고 있던 모든 정보를 삭제하고 다시 Setup Dialogue를 실행시킵니다.

사용자들이 라우터 패스워드를 잊어버려 패스워드 복구 루틴대로 라우터를 가지고 장난을 치다가 라우터가 부팅이 안되는 아주 당돌한 경우에 유용한 명령어입니다.
DHCP Relay Agent



다중 서브넷에 DHCP서버를 하나만 쓰고자 할때 필요한 것입니다.

예로서, 라우터 이더넷이 여러개의 네트웍으로 분할되어 있고, DHCP서버를 하나만 쓴다고 하면 -- 윈도우즈 NT의 Superscope등 -- 라우터에서 다음과 같은 역할을 필수적으로 해 줘야 합니다. 간단한 내용이니깐 읽어보세요...

If you want to let clients and servers on different network segments exchange BootP or DHCP messages, you must configure your routers to perform BootP Relay.

A BootP relay agent is an Internet host or router that accepts--and in some cases modifies-- messages from BootP clients, and passes the modified messages to other network segments. DHCP is designed to use the same relay agent behavior specified in the BootP protocol specification.

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처리만 해 주면 되죠.


누가 어떤 사이트에 얼마나 접속하는지 보기



요건 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
210.115.128.31 203.239.32.49 3 188
203.255.99.1 203.239.32.94 181 74509
203.235.121.31 203.239.32.80 39 49069
210.115.128.1 203.239.32.49 554 218436
203.235.120.22 203.239.32.80 2 564
203.255.112.1 203.239.33.90 2 202
203.248.6.9 203.239.32.37 148 69898
210.124.172.2 203.239.32.37 105 74923
204.71.200.69 203.239.32.37 20 14522
206.157.193.20 203.239.32.165 54 33863
203.239.32.1 203.239.33.42 12 744
150.50.50.51 203.239.32.144 81 13545
203.255.112.34 203.239.32.80 5 1421
150.50.50.51 203.239.32.147 258 52073
203.248.6.3 203.239.32.7 3 216
210.108.173.10 203.239.32.37 249 187987
203.255.112.34 203.239.33.90 8 982
203.255.112.34 203.239.32.94 1 199
210.127.183.12 203.239.32.80 127 86118

이렇게 모두다 나타나죠. 라우터의 processor나 memory를 많이 차지하지는 않더군요.

목적지 address가 어딘지는 nslookup이나 직접 접속해 보면 간단히 알 수 있죠. 여러분이 접속하시는 곳도 마음만 먹으면 추적할 수 있다는 것이죠.

Frame Relay와 시스코의 속도 튜닝



시스코 라우터의 Frame Relay Encapsulation방식은 IETF 방식과 cisco의 CISCO 방식, 이렇게 2가지가 있는데 이 IETF는 CISCO에서 CISCO가 아닌 다른 벤더들의 FR Router와의 호환을 위해서 표준을 따른 Encapsulation방식입니다.

따라서 모두 시스코 라우터로 구성된 네트워크에서는 굳이 IETF방식으로 설정할 필요가 없겠죠 따라서 이러한 네트웍에선 Encapsulation 방식을 cisco로 사용하고,TCP Header Compress를 사용하면,, 작은 packet들의 전달에 보다 효율적이지 않을까 생각합니다.

물론 전체적인 영향은 미미하겠지만,,,,
방법은

1) interface전체를 compress

Interface serial 0
encapsulation frame-relay
frame-relay ip tcp header-compress active
frame-relay map ip xxx.xxx.xxx.xxx dlci_no broadcast


2) 개별 pvc에 compress

interface serial 0
encapsulation frame-relay
frame-relay map ip xxx.xxx.xxx.xxx dlci_no broadcast cisco tcp header-compress active
frame-relay map ip xxx.xxx.xxx.xxx dlci_no broadcast cisco tcp header-compress active

위와 같이 사용한다면,,,, 원래 tcp/ip header는 약40byte이나 평균 10byte로 그 길이가 줄어들죠. compress할 때의 단점은 priority queuing을 사용하지 못하는 것이나,,, DIC는 이것을 사용하지 않고 있죠. 직접 해보지는 않는 것이나 payload compress를 사용해 보는 것도 좋겠죠(Test해 보고) payload compress는 stacker 알고리즘을 사용하는 압축 방식으로서, 위의 방법보다 압축률이 훨씬 좋을 것 같군요. 단 router의 memory를 좀 많이 차지합니다. 방법은

frame-relay map protocol protocol-address dlci payload-compress



HSRP - Hot Standby Router Protocol


제목 그대로 라우터 2개나 그 이상에서 라우터 redundancy를 제공하는 기능입니다. 즉, 하나는 primary로 작동하고 다른 하나는 secondary로서 primary router가 장애시 작동하게 됩니다.

이때 구성은 2개의 라우터의 이더넷 인터페이스가 같은 네트워크로 구성이 되어 있어야 하겠죠

<샘플 구성 I>

main router에서

interface ethernet0
ip address 203.238.247.2 255.255.255.0
no ip redirects
standby 5 timers 5 10
standby 5 priority 110
standby 5 preempt
standby 5 authenyication sangpumi
standby 5 ip 203.238.247.1
bridge-group 1
!


secondary router에서

interface ethernet0
ip address 203.238.247.3 255.255.255.0
no ip redirects
standby 5 timers 5 10
standby 5 priority 100
standby 5 authenyication sangpum
standby 5 ip 203.238.247.1

!


<샘풀 구성 II>

Primary router:

interface Ethernet1
ip address 15.1.1.1 255.255.0.0
no ip redirects
standby priority 200
standby preempt
standby ip 15.1.1.3

mollie#show standby
Ethernet1
Local state is Active, priority 200, preempting
Hellotime 3 holdtime 10 configured hellotime 3 holdtime 10
Next hello sent in 0:00:02
Hot standby IP address is 15.1.1.3 configured
Active router is local
Standby router is 15.1.1.2 expires in 0:00:09

Standby router:

interface Ethernet1
ip address 15.1.1.2 255.255.0.0
no ip redirects
standby priority 101
standby ip 15.1.1.3


oscar#show standby

Ethernet1
Local state is Standby, priority 101
Hellotime 3 holdtime 10
Next hello sent in 0:00:00
Hot standby IP address is 15.1.1.3
Active router is 15.1.1.1 expires in 0:00:07
Standby router is local
somewhat more common situation would be two routers doing two HSRP groups on the same LAN segment. This gives you load balancing. Router A becomes the lead in group 1 and is the standby in group 2. Router B is the standby in group 1 and is the lead in group 2. Some of the hosts use the shared address from group 1 as their default gateway and other hosts use the shared address from group 2 as their default gateway. Therefore traffic is shared between the two routers.

[인터넷펌]

반응형