D-H,appy

관리자 글쓰기
블로그 »
블로그 »

# 라우터(Router)

 - 라우팅(Routing) : Layer 3 계층 데이터 전송 처리(패켓 처리), IP 주소 사용
 - 데이터 전송시 참조하는 테이블 : 라우팅 테이블(Routing Protocol)
 - Cisco IOS 명령어를 이용하여 동작하는 소프트웨어 기반 장비
 - WAN 장비 : WAN 구간 인터페이스(시리얼), LAN 구간 인터페이스(이더넷)


# 스위치(Switch) <- Page 315 ~ 319

 - 스위칭(Switching) : Layer 2 계층 데이터 전송 처리(프레임 처리), MAC 주소 사용
 - 데이터 전송시 참조하는 테이블 : Mac 주소 테이블(Mac Address Table)
 - Cisco IOS 명령어를 사용하지 않아도 플러그 앤 플래이 방식으로 동작하는 하드웨어 기반 장비
 - LAN 장비 : LAN 구간 인터페이스(이더넷, 10M/100M/1G/10G)

# 트랜스퍼런트 브릿징 기능

1) Learning

2) Flooding

3) Filtering

4) Forwarding

5) Aging


# 플러딩(Flooding)이 실시되는 프레임 유형

 - 브로드케스트 프레임(FFFF.FFFF.FFFF)
 - 목적지를 알수 없는 유니케스트 프레임(Unknown 유니케스트 프레임)
 - 목적지를 알수 없는 멀티케스트 프레임(Unknown 멀티케스트 프레임)

Switch# show mac-address-table

          Mac Address Table
---------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0000.0c75.a10c    DYNAMIC     Fa0/3
   1    0014.697b.f3cb    DYNAMIC     Fa0/11
   1    0014.697b.f3cc    DYNAMIC     Fa0/12
   1    0030.8060.fb20    DYNAMIC     Fa0/11
   1    0060.5cf4.5b2e    DYNAMIC     Fa0/1
   2    00a0.8104.24c0    DYNAMIC     Fa0/6

Ex1) 출발지가 '0000.0C75.A10C'이고, 목적지가 '0060.5CF4.5B2E' 인
     유니케스트 프레임을 수신하면 어떤 포트를 이용하여 포워딩이 실시되는가?
     (Fa0/1, Fa0/3)

Ex2) 출발지가 '0000.0C75.A10C'이고, 목적지가 'FF-FF-FF-FF-FF-FF'인
       프레임을 Fa0/3으로 수신하면 어떻게 되는가?
     (VLAN 1에 소속된 Fa0/1, Fa0/11, Fa0/12로 플러딩 실시)

Ex3) 출발지가 '0000.0C75.A10C'이고, 목적지가 '0014.24FE.8F0B'인
       프레임을 Fa0/3으로 수신하면 어떻게 되는가?
     (VLAN 1에 소속된 Fa0/1, Fa0/11, Fa0/12로 플러딩 실시)

Ex4) 출발지가 '0001.0001.0001'이고, 목적지가 'FF-FF-FF-FF-FF-FF'인 프레임을
       Fa0/6으로 수신하면 어떻게 처리되는가?
       (1. Learning -> 2. Flooding 실시, 단 VLAN 2에 소속된 포트로만 실시)


# 스위치

 - LAN 구간에서 많은 이더넷 장치(PC NIC, 스위치, 허브, 라우터 이더넷 인터페이스)를
   연결하기 위한 목적으로 사용한다.

 - 스위치 각 포트들은 컬리전 도메인을 분할하여 컬리전 발생율을 최소화한다.

 - 스위치 각 포트들은 기본적으로 VLAN 1이라는 브로드케스트 도메인으로 소속되어
   동작하기때문에 이더넷 장치들이 증가되면 브로드케스트 플러딩양이 증가되는 문제가 있다.

 - 스위치는 프레임을 수신하면 'Mac-Address-Table'를 참조하여 프레임을 목적지
   해당 포트로 전송(Forwarding)한다.

 - 만약, 브로드케스트 프레임 & Unknown 유니케스트 프레임을 수신하면 모든 포트로
   플러딩(Flooding)을 실시한다.

 - 스위치 사용 목적

 1) 다양한 전송 속도 보장 (10M/100M/1G/10G)
   <- WAN 구간 메트로 이더넷 서비스에서도 사용한다.
 2) 양방향 데이터 전송 보장(Full Duplex)
 3) 각 포트로 컬리전 도메인 분할
 4) LAN 구간을 제어하는 다양한 기능 제공

    - VLAN : 증가되는 브로드케스트 트래픽양을 최소화하기 위한 기능
    - Spanning-Tree Protocol : 링크간 이중화 구현시 발생되는 브릿징 루프 방지 기능
    - Etherchannel : 물리적인 포트를 논리적인 포트로 구성하여 대역폭 향상 및 이중화 기능
    - 포트 보안 : 지정하지 않은 MAC 주소가 학습될 경우, 포트 상태를 제어하는 기능
    - SPAN(포트 미더링) : 내부 트래픽 분석

[참고] 원래 스위치 모든 포트는 기본적으로 'no shutdown' 상태, 즉 Layer 2 계층 동작이
          준비된 상태이므로 'no shutdown'이 필요가 없다.
          실습 장비는 Cisco 3745 라우터에 스위칭 모듈을 장착하는 장비이므로
          스위치 포트에 'no shutdown'을 실시해야 한다.

 - 실습시 스위치 포트 : Fa1/0 ~ Fa1/15

SW1(config)# int range fa1/0 , fa1/10
SW1(config-if-range)# no shutdown

SW2(config)# int range fa1/1 , fa1/11
SW2(config-if-range)# no shutdown


# 스위치 관리자용 IP 주소 설정

SW1(config)#int fa1/2
SW1(config-if)#ip address 2.2.2.2 255.255.255.0

% IP addresses may not be configured on L2 links.

 - 스위치 관리 목적상(Ping 테스트, Telnet 접속, Cisco IOS 업로드/다운로드) IP 주소가
    필요하다. 이러한 IP 주소를 관리자용 IP 주소라고 하며, VLAN 인터페이스에 설정을
    실시한다.

SW1(config)# int vlan 1
SW1(config-if)# ip address x.x.1.1 255.255.255.0
SW1(config-if)# no shutdown

SW2(config)# int vlan 1
SW2(config-if)# ip address x.x.1.2 255.255.255.0
SW2(config-if)# no shutdown

SW1# ping x.x.1.2
SW2# ping x.x.1.1


[참고] 스위치 VTY 패스워드 설정 (스위치는 기본 VTY 16개이다.)

Switch(config)# line vty 0 15
Switch(config-if)# password ciscotel
Switch(config-if)# login
Switch(config-if)# exit
Switch(config)# enable secret cisco


# 이더체널 (Etherchannel)

 - 스위치 물리적인 포트를 논리적인 포트로 구성하여 대역폭 향상 및 이중화 기능을 제공
 - Ex) Fa1/0, Fa1/1, Fa1/2, Fa1/3 -> 이더체널 구성 -> 400M
 - Cisco Catalyst 스위치는 최대 8개 포트를 이더체널 구성 가능
 - 사용 구간 : 트래픽 전송율이 많은 분배 계층, 서버가 밀집된 구간

     [Fa1/0]-------------------------------------[Fa1/1]
SW1                     SW2
     [Fa1/10]-----------------------------------[Fa1/11]

SW1(config)# interface port-channel 1 <- 이더체널 논리적인 포트 생성
SW1(config-if)# exit
SW1(config)# interface range fa1/0 , fa1/10 <- 이더체널에 소속되는 물리적인 포트
SW1(config-if-range)# channel-protocol [PAgP|LACP] <- 이더체널 프로토콜 선택 설정
SW1(config-if-range)# channel-group 1 mode [on|desirable|auto] <- 이너체널 그룹 설정

 - PAgP : Cisco에서 개발한 이더체널 프로토콜, Cisco 장비에서만 동작 가능
 - LACP : IEEE에서 개발한 표준 이더체널 프로토콜

 - on : 이더체널 프로토콜 사용 X, 수동으로 이더체널 구성
 - auto : 이더체널 프로토콜 사용 O, 상대방 스위치 정보에 의해서 이더체널 시작(대기 상태)
 - desirable : 이더체널 프로토콜 사용 O, 상대방 스위치와 이더체널 정보를 교환하여 이더 체널 시작


SW1   SW2

on   on
auto   desirable (on/auto X)
desirable   auto
desirable   desirable  <- 권장 모드


Ex) LAB : 25 이더체널 실습 (실습 장비에는 on 모드만 지원됨)

     [Fa1/0]-------------------------------------[Fa1/1]
SW1                     SW2
     [Fa1/10]-----------------------------------[Fa1/11]


SW1(config)# int port-channel 1
SW1(config-if)# exit
SW1(config)# int range fa1/0 , fa1/10
SW1(config-if-range)# channel-group 1 mode on

SW2(config)# int port-channel 1
SW2(config-if)# exit
SW2(config)# int range fa1/1 , fa1/11
SW2(config-if-range)# channel-group 1 mode on

 - SW1,SW2에서 'show etherchannel summary' 확인 실시
 - SW1,SW2에서 'show interface port-channel 1'를 실시하여 BW 확인(200M)


SW1# show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel   Ports
-----+------------+-----------------------------------------------------------
1      Po1(SU)          Fa1/0(P)   Fa1/10(P)


SW1# show interfaces port-channel 1
Port-channel1 is up, line protocol is up
  Hardware is EtherChannel, address is c400.03d8.f100 (bia c400.03d8.f100)
  MTU 1500 bytes, BW 200000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s
  Members in this channel: Fa1/0 Fa1/10

if) SW1 fa1/10 장애가 발생된 경우

SW1(config)# int fa1/10
SW1(config-if)# shutdown

SW1# show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1       Po1(SU)         Fa1/0(P)   Fa1/10(D) 

SW1# show interface port-channel 1
Port-channel1 is up, line protocol is up
  Hardware is EtherChannel, address is c400.03d8.f100 (bia c400.03d8.f100)
  MTU 1500 bytes, BW 100000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s
  Members in this channel: Fa1/0






# Range

 - 스위치는 보통 동일한 설정이 반복되는 경우가 많기 때문에 'range' 키워드를 사용하면 효율적이다.

Ex1) Fa1/0 ~ Fa1/5

int range fa1/0 - 5

Ex2) Fa1/1, Fa1/3, Fa1/5

int range fa1/1 , fa1/3 , fa1/5

Ex3) Fa1/0, Fa1/1, Fa1/2, Fa1/5, Fa1/6, Fa1/7, Fa1/10, fa1/11

int range fa1/0 - 2 , fa1/5 - 7 , fa1/10 - 11

Ex4) Fa1/1, Fa1/2, Fa1/3, Fa1/4, Fa1/6, Fa1/7, Fa1/8, fa1/13, fa1/15

int range fa1/1 - 4 , fa1/6 - 8 , fa1/13 , fa1/15




 

2008/05/29 15:06 2008/05/29 15:06

(go to top)

블로그 »

# 패켓 스위칭(Packet Switching)

 - 라우팅(Routing) : Layer 3 계층 데이터 전송 처리, Layer 3 계층 주소 사용(IP 주소)
 - 스위칭(Switching) : Layer 2 계층 데이터 전송 처리, Layer 2 계층 주소 사용(MAC/DLCI 주소)

 - 패켓(Packet) : Layer 3 계층 데이터 단위
 - 프레임(Frame) : Layer 2 계층 데이터 단위

# Frame-Relay 패켓 스위칭망 (Ex : LG 데이콤)

 - 하나의 본사에 여러개의 지사와 WAN 환경을 구성하며, 비용 절감을 위해서 사용한다.

 - ARP : Layer 3 계층 주소(IP)를 이용하여 Layer 2 계층 주소(MAC)를 학습하는 기능
 - Inverse-ARP : Layer 2 계층 주소(DLCI)를 이용하여 Layer 3 계층 주소(IP)를 학습하는 기능

1) Frame-Relay 동적 기본 설정(Inverse-ARP 사용)

R1(config)# int s1/3
R1(config-if)# ip address x.x.123.1 255.255.255.0
R1(config-if)# encapsulation frame-relay
R1(config-if)# frame-relay inverse-arp <- 기본 설정되어 있기때문에 설정 불필요
R1(config-if)# no shutdown

R2(config)# int s1/3
R2(config-if)# ip address x.x.123.2 255.255.255.0
R2(config-if)# encapsulation frame-relay
R2(config-if)# frame-relay inverse-arp <- 기본 설정되어 있기때문에 설정 불필요
R2(config-if)# no shutdown

R3(config)# int s1/3
R3(config-if)# ip address x.x.123.3 255.255.255.0
R3(config-if)# encapsulation frame-relay
R3(config-if)# frame-relay inverse-arp <- 기본 설정되어 있기때문에 설정 불필요
R3(config-if)# no shutdown

 - R1,R2,R3에서 'show frame-relay map' 명령어를 이용하여 학습한 Frame-Relay MAP 확인

R1# show frame-relay map
Serial1/3 (up): ip 13.13.123.2 dlci 102(0x66,0x1860), dynamic,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.3 dlci 103(0x67,0x1870), dynamic,
              broadcast,
              CISCO, status defined, active

R2# show frame-relay map
Serial1/3 (up): ip 13.13.123.1 dlci 201(0xC9,0x3090), dynamic,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.3 dlci 203(0xCB,0x30B0), dynamic,
              broadcast,
              CISCO, status defined, active

R3# show frame-relay map
Serial1/3 (up): ip 13.13.123.1 dlci 301(0x12D,0x48D0), dynamic,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.2 dlci 302(0x12E,0x48E0), dynamic,
              broadcast,
              CISCO, status defined, active


2) Frame-Relay 정적 매핑 설정

 Hub 라우터 : R1
 Spoke 라우터 : R2&R3

R1(config)# int s1/3
R1(config-if)# ip address x.x.123.1 255.255.255.0
R1(config-if)# encapsulation frame-relay
R1(config-if)# no frame-relay inverse-arp
R1(config-if)# frame-relay map ip x.x.123.2 102 broadcast
R1(config-if)# frame-relay map ip x.x.123.3 103 broadcast
R1(config-if)# no shutdown

R2(config)# int s1/3
R2(config-if)# ip address x.x.123.2 255.255.255.0
R2(config-if)# encapsulation frame-relay
R2(config-if)# no frame-relay inverse-arp
R2(config-if)# frame-relay map ip x.x.123.1 201 broadcast
R2(config-if)# frame-relay map ip x.x.123.3 201 broadcast
R2(config-if)# no shutdown

R3(config)# int s1/3
R3(config-if)# ip address x.x.123.3 255.255.255.0
R3(config-if)# encapsulation frame-relay
R3(config-if)# no frame-relay inverse-arp
R3(config-if)# frame-relay map ip x.x.123.1 301 broadcast
R3(config-if)# frame-relay map ip x.x.123.2 301 broadcast
R3(config-if)# no shutdown

 - R1,R2,R3에서 'show frame-relay map' 명령어를 이용하여 학습한 Frame-Relay MAP 확인

R1#show frame-relay map
Serial1/3 (up): ip 13.13.123.2 dlci 102(0x66,0x1860), static,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.3 dlci 103(0x67,0x1870), static,
              broadcast,
              CISCO, status defined, active


R2#show frame-relay map
Serial1/3 (up): ip 13.13.123.1 dlci 201(0xC9,0x3090), static,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.3 dlci 201(0xC9,0x3090), static,
              broadcast,
              CISCO, status defined, active

R3#show frame-relay map
Serial1/3 (up): ip 13.13.123.1 dlci 301(0x12D,0x48D0), static,
              broadcast,
              CISCO, status defined, active
Serial1/3 (up): ip 13.13.123.2 dlci 301(0x12D,0x48D0), static,
              broadcast,
              CISCO, status defined, active

[참고] Frame-Relay NBMA 환경과 Distance Vector 라우팅 프로토콜(RIPv1/v2, IGRP, EIGRP) 관계

R1,R2,R3(config)# router rip
R1,R2,R3(config-router)# version 2
R1,R2,R3(config-router)# no auto-summary
R1,R2,R3(config-router)# network x.0.0.0

R1,R2,R3# show ip route


R1#show ip interface s1/3
Serial1/3 is up, line protocol is up
  Internet address is 13.13.123.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.9
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  Security level is default
  Split horizon is disabled <- 자동으로 Disable 상태이다.

 - Frame-Relay를 주인터페이스에 설정하면 자동으로 Split-Horizon을 Disable하여 Distance Vector
   라우팅 업데이트가 가능하도록 한다.

 - Router(config-if)# ip split-horizon
 - Router(config-if)# no ip split-horizon


R1,R2,R3(config)# default int s1/3
R1,R2,R3(config)# int s1/3
R1,R2,R3(config-if)# shutdown


3. Sub-Interface를 이용한 'Split-Horizon' 이슈 문제 해결 및 확장성 제공하는 설정

Router(config)# int s1/3
Router(config-if)# encapsulation frame-relay
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)#
Router(config)# int s1/3.?
  <0-4294967295>  Serial interface number <- 서브 인터페이스 범위(32bit)

Router(config)# int s1/3.12 ?
  multipoint        Treat as a multipoint link <- NBMA 네트워크 환경
  point-to-point  Treat as a point-to-point link <- 점 대 점 네트워크 환경


[LAB 20 : Frame-Relay Point-to-Point - Dynamips -]

 1) 서브-인터페이스를 이용한 Point-to-Point 환경 설정 (점-대-점 환경)

 - Hub 라우터 : R1

 - Spoke 라우터 : R2(S1/3.12 : x.x.12.2/24)
                        R3(S1/3.13 : x.x.13.3/24)

 R1-R2 서브넷 : x.x.12.y/24
 R2-R3 서브넷 : x.x.13.y/24

R1(config)# int s1/3
R1(config-if)# encapsulation frame-relay
R1(config-if)# no shutdown
R1(config-if)# int s1/3.12 point-to-point <- R2와 점대점 환경 서브 인터페이스
R1(config-subif)# ip address x.x.12.1 255.255.255.0
R1(config-subif)# frame-relay interface-dlci 102
R1(config-subif)# int s1/3.13 point-to-point <- R3와 점대점 환경 서브 인터페이스
R1(config-subif)# ip address x.x.13.1 255.255.255.0
R1(config-subif)# frame-relay interface-dlci 103

R2(config)# int s1/3
R2(config-if)# encapsulation frame-relay
R2(config-if)# no shutdown
R2(config-if)# int s1/3.12 point-to-point <- R1과 점대점 환경 서브 인터페이스
R2(config-subif)# ip address x.x.12.2 255.255.255.0
R2(config-subif)# frame-relay interface-dlci 201

R3(config)# int s1/3
R3(config-if)# encapsulation frame-relay
R3(config-if)# no shutdown
R3(config-if)# int s1/3.13 point-to-point <- R1과 점대점 환경 서브 인터페이스
R3(config-subif)# ip address x.x.13.3 255.255.255.0
R3(config-subif)# frame-relay interface-dlci 301


R1# show ip interface s1/3.12


R1(config)# no int s1/3.12
R1(config)# no int s1/3.13

R2(config)# no int s1/3.12

R3(config)# no int s1/3.13

 - 서브 인터페이스는 삭제할수 있으나, 다시 생성할 경우 해당 Link-Type으로 복구가 된다.

Router(config)# no int s1/3.12
Not all config may be removed and may reappear after reactivating the sub-interface

Router(config)# int s1/3.12 multipoint
% Warning:  cannot change link type

 - 완전 삭제를 하기 위해서는 서브 인터페이스를 삭제한 이후, 설정 내용을 NVRAM에 저장하고
    라우터를 reload(재부팅)를 실시한다.


2) 서브-인터페이스를 이용한 Multipoint 환경 설정(NBMA 환경) <- 정적 매핑

 - Hub 라우터 : R1(S1/3.123 : x.x.123.1/24)

 - Spoke 라우터 : R2(S1/3.123 : x.x.123.2/24)
                       R3(S1/3.123 : x.x.123.3/24)


R1(config)# in s1/3
R1(config-if)# encapsulation frame-relay
R1(config-if)# no frame-relay inverse-arp
R1(config-if)# no shutdown
R1(config-if)# int s1/3.123 multipoint
R1(config-subif)# ip address x.x.123.1 255.255.255.0
R1(config-subif)# frame-relay map ip x.x.123.2 102 broadcast
R1(config-subif)# frame-relay map ip x.x.123.3 103 broadcast
R1(config-subif)# no ip split-horizon

R2(config)# int s1/3
R2(config-if)# encapsulation frame-relay
R2(config-if)# no frame-relay inverse-arp
R2(config-if)# no shutdown
R2(config-if)# int s1/3.123 multipoint
R2(config-subif)# ip address x.x.123.2 255.255.255.0
R2(config-subif)# frame-relay map ip x.x.123.1 201 broadcast
R2(config-subif)# frame-relay map ip x.x.123.3 201 broadcast

R3(config)# int s1/3
R3(config-if)# encapsulation frame-relay
R3(config-if)# no frame-relay inverse-arp
R3(config-if)# no shutdown
R3(config-if)# int s1/3.123 multipoint
R3(config-subif)# ip address x.x.123.3 255.255.255.0
R3(config-subif)# frame-relay map ip x.x.123.1 301 broadcast
R3(config-subif)# frame-relay map ip x.x.123.2 301 broadcast

 - R1,R2,R3에서 'show frame-relay map' 명령어를 이용하여 Frame-Relay Map 정보 확인

R1# show frame-relay map
Serial1/3.123 (up): ip 13.13.123.2 dlci 102(0x66,0x1860), static,
              broadcast,
              CISCO, status defined, active
Serial1/3.123 (up): ip 13.13.123.3 dlci 103(0x67,0x1870), static,
              broadcast,
              CISCO, status defined, active

R2# show frame-relay map
Serial1/3.123 (up): ip 13.13.123.1 dlci 201(0xC9,0x3090), static,
              broadcast,
              CISCO, status defined, active
Serial1/3.123 (up): ip 13.13.123.3 dlci 201(0xC9,0x3090), static,
              broadcast,
              CISCO, status defined, active

R3# show frame-relay map
Serial1/3.123 (up): ip 13.13.123.1 dlci 301(0x12D,0x48D0), static,
              broadcast,
              CISCO, status defined, active
Serial1/3.123 (up): ip 13.13.123.2 dlci 301(0x12D,0x48D0), static,
              broadcast,
              CISCO, status defined, active

 - R1,R2,R3에서 'show ip route' 명령어를 실시하여 RIPv2 업데이트 정보 확인
 - R1,R2,R3에서 Ping 테스트 실시

R1# ping x.x.2.1
R1# ping x.x.3.1

R2# ping x.x.1.1
R2# ping x.x.3.1

R3# ping x.x.1.1
R3# ping x.x.2.1


2008/05/28 15:41 2008/05/28 15:41

(go to top)

블로그 »

# NAT(Network Address Translation)

 - NAT : 네트워크 주소 변환 장치/기능

 - NAT를 사용하는 이유

 1) 출발지 주소를 변경하여 외부로 접근하기 때문에 외부로부터 실제 로컬 시스템
     IP 주소를 보호할 수 있는 장점을 갖고 있다.

 2) 내부는 사설 IP 주소를 사용하여 인터넷 접근을 실시할때 소수의 공인 IP 주소로
     변경하게되면, IPv4 주소 고갈 문제를 해결할 수 있다.

[참고] 사설 IP 주소

   A Class 10.0.0.0/8

   B Class 172.16.0.0/12

   C Class 192.168.0.0/16


 - NAT 구성

 1) NAT Inside와 NAT Outside를 구분한다.
 2) 주소 변환을 당할 대상인 Inside Local 주소를 조사한다. (Ex : 사설 IP 주소)
 3) 외부로 변환되어 나갈 Inside Global 주소를 조사한다. (Ex : 공인 IP 주소)

 - NAT 주소 변환 단계

 1) 데이터 요청 : 내부 -> 외부 : 출발지 주소를 변경
 2) 데이터 응답 : 외부 -> 내부 : 목적지 주소를 변경


 - NAT 유형

1) Static NAT (정적 NAT)

  - 내부 특정 서버/호스트(FTP 서버, 웹-서버, 이메일 서버)가 외부로 접근할때
     주소 변환시 사용한다.

 Inside Local 주소 : x.x.23.3
 Inside Global 주소 : x.x.12.2

R2(config)# ip nat inside source static x.x.23.3 x.x.12.2
R2(config)# int fa2/0
R2(config-if)# ip nat inside
R2(config-if)# int s1/1
R2(config-if)# ip nat outside

R2#show ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
--- 13.13.12.2         13.13.23.3         ---                ---

R2#debug ip nat
IP NAT debugging is on

R1# ping x.x.12.2


R2#
*Mar  1 01:14:39.871: NAT*: s=13.13.12.1, d=13.13.12.2->13.13.23.3 [0]
*Mar  1 01:14:40.007: NAT*: s=13.13.23.3->13.13.12.2, d=13.13.12.1 [0]
*Mar  1 01:14:40.091: NAT*: s=13.13.12.1, d=13.13.12.2->13.13.23.3 [1]
*Mar  1 01:14:40.167: NAT*: s=13.13.23.3->13.13.12.2, d=13.13.12.1 [1]
*Mar  1 01:14:40.263: NAT*: s=13.13.12.1, d=13.13.12.2->13.13.23.3 [2]
*Mar  1 01:14:40.335: NAT*: s=13.13.23.3->13.13.12.2, d=13.13.12.1 [2]
*Mar  1 01:14:40.503: NAT*: s=13.13.12.1, d=13.13.12.2->13.13.23.3 [3]
*Mar  1 01:14:40.599: NAT*: s=13.13.23.3->13.13.12.2, d=13.13.12.1 [3]
*Mar  1 01:14:40.695: NAT*: s=13.13.12.1, d=13.13.12.2->13.13.23.3 [4]
R2#
*Mar  1 01:14:40.835: NAT*: s=13.13.23.3->13.13.12.2, d=13.13.12.1 [4]


2) Dynamic NAT(동적 NAT)

 1. 주소 변환을 당할 대상인 Inside Local 주소를 ACL로 설정한다.
 2. 외부로 변경되어 나갈 Inside Global 주소를 NAT Pool로 설정한다.
 3. 'ip nat inside source' 명령어를 이용하여 NAT 정책을 실시한다.
 4. 해당 인터페이스 Inside/Outside를 적용한다.

 Inside Local 주소 : x.x.23.5 ~ x.x.23.9
 Inside Global 주소 : x.x.12.100

 x.x.23.00000101
 x.x.23.00000110
 x.x.23.00000111
 x.x.23.00001000
 x.x.23.00001001
----------------
 0.0. 0.00001111 <- 0.0.0.15

R2(config)# access-list 13 permit x.x.23.0 0.0.0.15
R2(config)# ip nat pool CCNA x.x.12.100 x.x.12.100 netmask 255.255.255.0
R2(config)# ip nat inside source list 13 pool CCNA overload
R2(config)# int fa2/0
R2(config-if)# ip nat inside
R2(config-if)# int s1/1
R2(config-if)# ip nat outside

R3(config)# int fa2/0
R3(config-if)# ip address x.x.23.5 255.255.255.0 secondary
R3(config-if)# ip address x.x.23.6 255.255.255.0 secondary
R3(config-if)# ip address x.x.23.7 255.255.255.0 secondary
R3(config-if)# ip address x.x.23.8 255.255.255.0 secondary
R3(config-if)# ip address x.x.23.9 255.255.255.0 secondary

R2# debug ip rip

R3# ping 172.16.1.1 source x.x.23.5
R3# ping 172.16.1.1 source x.x.23.6
R3# ping 172.16.1.1 source x.x.23.7
R3# ping 172.16.1.1 source x.x.23.8
R3# ping 172.16.1.1 source x.x.23.9

R2#show ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
--- 13.13.12.2         13.13.23.3         ---                ---
icmp 13.13.12.100:6    13.13.23.5:6       172.16.1.1:6       172.16.1.1:6
icmp 13.13.12.100:7    13.13.23.6:7       172.16.1.1:7       172.16.1.1:7
icmp 13.13.12.100:8    13.13.23.7:8       172.16.1.1:8       172.16.1.1:8
icmp 13.13.12.100:9    13.13.23.8:9       172.16.1.1:9       172.16.1.1:9
icmp 13.13.12.100:10   13.13.23.9:10     172.16.1.1:10      172.16.1.1:10


# DHCP(Dynamic Host Configuration Protocol)

R3(config)# int fa2/0
R3(config-if)# no ip address

 - DHCP : 동적 IP 주소 할당 장치/기능

 - PC들은 부팅이 완료되면 TCP/IP 네트워크에 참여하기 위해서 자신이 사용해야할
    IP 주소 정보(IP 주소, 서브넷 마스크, 기본 게이트웨이, DNS 서버...)를 찾느다.

 - DHCP 서버 : UDP 67
 - DHCP 클라이언트 : UDP 68

 - DHCP는 임대 서비스이다.

 - DHCP 동작 과정 4 단계

1. DHCP Discover : 클라이언트 -> 서버에게 'Discover' 메세지 전송

출발지 포트 번호 : 68
목적지 포트 번호 : 67
출발지 IP 주소 : 0.0.0.0
목적지 IP 주소 : 255.255.255.255

 - 'Discover' 메세지를 수신한 서버는 클라이언트에게 임대할 IP 주소로
    ICMP 에코를 전송하여 IP 중복 여부를 판단한다. <- 유니케스트

2. DHCP Offer : 서버 -> 클라이언트에게 'Offer' 메세지 전송

출발지 포트 번호 : 67
목적지 포트 번호 : 68
출발지 IP 주소 : DHCP 서버 IP 주소
목적지 IP 주소 : 255.255.255.255

3. DHCP Request : 클라이언트 -> 서버에게 'Request' 메세지 전송

출발지 포트 번호 : 68
목적지 포트 번호 : 67
출발지 IP 주소 : 0.0.0.0
목적지 IP 주소 : 255.255.255.255

4. DHCP Ack : 서버 -> 클라이언터 'Ack' 메세지 전송

출발지 포트 번호 : 67
목적지 포트 번호 : 68
출발지 IP 주소 : DHCP 서버 IP 주소
목적지 IP 주소 : 255.255.255.255


 - DHCP 클라이언트 구성

R3(config)# int fa2/0
R3(config-if)# ip address dhcp

 - DHCP 서버 구성

    a. 할당 IP 네트워크 대역 : x.x.23.0/24 <- x.x.23.1 ~ x.x.23.254
    b. 디폴트 게이트 웨이 IP 주소 : x.x.23.2
    c. DNS 서버 IP 주소 : x.x.23.250 x.x.23.251 <- 내부 DNS 서버
    d. NetBIOS 서버 IP 주소 : x.x.23.252 x.x.23.253 <- 내부 WINS 서버
    e. 임대 기간 : 무제한
    f. 도메인 이름 : cisco.com

R2(config)# ip dhcp excluded-address x.x.23.1 x.x.23.2
R2(config)# ip dhcp excluded-address x.x.23.250 x.x.23.253
R2(config)# ip dhcp pool CCNA
R2(dhcp-config)# network x.x.23.0 255.255.255.0
R2(dhcp-config)# default-router x.x.23.2
R2(dhcp-config)# dns-server x.x.23.250 x.x.23.251
R2(dhcp-config)# netbios-name-server x.x.23.252 x.x.23.253
R2(dhcp-config)# lease
R2(dhcp-config)# lease infinite
R2(dhcp-config)# domain-name cisco.com
R2(dhcp-config)# exit
R2(config)# service dhcp

R3#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            13.13.3.1       YES manual up                    up     
Serial1/0                  unassigned      YES unset  administratively down down   
Serial1/1                  unassigned      YES manual administratively down down   
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
FastEthernet2/0            13.13.23.3      YES DHCP   up                    up     
Loopback172                172.16.3.1      YES manual up                    up     

R2#show ip dhcp server statistics
Memory usage         24060
Address pools        1
Database agents      0
Automatic bindings   1
Manual bindings      0
Expired bindings     0
Malformed messages   0
Secure arp entries   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         9
DHCPREQUEST          1
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            1
DHCPACK              1
DHCPNAK              0
R2#


2008/05/27 18:11 2008/05/27 18:11

(go to top)