engineering/Network Eng.2006. 8. 11. 13:16

불필요한 Global Service 정지

Disabling service finger – Finger Service 정지
Disabling service pad – PAD(X.25) Service 정지
Disabling udp & tcp small servers – Echo,Discard,Chargen,Daytime Service 정지
Enabling service password encryption – Password 암호화 기능 구동
Enabling service tcp-keepalives-in/out – Session Keepalive Service 구동
Disabling the cdp protocol – CDP Service 정지
Disabling the bootp server – Bootp Server Service 정지
Disabling the http server – Http Server 기능 정지
Disabling source routing – IP 변조 방지를 위한 Source Routing 기능 정지
Disabling gratuitous arp – PPP connection,IP negotiation 등에 사용되는 ARP 도용 서비스 차단
Configuring aaa local authentication – AAA 생성 서비스, 외부로 부터의 접속 강화 서비스 – Telnet,Console,Aux 등…
Banner 자동 생성 기능

불필요한 Interface Service 정지

no ip redirects – icmp redirect message 차단
no ip proxy-arp – Proxy arp service 정지
no ip unreachables – ICMP unreachable service 정지
no ip directed-broadcast – Broadcast service 정지
no ip mask-reply – ICMP mask-reply 정지

성능 강화와 IP filtering

CEF Enable
Ingress Filtering – 사용하지 않는 사설 IP, IANA address
uRPF - IP 변조방지 구성

“Auto Secure” 명령어를 통한 보안 강화
  “One Touch” device lock down process – command 한줄로 라우터의 보안구성을 자동으로 실행

CPP 구성
CPP (Control Plane Policing) 구성 예제

##Access-list 작성##
Router(config)# access-list 141 permit icmp any any port-unreachable

##Class-Map 작성##
Router(config)# class-map icmp-class 
Router(config-cmap)# match access-group 141

##Policy-Map 작성##
Router(config)# policy-map control-plane-out-policy
Router(config-pmap)# class icmp-class
Router(config-pmap-c)# police 80000 conform transmit exceed drop

##Control Plane 에 적용##
Router(config)# control-plane
Router(config-cp)# service-policy output control-plane-policy

Port Security – MAC 변조 방지 기능

Switch(config)# interface fastethernet 5/12
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 5  - 최대 허용 MAC Address
Switch(config-if)# switchport port-security mac-address 1000.2000.3000   - 허용 MAC address
Switch(config-if)# switchport port-security violation [protect/restrict/shutdown]
                         - 규칙 위반 시 Action

Port Security – MAC flooding 방어

Console> (enable) set port security 2/1 enable
Console> (enable) set port security 2/1 enable 00-90-2b-03-34-08    - 허용 MAC address
Console> (enable) set port security 2/1 maximum 20                   - 최대 허용 MAC Address
Console> (enable) set port security 2/1 violation [restrict/shutdown]  - 규칙 위반 시 Action

Port Security – 공격자 MAC 제어 기술

Attacker로 의심이 되는 특정 MAC Address 만을 Filtering
4500(config)# mac-address-table static 0050.3e8d.4444 vlan (해당vlan) drop
                     - 해당 Vlan Interface에 올라오는 MAC Address Filtering
4500(config)# show mac-address-table dynamic
                     - 현재 Switch로 올라오는 CAM Table 조회 명령

Console> (enable) set cam static filter 00-02-03-04-05-06 12(해당 Vlan 번호)
                     - 해당 Vlan Interface에 올라오는 MAC Address Filtering
Console> (enable) clear cam 00-02-03-04-05-06 12(해당 Vlan 번호)
                     - filtering 해제
Console> show cam static       - 현재 Switch로 올라오는 CAM Table 조회 명령

Multi/Broadcast Flooding 제어기술 : Storm Control (Bandwidth 대비 Percentage 적용)

Router# configure terminal
Router(config)# interface gigabitethernet 3/16
Router(config-if)# storm-control multicast level 70.5
                   - Multicast 70.5% 이상이면 억제

Console> (enable) set port broadcast 2/1 80% multicast enable
                   - Multicast 70.5% 이상이면 억제 : default packet drop
Console> (enable) clear port broadcast 2/1
                   - 구성 해제
Console> (enable) set port broadcast 4/6 90% violation errdisable
                   - Broadcast 90% 이상 이면 Interface errdisable로 만듦 

공격자 MAC 추적 기술 : L2 Trace

(Cat OS, Native IOS 지원 : 특정 MAC이 연결된 장비 및 포트 현황 추적 기능 지원)
Cat OS Layer 2 Trace를 통한 MAC address 추적
의심이 가는 Switch에서 Layer 2 trace 명령을 통한 추적

6509> (enable) l2trace 00-00-e8-34- 00-01-e6-27- detail
l2trace vlan number is 222.
Attention: Source 00-00-e8-34-d2-96 is not directly attached to this system.
Source 00-00-e8-34- found in WS-C4006 : 100.248.2.254
WS-C4006 : cat4006 : 100.248.2.254:  4/27 10MB half duplex -> 2/1-2 1000MB full duplex
WS-C6509 : cat6509 : 100.248.117.78: 3/14,4/14 1000MB full duplex
->  8/44 10MB half duplex
Destination 00-01-e6-27- found in WS-C6509 named BB_6509
on port  8/44 10MB half duplex
DHCP사용환경, IP Spoofing 시 유용한 추적

Cisco IOS Layer 2 Trace를 통한 MAC address 추적
의심이 가는 Switch에서 Layer 2 trace 명령을 통한 추적


Switch# traceroute mac 0000.0201.0601 0000.0201.0201 detail
Source 0000.0201.0601 found on con6[WS-C3750-12T] (2.2.6.6)
con6 / WS-C3750-12T / 2.2.6.6 :
Gi0/0/2 [auto, auto] => Gi0/0/3 [auto, auto]
con5 / WS-C2950G-24-EI / 2.2.5.5 :
Fa0/3 [auto, auto] => Gi0/1 [auto, auto]
con1 / WS-C3550-12G / 2.2.1.1 :
Gi0/1 [auto, auto] => Gi0/2 [auto, auto]
con2 / WS-C3550-24 / 2.2.2.2 :
Gi0/2 [auto, auto] => Fa0/1 [auto, auto]
Destination 0000.0201.0201 found on con2[WS-C3550-24] (2.2.2.2)
Layer 2 trace completed.
DHCP사용환경, IP Spoofing 시 유용한 추적

Snooping 방지 : Private VLAN

Private Vlan : 동일 Vlan 내부에서의 불필요한 Traffic 제어
Community Vlan : C-vlan 간 Host만 통신이 가능
Isolated Vlan : I-Vlan 간 Host도 통신 불가
Promiscuous Port : 모든 Pvlan Host는 P-port를 통한 외부 통신 가능

Private VLAN 생성 및  Sub VLAN 역할 담당
vlan 65
  private-vlan primary
  private-vlan association 651-653
vlan 651
  private-vlan community
vlan 652
  private-vlan isolated
vlan 653
  private-vlan community

Primary VLAN과 Secondary VLAN Association 구성
vlan 65
  private-vlan association 651,652,653
interface vlan 65
private-vlan mapping add 651,652,653

물리적 포트에 secondary vlan 할당
Router(config)# interface fastethernet 9/1
Router(config-if)# switchport mode private-vlan host
Router(config-if)# switchport private-vlan host-association 65 651

Layer 2 장비로 운용시 promiscuous port 할당
Router(config)# interface fast  9/48
Router(config-if)# switchport mode private-vlan promiscuous
Router(config-if)# switchport private-vlan mapping 65,651,652,653
※ Catalyst 4000 / 4500 series 는 Isolated VLAN 만 구성가능 / Community VLAN 구성 불가

Cat OS에서의 PVLAN 구성 방법
set vlan 65 pvlan-type primary        : Pvlan Primary Vlan 생성
set vlan 651 pvlan-type community        : Pvlan Secondary Vlan 생성 – Community Vlan
set vlan 652 pvlan-type isolated               : Pvlan Secondary Vlan 생성 – Isolated Vlan
set vlan 65 651 9/1                        : 물리적 Port에 Secondary Vlan 할당
set vlan 65 652 9/2                                 : 물리적 Port에 Secondary Vlan 할당
set vlan mapping 7 651 5/11                : Promiscuous 생성 및 할당
set vlan mapping 7 652 5/11       

Private Vlan Edge 기능
Isolated Vlan : Protected기능을 통한 특정 Host 보호간 상호 독립 기능
Protected와 설정되지 않은 Port간, G/W를 통한 외부 통신 가능

Private VLAN edge 기능 구성 예제
3550(config)# interface gigabitethernet0/3
3550(config-if)# switchport protected
3550(config-if)# end
3550# show interfaces gigabitethernet0/3 switchport
Name: Gi0/3
Switchport: Enabled
<output truncated>
Protected: True
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Broadcast Suppression Level: 100
Multicast Suppression Level: 100

IP 변조 방지 기능 : uRPF(Unicast Reverse Path Forwarding)

DHCP request flooding 공격 방어 : DHCP snooping rate limit 기능
-> DHCP Scope Size 전체에 IP 할당을 요청하여, DHCP Server 과부하 발생 시킴


DHCP Request Flooding 공격 방어 구성 예제.
Switch(config)# ip dhcp snooping                         - DHCP Snooping enable
Switch(config)# ip dhcp snooping vlan 10                 - DHCP Snooping 적용 Vlan 정의
Switch(config-if)# ip dhcp snooping limit rate 100(pps)    - DHCP Request 허용 수치 제한

DHCP Server 위조 공격 방어 : DHCP snooping Trust 기능
-> DHCP Request 에 대해, 공격자가 거짓된 정보를 전달함

DHCP Request Flooding 공격 방어 구성 예제.
Switch(config)# ip dhcp snooping          - DHCP Snooping enable
Switch(config)# ip dhcp snooping vlan 10  - DHCP Snooping 적용 Vlan 정의
Switch(config-if)# ip dhcp snooping trust  - DHCP discover, request 등 메시지를 해당 Port만 수용

DHCP Snooping을 통한 MAC 변조 방지 기능 – ARP Inspection
DHCP Snooping을 통한 IP 변조 방지 기능 – IP Source Guard

-> ARP Inspection
S1(config)# ip arp inspection vlan 1
S1(config-if)# ip arp inspection trust
S1# show ip dhcp snooping binding
MacAddress       IpAddress     Lease(sec)     Type            VLAN       Interface
------------   ---------   ----------   ----------      ----      -------------
01:01:01:11        1.1.1.11         4993      dhcp-snooping      1          FastEthernet6/4
00:12:08: %SW_DAI-4-DHCP_SNOOPING_DENY: 2 Invalid ARPs (Req) on Fa6/4, vlan
1.([01.01.01.11/1.1.1.22/0000.0000.0000/0.0.0.0/02:42:35 UTC Tue Jul 10 2001])

-> IP Source Guard 구성
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 10 20
Switch(config-if)# no ip dhcp snooping trust
Switch(config-if)# ip verify source vlan dhcp-snooping port-security
Switch(config)# ip source binding ip-addr ip vlan number interface interface
Switch# sh ip verify source interface f6/1
Interface     Filter-type    Filter-mode    IP-address     Mac-address      Vlan
-------     --------    -----------  -----------  -------------  -------
Fa6/1          ip-mac          active     10.0.0.1 10
Fa6/1          ip-mac          active       deny-all                         11-20

Packet filtering을 위한 ACL의 이해 – Nachi Worm 취약점 Blocking

일반적인 ACL 정의
Switch(config)#ip access-list extended worm_block
Switch(config)# deny tcp any any 135
Switch(config)# deny tcp any any 139
Switch(config)# deny tcp any any 445
Switch(config)# deny tcp any any 4444
Switch(config)# deny tcp any any 707
Switch(config)# deny udp any any 69
Switch(config)# deny icmp any any echo  
Switch(config)# deny icmp any any echo-reply
Switch(config)# permit ip any any
- ICMP Echo Service 막을 경우 network 진단 방법이 어려워지므로,  PBR을 권고

Vlan AccessMap 정의
Switch(config) #vlan access-map worm_vacl 10
Switch(config)#match ip address worm_block - 앞서 정의된 일반적인 ACL을 불러들임
Switch(config)#action forward
- 일반적인 ACL에 정의된 내용에 대한 부분은 모두 Drop 해당 Vlan Interface에 적용
Switch(config)#vlan filter worm_vacl vlan-list 100 - 150
- VACL이 적용될 해당 Vlan을 선언해 주는 부분

-> Catalyst OS를 통한 VACL 구성 방법
Vlan 기반 ACL 정의
set security acl ip VACL deny udp any eq 4444 any
set security acl ip VACL deny udp any any eq 4444
set security acl ip VACL deny tcp any eq 135 any
set security acl ip VACL deny tcp any any eq 135
- Blaster Worm 관련 config
set security acl ip VACL deny tcp any eq 707 any
set security acl ip VACL deny tcp any any eq 707
- Nachi worm 관련 config
set security acl ip VACL permit ip any any
- Worm을 제외한 모든 traffic permit
정의된 VACL을 해당 Vlan에 적용
commit security acl VACL
set security acl map VACL <적용하고자 하는 VLAN번호>
VACL 해제 방법
clear security acl VACL
commit secuirty acl VACL

유연한 ACL 구성 – Time Based ACL

“ MSN Messenger 를 Work Time에만 사용토록 설정 “
“ 주말에는 모든 시간대에 사용토록 설정 “

Router#sh clock       <- 현재 라우터 또는 스위치의 시간 설정 확인
16:58:53.719 KST Sat Nov 1 2003
Time-Based ACL 구성 방법
access-list 101 deny   ip any 207.46.104.0 0.0.0.255  time-range msn
access-list 101 deny   tcp any any eq 1863 time-range msn
access-list 101 deny   tcp any any range 6891 6900 time-range msn
access-list 101 deny   udp any any eq 6901 time-range msn
access-list 101 permit ip any any 

ACL 적용
interface fastethernet 0 --> 내부 이더넷
ip access-group 101 in
Time Rule 설정
Router(config)#time-range msn
Router(config-time-range)#periodic weekdays 09:00 to 18:00 
                      --> 월요일 부터 금요일 까지 매일 아침 9시 부터 저녁 6시 까지만 적용
  정상 작동 확인
Router#sh access-lists
Extended IP access list 101
deny ip any 207.46.104.0 0.0.0.255 time-range msn (inactive)
--> 현재 시각이 토요일 이므로 자동 비활성
deny tcp any any eq 1863 time-range msn (inactive)
deny tcp any any range 6891 6900 time-range msn (inactive)
deny udp any any eq 6901 time-range msn (inactive)
permit ip any any

Catalyst 4500 에서의 QoS를 통한 TCP Synflood Attack 방어 요령

qos aggregate-policer limit 32000 bps 4000 byte conform-action transmit exceed-action drop
qos
!
class-map match-all c_syn
match access-group 101
!
policy-map p_syn
  class c_syn
   police aggregate limit
!
interface FastEthernet4/34
switchport access vlan 45
switchport mode access
qos vlan-based
!
interface Vlan45
ip address 10.10.45.2 255.255.255.0
service-policy input p_syn
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.10.45.1
no ip http server
!
!
ip access-list extended syn_acl
permit tcp any any syn
!
access-list 101 permit tcp any any syn

잠재적인 공격 대비 QoS 구성 : Cat6500 Policing

mls qos
-> mls QoS enable
access-list 113 permit icmp any any echo
access-list 113 permit icmp any any echo-reply
-> icmp attack marking
access-list 111 permit tcp any any eq 135
access-list 111 permit tcp any any eq 4444
access-list 111 permit tcp any any eq 707
access-list 111 permit udp any any eq 69
-> Blaster worm,Nachi worm marking
access-list 112 permit tcp any any syn
-> syn flooding attack 방어 marking
access-list 101 permit tcp any any syn
-> syn flooding attack 방어 marking

해당 Class-map 정의
class-map match-all icmp_attack
  match access-group 113
class-map match-all Blaster_0815_attack
  match access-group 112
class-map match-all Blaster_Nachi
  match access-group 111
각 Class에 해당되는 ACL 포함시킴

policy-map QoS
  class icmp_attack
   police 32000 1000 1000 conform-action transmit exceed-action drop violate-action drop
  class Blaster_0815_attack
   police 32000 1000 1000 conform-action transmit exceed-action drop violate-action drop
  class Blaster_Nachi
   police 32000 1000 1000 conform-action transmit exceed-action drop violate-action drop
-> 각 Class 모두 32Kbps 이상이면 모두 Drop 시킴

set qos enable
 - QoS 활성화 시키기
set qos policer aggregate policer_worm rate 32 policed-dscp erate 32 drop burst 4 eburst 4
 - 32Kbps 이상 worm에 관련된 ACL이 들어올 경우 Drop 시킨다.
set qos acl ip worm dscp 8 aggregate policer_worm tcp any  any  eq 135
set qos acl ip worm dscp 8 aggregate policer_worm tcp any  any  eq 4444
set qos acl ip worm dscp 8 aggregate policer_worm tcp any  any  eq 707
set qos acl ip worm dscp 8 aggregate policer_worm udp any  any  eq 69
set qos acl ip worm dscp 8 aggregate policer_worm icmp any  any  echo
set qos acl ip worm dscp 8 aggregate policer_worm icmp any  any  echo-reply
- Blaster worm, Nachi worm,ICMP Attack 관련 정의

활성화 및 적용/해제/Monitoring
commit qos acl worm           - QoS ACL 활성화
set qos acl map worm 100          - 적용하고자 하는 Vlan or Interface 적용

Clear qos acl worm
Commit qos acl worm         - QoS 해제
Cat6500> (enable) sh qos statistics aggregate-policer policer_worm
QoS aggregate-policer statistics:
Aggregate policer               Allowed packet Packets exceed Packets exceed
                               count          normal rate    excess rate
------------------------------- -------------- -------------- --------------
policer_worm                               268             11             11
- 해당 QoS 에 적용되어 Drop 되는 packet monitoring

NBAR(Network Based Application Recognition) – 어플리케이션 레벨의 특정 서비스 인지

Virus Pattern 인식 –  Code Red, Nimda
-> 인지 후 DSCP Marking을 통해 Drop Action 가능
다양한 Service Protocol 인식을 통한 통계 분석 가능
Core Router/Switch 구간의 NBAR Enable을 통한 P2P 통계치 분석 가능
-> MIB 지원, QPM, QDM 을 통한 GUI 환경의 사용자 기반 관리 도구 제공

DoS 방어를 위한 CAR Rate Limiting

※ Limit outbound ping to 256 Kbps
interface xy
rate-limit output access-group 102 256000 8000 8000
conform-action transmit exceed-action drop
!
access-list 102 permit icmp any any echo
access-list 102 permit icmp any any echo-reply
※ Limit inbound TCP SYN packets to 8 Kbps
interface xy
rate-limit input access-group 103 8000  8000 8000
conform-action transmit exceed-action drop
!
access-list 103 permit tcp any any syn

Posted by theYoungman
engineering/Network Eng.2006. 8. 7. 00:53
출처 블로그 > ♤우리집♤
원본 http://blog.naver.com/535v/140010604504
Router - 후니의 쉽게 쓴 시스코 네트워킹에서...
1. 라우터를 한마디로 말하자면
- 지능을 가진 경로 배정기
2. 라우터는 무슨일을 할까요?

- 경로 결정(Path Determination) +  Switching
- 가장 좋은 경로를 결정하기 위해 라우팅 알고리즘을 사용하고 이런 라우팅 알고리즘은 라우팅 테이블을 만듬

3. 라우터는 어떻게 생긴 녀석일까?
- 시스코 2500 라우터, 3600 라우터, 12400 라우터, 7500 라우터 등
- 인터페이스 : 라우터의 접속 포트
  . 라우터 2501 뒷면 [ Ethernet    Serial0   Serial1      Console   AUX   I/O   전원잭 ]
  . Ethernet 포트 : 내부 네트워크, 즉 LAN을 위한 접속 포트, TP 또는 AUI(15핀) 방식
  . Serial 포트 : 외부 네트워크, 즉 WAN을 위한 접속 포트로 DSU/CSU와 연결함(V.35케이블 이용)

4. 라우팅 프로토콜과 라우티드 프로토콜

- 라우티드 프로토콜 : TCP/IP, IPX, Apple Talk 등
- 라우팅 프로토콜
1) RIP : Routing Information Protocol
2) IGRP : Interior Gateway Routing Protocol
3) OSPF : Open Shortest Path First
4) EIGRP : Enhanced Interior Gateway Routing Protocol

5. Static 라우팅 프로토콜과 Dynamic 라우팅 프로토콜
- Static 라우팅 프로토콜 : 사람이 구성해 줘야 하며 라우터는 정해진 길로만 감
- Dynamic 라우팅 프로토콜 : 라우터가 라우팅 프로토콜을 통해 알아서 길을 찾는 대신 라우터가 하는 일이 많음
  RIP, IGRP, OSPF, EIGRP 등
6. 라우팅 테이블에 대한 이야기
- show ip router (= sh ip ro) TCP/IP에서의 라우팅 테이블 보기 (cf show ipx router)
- 라우터는 라우팅 테이블을 RAM에 올려서 이용, 파워가 꺼지면 전부 지워지며 켜면 수 초 또는 수 분만에 다시 만들어 짐
7. AS 그리고 내부용과 외부용 라우팅 프로토콜
- AS Autonomous(자주적인) System
 . 네트워크 관리자(하나의 관리 전략)에 의해서 관리되는 라우터들의 집단
  . AS 밖(인터넷)으로 나가고자 할때는 ASBR(AS Boundary Router)을 통해야 함
- 내부용 라우팅 프로토콜(IGP(= IRP) Interior Gateway(Router) Protocol) : RIP, IGRP, OSPF, EIGRP 등
- 외부용 라우팅 프로토콜(EGP(= ERP) Exterior Gateway(Router) Protocol) : EGP ,BGP 등
8. 라우터 구성의 시작
- 라우터에 명령어 입력하는 방법? 다섯가지 정도
                                                                                                                  [3.텔넷접속]
                                                                                   [4.TFTP 서버]-----|    |    |-----[5.NMS 네트워크관리시스템]
[1.터미널 에뮬레이션 프로그램을 이용한 콘솔 전송]----콘솔포트-[라우터]-AUX포트----[2.모뎀] 원격지에서 모뎀통해 라우터 명령...
9. 라우터의 중요한 몇 가지 모드
- 유저모드, Privileged 모드, Configuration(구성) 모드, Setup 모드, RXBOOT 모드 등
1) RXBOOT 모드 : 라우터의 패스워드를 모르는 경우나 라우터의 이미지 파일(IOS)에 문제가 생긴 경우 복구를 위해 사용하는 모드
2) Setup 모드 : 라우터를 처음 구매해서 파워를 켰거나 라우터에 구성 파일이 없는 경우 라우터가 부팅하면서 자동으로 들어가는 모드
3) '>'가 있는 모드 : 유저 모드, ping 테스트 trace 가능, 라우터 구성 파일 보거나 구성을 할 수 없음
4) Privileged 모드 : 라우터의 운영자 모드, 유저모드에서 enable 명령 사용하여 들어가며 disable 명령 이용하여 빠져나감
5) Configuration(구성) 모드 : config 모드는 Privileged 모드에서만 가능 config terminal(conf t)로 들어가고 exit 또는 ctrl+Z로 빠짐
  Router> enable
  Password : *****
  Router# config terminal
  Router(config)# ctrl + Z
  Router>

Tip 1. 지금까지 내린 명령어를 보려면...
  Router# show history (기본 10개)

Tip 2. 기억할 수 있는 명령어 수를 30개로 늘이려면...
  Router# terminal history size 30 (256개까지 가능)

10. 라우터 안에는 어떤 것들이 살까요?

- 내부 : [RAM, NVRAM, Frash Memory, ROM]
  1) RAM : IOS + 라우팅 테이블 + 구성파일 + ARP 캐쉬 + 패스트 스위칭 캐쉬
   ※ IOS : 시스코 라우터 운영 시스템(Internetwork OS)
  2) NVRAM(Non Volatile RAM) : 라우터 구성파일이 백업되는 곳
  . show startup-config 또는 show config : NVRAM에 저장된 구성 파일 보는 것
  . show running-config 또는 write terminal : RAM에 저장된 구성 파일 보는 것
  3) Frash Memory : IOS가 저장되는 곳
  ※ 확장이 필요한 것? RAM과 Frash Memory
  4) ROM : PC의 CMOS와 비슷, POST(Power On Self Test), 기본 IOS가 탑재되어 있음
  ※ ROM Monitor(RXBOOT) 모드에서 롬부팅을 하는 경우 롬에 있는 IOS를 가지고 부팅함 => 패스워드 복구 등의 작업을 함

- 외부 : interface, console port, Auxiliary port

11. 내가 가진 라우터의 현재 정보는 모두 이 곳에

- 라우터
  [ RAM : IOS, 명령어 수행기, 현재 구성파일, 라우팅 테이블 등, 기타 프로그램, 버퍼용 메모리 ]
  [ NVRAM : 백업 구성파일)                                                                                                                     ]
  [ 플래시 메모리 : IOS 이미지                                                                                                                ]
  [ 인터페이스                                                                                                                                              ]

1) show version : 라우터의 기본적인 내용, 즉 사용하는 소프트웨어의 버전이라든지 아니면 가지고 있는 인터페이스 종류,
                                그리고 IOS가 어디서 부팅했는지 등에 관한 전반적인 내용을 볼 수 있음
2) show interface : 현재 모든 인터페이스 및 그의 현재 상황까지 보여줌
   show interface ethernet 0 또는 show interface serial 0/0 : 특정 인터페이스 지정해서 볼때
3) show flash : 플래쉬 메모리 보기
4) show processes cpu : 현재 라우터의 동작 상태 보여줌
5) show ip route
6) show clock : 라우터의 현재시간
7)  show history : 방금내린 명령어 10개 보여줌

Router# show version
Cisco Internetwork Operating System Software
IOS (tm) 3600 Software (C3620-JS-M), Version 11.2(14)P, RELEASE SOFTWARE (fc1) (설명)3600시리즈, IOS 11.2버젼
Copyright (c) 1986-1998 by cisco Systems, Inc.
Compiled Tue 26-May-98 22:42 by dschwart
Image text-base:0x600088E0, data-base: 0x607D6000

ROM : System Bootstrap, Version 11.1(19)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)

Router uptime is 3 minutes
System restarted by power-on
System image file is "flash:c3620-js-mz.112-14.P", booted via flash
(설명) IOS가 플래쉬메모리에 저장되어 있으며 파일명이 "c3620-js-mz.112-14.P"이다
...
1 FastEthernet/IEEE 802.3 interface(s)
4 Serial network interface(s)

(설명) 하나의 FastEthernet과 4개의 Serial 인터페이스가 있다.
DRAM configuraiton is 32 bits wide with parity disabled.
29K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read/Write)

(설명) NVRAM 용량은 29KB이고 플래쉬메모리 용량은 8MB라는 의미
Configuration register is 0x2102

Router# show interface serial 0/0
Serial0/0 is down, line protocol is down
...
Router# show running-config(또는 write terminal 또는  sh run) : 현재 구성파일 보기
Router# show startup-config(또는 show config 또는 sh start) : 백업 구성파일 보기

Router# show flash
Dirtectory of flash:/
0  ---- 49096 Nov 03 1998 01:14:21 TinyROM-1.0(2)
1  -r-x 2470740 Mar 09 1999 00:18:52 c800-g3-mw.120-3.T1
12582912 bytes total (10027008 bytes free)

(설명) 현재 플래쉬 파일이름은 "c800-g3-mw.120-3.T1"이고 2.4MB 정도 이고
           플래쉬 전체 용량은 12MB이고 사용가능 용량은 10MB 정도 이다.

Router# show process cpu
CPU utilization for five seconds:0%/0%; one minute: 0%; five minutes:0%
PID Runtime(ms) Invoked uSedcs 5Sec 1Min 5Min TTY process
  1         4        78         51       0.00%  0.00%  0.00%  0  Load Meter
(설명) 현재 라우터의 5분, 1분, 5초 동안의 CPU 로드 퍼센트가 나타남

12. 라우터의 셋업 모드
- 라우터의 초보자를 위한 모드로 질문과 대답으로 구성 파일을 만드는 모드
- 라우터을 처음 샀을때나 setup이라는 명령으로 들어감
라우터의 도움말
Router# cl?
clear clock
Router# clock
% Incomplete command
Router# clock ?
set Set the time date
Router# clock set
% Incomplete command
Router# clock set ?
Current Time (hh:mm:ss)
Router# clock set 19:56:00
% Incomplete command
Router# clock set 19:56:00 ?
<1-31> Day of the month
MONTH Month of the year
Router# clock set 19:56:00 4 August
% Incomplete command
Router# clock set 19:56:00 4 August ?
<1993-2035> Year
Router# clock set 19:56:00 4 August 2004
Router#
13. 라우터에 명령을 입력하는 두번째 방법

- 구성모드(프리빌지지 모드를 통해서만 들어감, 유저모드(>) → 프리빌리지모드(#) → 구성모드((config)#))
- 구성모드에서 변경한 사항을 저장하려면 프리빌리지드 모드에서 write memory 명령을 써야 함

Router> enable
Router# configure terminal (또는 conf t)

- 라우터의 이름 Cisco-R, enable secret 값인 korea, enable password 값인 cisco 입력
Router(config)# hostname Cisco-R
Cisco-R(config)# enable secret korea
Cisco-R(config)# enable password cisco

- 라인 구성 모드에서 텔넷라인에 대한 패스워드 설정
Cisco-R(config)# line vty 0 4
Cisco-R(config-line)# password korea
Cisco-R(config-line)# exit

- 인터페이스 구성 모드
Cisco-R(config)# interface ethernet 0 (또는 int e 0)
Cisco-R(config-if)# no shutdown
Cisco-R(config-if)# ip addr 172.16.92.1  255.255.0.0
Cisco-R(config-if)# exit

Cisco-R(config)# int s 0
Cisco-R(config-if)# ip addr 152.100.10.67  255.255.0.0
Cisco-R(config-if)# no shut
Cisco-R(config-if)# exit

- 라우팅 프로토콜 세팅
Cisco-R(config)# router igrp 200
Cisco-R(config-router)# network 172.16.0.0
Cisco-R(config-router)# network 150.100.0.0
Cisco-R(config-router)# no network 150.100.0.0  (설명) 내가 잘못 입력한 명령을 지우고 싶다면 앞에다 no만 넣어주면 됨
Cisco-R(config-router)# network 152.100.0.0

- 지금까지 세팅한 자료 확인 sh run
Cisco-R(config-router)# exit
Cisco-R(config)# ctrl+Z
Cisco-R# sh run
...
- 지금 RAM상에 있는 구성 파일 NVRAM 저장(백업)하기(프리빌리지드 모드에서 가능)
Cisco-R# copy running-cofig startup-config (또는 write memory)

14. 스태틱 라우팅을 이용한 라우터 구성

- 스태틱 라우팅 프로토콜은 갈 수 있는 경로가 하나뿐인 Stub 라우터용으로 많이 사용됨(예, 게임방 라우터)


       [본사 네트워크] 150.150.0.0, 255.255.0.0,  A라우터의 Serial 0:203.210.100.1
  [라우터]---[라우터]
         |                   |
  [라우터]---[A라우터]==========인터넷                  [지방 사무소] Serial 0:203.210.100.2, Ethernet 0:210.240.10.1, 255.255.255.0
                                                                  =============[B라우터]---<S/W>---pc들(Stub 네트워크)

    →A라우터에는 여러 연결이 존재하므로 다이나믹 라우팅 프로토콜이 유리,
        B라우터는  A와 연결이 끊어지면 대치 경로 없음 이때 스태틱 라우팅이 유리

- 지방사무소의 B라우터에 스태틱 라우팅 설정
  . ip route network [mask] {address|interface} [distance]
  → network [mask] : 목적지 주소
  → {address|interface} : 1hop을 건너 뛴 IP 주소

- 지방사무소 네트워크 설정

Router> enable
Router# conf t

Router(config)# hostname Router-B
Router-B(config)# enable password cisco
Router-B(config)# int e 0
Router-B(config-if)# no shut
Router-B(config-if)# ip addr 210.240.10.1, 255.255.255.0
Router-B(config-if)# int s 0
Router-B(config-if)# no shut
Router-B(config-if)# ip addr 203.210.100.2, 255.255.255.0
Router-B(config-if)# exit

Router-B(config)# ip route 150.150.0.0 255.255.0.0 203.210.100.1 (스태틱 라우팅 시험문제)
Router-B(config)# ctrl+Z
Router-B# write mem
Router-B# disable
Route-B>
15. 스태틱 라우팅만 알면 디폴트 라우트는 식은 죽 먹기
- 디폴트 라우트? 경로를 찾아내지 못한 모든 네트워크들은 모두 이곳으로 가라고 미리 정해 놓은 길(미아보호소)
       [우리회사] 150.150.0.0, 255.255.0.0,  A라우터의 Serial 0:203.240.10.2
  [라우터]---[라우터]
         |                   |
  [라우터]---[A라우터]==========인터넷                    [인터넷망] Serial 0:203.240.10.1
                                                      203.240.10.0 =========[B라우터]---<S/W>---pc들(Stub 네트워크)
- [A라우터] rip를 이용한 디폴트 라우트 설정
  route rip
  network 150.150.0.0
  network 203.240.10.0
  ip default-network 203.240.10.0

- [A라우터] 스태틱라우팅을 이용한 디폴트 라우트 설정
ip route 0.0.0.0 0.0.0.0 203.240.10.1

- 디폴트 라우터는 디폴트 네트워크를 이용한 구성과 스태틱 라우팅을 이용한 구성이 있다.
  실생활에서는 스태틱 라우팅 프로토콜을 이용한 구성을 많이 사용한다.
- 참고 ping, trace

※ 디폴트 네트워크 구성시 규칙
1) ip default-network 뒤에 오는 네트워크 주소는 항상 디폴트 클래스에 맞춰서 주어야 한다. 즉 150.100.10.0(X) 150.100.0.0(O)
2) rip에서 디폴트 네트워크를 구성하는 경우는 반드시 rip 프로트콜에서 정의된 네트워크여야 한다.

16. 라우터의 구성 명령에 대한 버젼별 정리
- IOS 11.0 이상과 미만은 명령에 차이가 많은 남
라우터를 알아보기 쉽게 만드는 몇가지 명령들

- 라우터 이름(CISCO)주기 : 구성모드에서 가능
Router> enable
Router# conf t
Router(config)# hostname CISCO
CISCO(config)#

- 배너 입력(라우터가 접속한 시점에 배너가 나타남)
CISCO(config)# banner motd # This is cisco router #  (설명) motd : message of the day

- interface에 Description 주기
CISCO(config)# int s 0
CISCO(config-if)# description To access Pusan Router Serial 0

17. Distance Vector와 Link State

- Distance Vector
  . 거리와 방향만을 위주로 만들어진 라우팅 알고리즘, 라우팅 테이블에 목적지까지의 거리(홉 카운트 등)와 인접 라우터(방향)만을 저장
  . 라우팅 테이블이 적어 메모리 절약,
     정해진 시간마다 이웃 라우터로부터 라우팅 테이블 업데이트를 해야 하므로 트래픽 낭비 有,
     라우팅 테이블 변화가 있을때 모든 라우터가 알때까지 시간이 많이 걸림
  . 소형 네트워크에 적합
  . RIP, IGRP

- Link State
  . 라우터가 목적지까지의 모든 경로를 알고 있기 때문에 링크 변동에 따른 인식이 빠름
  . 라우팅 테이블 교환 주기가 길며 교환시에도 링크 변동이 일어난 라우팅 테이블만 교환하기 때문에 트래픽이 적다
  . 대형 네트워크에 적합
  . 메모리의 소모가 많고 CPU의 로드가 많다
  . OSPF

18. 라우터 패스워드 구성

- 유저 모드>에서 프리빌리지 모드#로 들어갈때 패스워드(enable password, enable secret)
  . enable password : 라우터 구성파일에 그대로 보여짐
  . enable secret : 라우터 구성파일에 암호화 되어 보여짐, 두 패스워드를 동시에 세팅했을 때는 enable secret 패스워드만 물음
Router> enable
Router# conf t
Router(config)# enable password cisco
Router(config)# enable secret korea

- 콘솔 패스워드 세팅
Router(config)# line con 0
Router(config-line)# login (설명) login이란 명령을 쓰지 않으면 콘솔에서 접속할 때 아무리 패스워드를 세팅했어도 묻지 않음
Router(config-line)# password cisco

- 버추얼 터미널 패스워드 세팅
Router(config)# line vty 0 4
Router(config-line)# login (설명) login이란 명령을 쓰지 않으면 콘솔에서 접속할 때 아무리 패스워드를 세팅했어도 묻지 않음
Router(config-line)# password cisco

- 버추얼 터미널 유저아이디와 패스워드 세팅시
Router(config)# line vty 0 4
Router(config-line)# login local
Router(config-line)# exit
Router(config)# username ccna password cisco

- AUX 포트 패스워드 세팅
Router(config)# line aux 0
Router(config-line)# login (설명) login이란 명령을 쓰지 않으면 콘솔에서 접속할 때 아무리 패스워드를 세팅했어도 묻지 않음
Router(config-line)# password cisco

- 콘솔이나 텔넷포트 등 자동 타임아웃 세팅
Router(config)# line con 0
Router(config-line)# exec-timeout 10 30 (설명) 10분30초 동안 아무런 입력이 없으면 자동 타임 아웃시킴


19. 시스코 라우터의 친구찾기 CDP
20. 텔넷을 이용한 장비 접속
  # telnet 203.210.100.2
21. Ping과 Trace
  # ping 100.2.4.150
  # trace 172.70.100.1
Posted by theYoungman
engineering/Network Eng.2006. 4. 7. 01:14


ROUTER의 멀티부팅

라우터에 전원을 넣으면 Boot image file 을 ROUTER내 ROM, Flash MEMORY, 또는 TFTP 서버에서 가지고 온다.



ROM으로 부팅하기

san#conf t


Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#no boot system


san(config)#boot system rom


san(config)#^Z


san#wr m


san#reload


san#sh ver


~ running defailt software


1. ROM에서 부팅하도록 설정하면 일반적으로 bootflash memory에서 부팅하게 된다.


2. 부팅속도가 가장 빠르다


3. 일반적으로 ROM부팅은 비상시 이용하는 것이므로 완전한 S/W set을


제공하지는 않는다.


4. Boot field의 config-register값을 0x2101로 설정하면 부팅설정에 관계없이
ROM 부팅을 하게 된다.


san(config)#config-register 0x2101


참고

: Boot field의 config-register값을 0x2100로 설정하면 Bootstrap이 내장된

라우터 내의 boot ROM에서 직접 부팅을 한다.


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#config-register 0x2100


san(config)#^Z


san#


san#wr m


san#reload


roceed with reload? [confirm]

%SYS-5-RELOAD: Reload requested

System Bootstrap, Version 4.14(7), SOFTWARE

Copyright (c) 1986-1994 by cisco Systems

4000 processor with 8192 Kbytes of main memory


rommon>


참고2

: 위의 ROM Monitor 모드에서 다시 필요에 따라 bootflash, flash, tftp서버등의 2차 부팅을 유도할수 있다.


1) rommon>

rommon>b <== bootflash memory에서 재부팅하기


2) rommon>

rommon>b flash <== flash memory에서 재부팅하기


3) rommon>


rommon>b xx-in-m.102-2 202.30.68.241

<== tftp서버(202.30.68.241)에서 재부팅하기

<== 여기서 xx-in-m.102-2는 읽어올 image-file이다.

: cisco 7000 이상은 위의 command와 조금 다르다.


5. bootflash memory 에 완전한 IMAGE S/W set을 넣어 정상적인
부팅을 시도할수 있다.



Flash Memory 로 부팅하기


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#no boot system


san(config)#boot system flash


san(config)# ^Z


san#wr m


san#reload


san#sh ver

~ system image file is "flash:c4500-i-mz.111--7" booted via flash


1. Flash Memory 를 partition한 경우 특정 partition에서 부팅하고자 할 때는
다음과 같이 셋팅한다.

san(config)#boot system flash flash:1:rsp-jsv-mz.120-3c


2. CISCO 7507등의 경우 SLOT에 삽입된 카드타입의 Flash Memory로 부팅할 때는

다음과 같이 셋팅한다.

san(config)#boot system flash slot0:rsp-jsv-mz.120-3c


(3) TFTP 서버(202.30.68.241)로 부팅하기


san#


san#


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#no boot system


san(config)#boot system tftp c4500-i-mz.111--7 202.30.68.241


san(config)#^Z


san#wr m


san#reload


san#sh ver


~ system image file is "c4500-i-mz.111--7" booted via tftp from 202.30.68.241

1. 위의 경우 라우터는 network내 tftp server (202.30.68.241)에서 image-file (c4500-i-mz.111--7)을 읽어서 부팅하게 된다.

2. LAN 구간에서 TFTP 서버 부팅이 가능하다.


3. WAN 구간을 경유한 경우에도 TFTP 서버 부팅이 가능하다.



멀티부팅 설정하기


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#no boot system


san(config)#boot system flash


san(config)#boot system tftp c4500-i-mz.111-7 202.30.68.241


san(config)#boot system rom


san(config)#^Z


san#wr m


san#reload

1. 위의 경우 처음에 flash memory부터 부팅하게 되며 부팅 실패시 TFTP 서버로부터

부팅하게 되며 역시 부팅 실패시 마지막으로 ROM에서 부팅을 시도한다.



라우터를 TFTP 서버로 이용하기


-Server router설정하기


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#int e 0


san(config-if)#ip addr 202.30.68.241 255.255.255.0


san(config-if)#exit


san(config)#


san(config)#tftp-server flash c4500-i-mz.111-7 1


san(config)#access-list 1 permit 210.109.216.0 0.0.0.255


san(config)#^Z


san#wr m


san#reload

1. CISCO 7507등의 경우는 tftp-server 설정부분에서 조금 틀리다.

san(config)#tftp-server flash:rsp-jsv-mz.120-3c 1


2. CISCO 7507등의 경우 SLOT에 삽입된 카드타입의 Flash Memory를 이용할 때는
다음과 같이 셋팅한다.

san(config)#tftp-server slot0:rsp-jsv-mz.120-3c 1


-Client router 설정하기


san#conf t

Enter configuration commands, one per line. End with CNTL/Z.


san(config)#


san(config)#int e 0


san(config-if)#ip addr 210.109.216.241 255.255.255.0


san(config-if)#exit


san(config)#


san(config)#no boot system


san(config)#boot system tftp c4500-i-mz.111-7 202.30.68.241


san(config)#^Z


san#


san#wr m


san#reload

1. 위의 경우 Client router는 network에 연결된 Server router(202.30.68.241)의 image-file

(c4500-i-mz.111-7)을 읽어서 부팅하게 된다.



show version command 분석


san#sh ver

Cisco Internetwork Operating System Software

IOS (tm) 4500 Software (C4500-I-M), Version 11.1(7), RELEASE SOFTWARE (fc2)

:현재 동작하고 있는 Image version이 11.1(7)임을 의미한다.


Copyright (c) 1986-1996 by cisco Systems, Inc.


Compiled Wed 23-Oct-96 21:35 by tej


Image text-base: 0x600088A0, data-base: 0x60436000


ROM: System Bootstrap, Version 5.2(7b) [mkamson 7b],RELEASE


SOFTWARE (fc1)

: Boot ROM의 Bootstrap을 의미한다.


ROM: 4500 Bootstrap Software (C4500-BOOT-M), Version 10.3(7),


RELEASE SOFTWARE


(fc1):Bootflash Memory의 Image를 의미한다.


seoul uptime is 30 minutes


System restarted by power-on


System image file is "flash:c4500-i-mz.111-7", booted via flash

:flash에 의해 부팅되었으며 flash내 Image version이 11.1(7)임을 의미한다.


cisco 4500 (R4K) processor (revision D) with 8192K/4096K


bytes of memory.

:Main Memory가 8M이고 Shared Memory가 4M이다.


Processor board ID 04007035


R4700 processor, Implementation 33, Revision 1.0


G.703/E1 software, Version 1.0.


Bridging software.


X.25 software, Version 2.0, NET2, BFE and GOSIP compliant.


1 Ethernet/IEEE 802.3 interface.


4 Serial network interfaces.


128K bytes of non-volatile configuration memory.


4096K bytes of processor board System flash (Read/Write)


4096K bytes of processor board Boot flash (Read/Write)

:위에서는 라우터의 전반적인 하드웨어/소프트웨어 사양을 보여주고 있다.


Configuration register is 0x2102

: Boot field의 config-register가 0x2102로 되어있다.





[참 고]


: Privileged EXEC모드 관련 COMMAND


- CD - PWD - COPY


- DIR - PARTITION - FORMAT


- VERIFY - ERASE - DELETE / UNDELETE


- SQUEEZE




[참고2]


: 라우터와 메모리


1. Boot ROM


: bootstrap이 내장되어 있다.


2. ROM( bootflash )


: 부팅에 필요한 최소한의 기능이 내장된 image-file set 이 들어있다.


: bootflash memory 에 완전한 image-file set을 넣어 정상적인 부팅을
시도할수 있다.


3. Flash( system Flash = embedded Flash = internal Flash )


: 정상적인 부팅에 필요한 모든 기능이 내장된 image-file set 이 들어있다


4. RAM( Main Memory와 Shared Memory로 나뉘며 DRAM, SIMM등
여러 타입이 있다. )


: Main Memory는 image, routing table, protocols,기타 등에 이용되며


Shared Memory는 buffer로 이용된다.



[참고3]


: 라우터의 부팅과정


1. 라우터에 전원을 넣으면 프로세서가 먼저 H/W를 인식한 후에


2. Boot ROM에서 bootstrap을 Main Memory로 로딩한다.


3. 로딩된 bootstrap은 보통의 경우 먼저 Flash Memory에서
image-file을 Main Memory로 로딩


4. 다시 bootstrap은 NVRAM에서 Configuration을 Main Memory로 로딩한다.


5. 이후 Main Memory로 로딩된 image-file에 의해 라우터가 부팅을 하며
부팅된 라우터의 프로세서가 전반적인 설정환경등을 인식하여 기능을 수행한다.

Posted by theYoungman