[Cisco] NAT Config 해설

Network Address Translation(NAT)은 2개의 네트워크를 연결하는 라우터에서만 설정이 가능하다.프라이빗 어드
레스(Private Address)나 비공인 IP Address를 사용하는 내부 네트워크의 트래픽이 다른 외부 네트워크에 패킷
을 전송하기 전에 공인 IP 어드레스로 변환 시켜야 한다.

이 어드레스 변환처리는 변환이 필요한 장소의 라우터 에 NAT를 설정하여 라우팅과 연동시킨다.
여기서 다룰 시스코 IOS의 NAT는 RFC 1631을 지원한다.
물론 CISCO IOS는 NAT를지원하는 소프트 웨어야 한다.

1 사용되는 용어

NAT기능이 내장된 라우터를 인터넷과 연결되는 부분에 설치하면 내부 보안 및 공인 IP Address 부족을 해결할
수 있다. 따라서이 장비를 이용하면 효과적일 것이다.

-내부(inside)
어드레스 변환의 대상이 되는 내부 사설 네트워크 군이다.

-외부(outside)
다른 네트워크를 의미한다. 통상적으로 인터넷을 의미한다.

-내부 로컬 IP 어드레스(Inside Local IP Address)
내부네트워크의 호스트에 부여되는 사설 IP 어드레스로서 내부적으로 중복되지않는 어드레스다. 비공인 IP를 사
용토록 권장한다. 이 어드레스는 외부쪽(인터넷)으로 라우팅 되지 않는다. 외부쪽에서 라우팅이 되더라도 이 어
드레스는 실제로는 타조직에 이미 할당된 어드레스다. 따라서 프라이빗 어드레스 사용을 권장한다.

-내부 글로벌 IP 어드레스(Inside Global IP Address)
내부 호스트의 IP 어드레스와 대응되는 외부의 공인 IP 어드레스이다. 내부 사용자의 IP 어드레스가 이 글로벌(공
인) 어드레스로 변환되어 나간다. 이 어드레스는 인터넷에서유일한 어드레스여야 한다.

-단순 변환 엔트리(Simple Translation Entry)
기존 IP 어드레스와 다른 IP 어드레스를 대응시키는 변환 테이블의 엔트리이다.

-확장 변환 엔트리(Extended Translation Entry)
IP 어드레스와 포트번호 쌍을 대응시키는 변환 테이블의 엔트리이다.

2 사용되는 주요 기능

-스태틱 어드레스 변환(Static Address Translation)
내부 로컬 어드레스와 글로벌 어드레스를 1대 1로 매핑하여 설정할 수 있다.

-다이나믹 소스 어드레스 변환(Dynamic Source Address Translation)
내부 로컬 어드레스와 글로벌 어드레스의 매핑을 동적으로 작성할 수 있다. 글로벌어드레스에 할당된 어드레스
는 어드레스 풀(Address pool)에 저장한다. 로컬어드레스가 자신의 소스어드레스를 어드레스 풀에 있는 글로벌
어드레스로 변환시킨다. 그리고 변화된 어드레스는 변환 테이블 엔트리에 등록된다.

-다이나믹 포트 변환(Dynamic Port Translation)
글로벌 어드레스 풀에 있는 어드레스를 절약하기 위해 TCP또는 UDP의 소스포트를 사용해서 변환할 수 있다. 여
러개의 로컬 어드레스가 동일한 그로벌 IP 어드레스를 사용하더라도 포트 번호로 구분할 수 있다. 따라서 변환
이 필요할 때에는 Berkeley Standard Distribution의 협정에 따라서 오리지널과 같은 영역(1-->511, 512-->1023
1024-->4999,5000-->65535)에 있는 새로운 포트 번호를 선택한다.

-도착지 어드레스 로타리 변환(Destination Address Rotary Translation)
다이나믹 도착지 변환은 외부에서 내부로 특정 트래픽을 통과하도록 설정할 수 있다. 매핑이 설정되면 액세스
리스트의 어드레스에 있는 매치되는 도착지 어드레스는 로컬 풀에 있는 어드레스로 치환된다. 이 어드레스의 할
당에는 외부에서 내부로 새로운 커넥션이 확립될 때만 라운드 로빈 방식으로 할당된다.

3 설정 커맨드

-인터페이스 설정 커맨드

커맨드 : ip nat { inside | outside }
설  명 : 인터페이스 내부인지 외부인지 표시할 필요가 있다. 표시된 인터페이스에 속한 패킷만이 변환의 대상이
된다.

-----------------------------------------------------------------------------------------------------------
ex)
interface ethernet0
ip address 10.1.1.10 255.255.255.0
ip nat inside
!
interface serial0
ip address 172.16.2.1 255.255.255.0
ip nat outside
!

설명)
interface에서 외부로 나가기위한 인터페이스 에서는 ip nat outside 하고 내부 인터페이스에게는 ip nat inside 해
주면 됩니다.
----------------------------------------------------------------------------------------------------------

-글로벌 설정 커맨드

[ ip pool 의 정의 ]

커맨드 : ip nat pool <name> <start-ip> <end-ip> { netmask <netmask> | prefix-length
<prefix-length> } [ type {
rotary} ]

----------------------------------------------------------------------------------------------------------
ex)
ip nat pool dyn-nat 192.168.2.1 192.168.2.254 netmake 255.255.255.0

설 명 : 풀에 있는 어드레스는 start address, end address와 netmask를 사용해서 정의 한다. 이들 어드레스는 필
요에 따라서 할당된다.
----------------------------------------------------------------------------------------------------------

[ 내부 소스 어드레스를 변환을 가능하게 한다.]

커맨드 : ip nat inside source { list < acl > pool < name > [overload] | static < local-ip > <
global-ip > }
----------------------------------------------------------------------------------------------------------
ex)
ip nat inside source list 1 pool dyn-nat overload

설 명 : 최초의 커맨드는 다이나믹 변환을 설정하는 커맨드이다. 이 간단한 엑세스 리스트에 해당하는 어드레스
가 있으면 지정된 풀에서 할당된 글로벌 어드레스를 사용해서 변환한다, 옵션의 키워드를 사용해서 UDP와 TCP
의 포트 변환도 가능하다. overload라는 옵션을 주게 되면 NAT Table은 Extended entry를 가지게 됩니다. 그것은
옵션을 주기 않게 되면 내부 IP 하나당 외부 IP 하나씩 할당을 받아서 나가는데 overload 옵션을 주게 되면 포트
를 가지고 나갑니다.. 하나의 IP를 가지고 여려사람이 이용할 수 있겠죠....
----------------------------------------------------------------------------------------------------------

다음 커맨드는 스태틱 변환을 설정하는 커맨드다.

[ 내부 도착지 어드레스를 변환을 가능하게 한다.]

커맨드 : ip nat inside destination { list < acl > pool < name > | static < global-ip > < local-ip
> }
설 명 : 이 커맨드는 소스 변환 커맨드와 유사하다. 다이나믹 변환과 같이 풀은 로컬 타입으로 한다.

[ 외부 소스 어드레스의 변환을 가능하게 한다.]

커맨드 : ip nat outside source { list < acl > pool < name > | static < global-ip > < local-ip >
}
설 명 : 최초 커맨드(list...pool..)는 다이내믹 변환을 가능하도록 설정한다.  패킷의 어드레스가 이 간단한 엑세
스 리스트에 있는 어드레스와 매칭이 되면  지정된 풀 에서 할당된 로컬 어드레스를 사용해서 변환시킨다.
두번째 커맨드 static는 스태틱 변환을 설정하는 커맨드이다.

[ 변환 타임아웃(timeout)을 설정한다.]

커맨드 : ip nat translation timeout < seconds >
             ip nat translation udp-timeout <seconds>
             ip nat translation dns-timeout <seconds>
             ip nat translation tcp-timeout <seconds>
             ip nat translation finrst-timeout <seconds>

설 명 : 다이나믹 변환은 내부 사용자가 사용하지 않은 상태로 일정시간이 경과되면 변환 테이블의 해당 엔트리
를 타임아웃시킨다. 포트 변환이 설정되어 있지 않을때에 변환 테이블의 엔트리는 24시간 후에 타임아웃된다.

[ Exec 커맨드 ]

커맨드 : show ip nat translation [ verboss ]
설 명 : 액티브한 변환을 확인한다.

커맨드 : show ip nat statics
설 명 : 변환 통계를 확인한다.

커맨드 : clear ip nat translation *
설 명 : 전 다이나믹 변환을 해제한다.

커맨드 : clear ip nat translation < global-ip >
설 명 : 단순한 다이나믹 변환을 해제한다.

커맨드 : clear ip nat translation < global-ip > < local-ip > < proto > < global-port > <
local-port >
설 명 : 특정 다이나믹 변환을 해제한다.

커맨드 : debug ip nat [ <list> ] [ detailed ]
설 명 : 디버그

[ config 예1 ]

라우터 조건 : Version : 11.2(9) 이상 ,메모리 : 8M 이상(C1000 시리즈인 경우)

router#sh ver - 먼저 버전 확인
Cisco Internetwork Operating System Software
IOS (tm) 1005 Software (C1005-BNSY-M), Version 11.2(9), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1997 by cisco Systems, Inc.
Compiled Mon 22-Sep-97 21:53 by ckralik
Image text-base: 0x02004000, data-base: 0x023CB294

ROM: System Bootstrap, Version 5.3.2(9) [vatran 9], RELEASE SOFTWARE (fc1)
BOOTFLASH: 1000 Bootstrap Software (C1000-RBOOT-R), Version 10.3(9), RELEASE SOF
TWARE (fc1)

router uptime is 2 hours, 17 minutes
System restarted by power-on
System image file is "flash:c1005-bnsy-mz.112-9", booted via flash

cisco 1000 (68360) processor (revision @) with 7680K/512K bytes of memory.
Processor board ID 04836644
Bridging software.
X.25 software, Version 2.0, NET2, BFE and GOSIP compliant.
1 Ethernet/IEEE 802.3 interface(s)
1 Serial network interface(s)
8K bytes of non-volatile configuration memory.
2048K bytes of processor board PCMCIA flash (Read/Write)

Configuration register is 0x2102

2.Cisco 1005 Config 내역

router#sh config
Using 688 out of 7506 bytes
!
version 11.2
no service pad
service udp-small-servers
service tcp-small-servers
!
hostname router
!
enable secret 5 $1$hhG6$C8XU.Ph/ALfd8bBtOH.zK.
enable password router
!
ip nat pool cks 210.101.66.182 210.101.66.182 netmask 255.255.255.252
ip nat inside source list 1 pool cks overload
!
interface Ethernet0
ip address 200.200.200.254 255.255.255.0
ip nat inside
!
interface Serial0
ip address 210.101.66.182 255.255.255.252
ip nat outside
encapsulation ppp
!
router rip
network 200.200.200.0
network 210.101.66.0
!
no ip classless
ip route 0.0.0.0 0.0.0.0 210.101.66.181
access-list 1 permit 200.200.200.0 0.0.0.255
!
line con 0
line vty 0 4
password router
login
!
end


[ config 예2 ]

Bluehill#sh conf
Using 1937 out of 32762 bytes
!
version 11.2
service timestamps debug datetime localtime
service timestamps log datetime localtime
no service udp-small-servers
no service tcp-small-servers
!
hostname router
!
enable secret 5 $1$m5fp$oTlTNpBGcNvfR2ONCQPqj/
enable password kim
!
ip subnet-zero
ip nat translation timeout 300
ip nat translation tcp-timeout 300
ip nat pool hansol 210.101.116.1 210.101.116.254 netmask 255.255.255.0
ip nat inside source list 10 pool hansol
ip name-server 210.116.254.1
!
interface Ethernet0
ip address 133.10.60.5 255.255.0.0
no ip mroute-cache
ip nat inside
!
interface Serial0
no ip address
no ip mroute-cache
encapsulation frame-relay
bandwidth 128
shutdown
frame-relay lmi-type ansi
!
interface Serial0.1 multipoint - F/R PORT 사용
ip address 210.116.246.103 255.255.255.240
ip accounting output-packets
no ip mroute-cache
ip nat outside
frame-relay interface-dlci 700
!
interface Serial1
ip address 210.101.117.34 255.255.255.252
ip accounting output-packets
no ip mroute-cache
no ip route-cache
ip nat outside
!
router rip
passive-interface Ethernet0
network 133.10.0.0
network 168.126.0.0
network 210.101.116.0
network 210.121.42.0
network 210.121.43.0
distribute-list 77 out Serial0.1
!
ip http server
ip http port 90
ip classless
ip route 0.0.0.0 0.0.0.0 210.101.117.33
ip route 0.0.0.0 0.0.0.0 168.126.148.49
ip route 133.10.0.0 255.255.0.0 133.10.10.4
ip route 133.20.0.0 255.255.0.0 133.10.10.4
ip route 133.30.0.0 255.255.0.0 133.10.10.4
ip route 210.101.116.0 255.255.255.0 Null0 254
ip route 210.121.42.0 255.255.255.0 Null0 254
ip route 210.121.43.0 255.255.255.0 Null0 254
access-list 10 permit 210.101.116.0
access-list 10 permit 133.10.0.0 0.0.255.255
access-list 66 permit 133.10.0.0 0.0.255.255
access-list 77 permit 210.121.43.0
access-list 77 permit 210.121.42.0
snmp-server community tnldnsrj RW
!
line con 0
password blivy
line aux 0
transport input all
line vty 0 4
password blivy
login
!
end

예제1)
router#sh config
Using 709 out of 32762 bytes
!
version 11.2
no service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname router
!
enable secret 5 $1$UnkP$pEIOM/ZlIw/918ANOS4zm0
!
ip nat pool kt 211.54.83.170 211.54.83.173 netmask 255.255.255.224
ip nat inside source list 1 pool kt_pri overload
ip name-server 168.126.63.1
!
interface Ethernet0
ip address 211.54.83.174 255.255.255.224 secondary
ip address 168.192.100.254 255.255.255.0
ip nat inside
!
interface Serial0
no ip address
ip nat outside
!
interface Serial1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0
access-list 1 permit 168.192.100.0 0.0.0.255
!
!
line con 0
line aux 0
line vty 0 4
password suwon
login
!
end

router#

예제2)
router#sh conf
Using 1417 out of 32762 bytes
!
version 11.2
no service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname router
!
enable secret 5 $1$7N4H$AVSlVb5dbZxJTsXp8Hmcg/
enable password router
!
ip nat pool net-1 210.223.111.6 210.223.111.255 netmask 255.255.255.0
ip nat inside source list 1 pool net-1 overload
ip nat inside source static 172.16.211.9 210.223.111.2
ip domain-name kyungdong.co.kr
ip name-server 172.16.211.9
!
interface Ethernet0
ip address 172.16.206.11 255.255.255.0 secondary
ip address 210.223.111.4 255.255.255.0
ip nat inside
!
interface Serial0
ip address 192.168.234.190 255.255.255.252
ip nat outside
bandwidth 1544
!
interface Serial1
ip address 172.16.100.1 255.255.255.0
ip nat inside
!
router rip
redistribute static
network 172.16.0.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.234.189
ip route 128.3.2.0 255.255.255.0 172.16.206.12
ip route 172.16.101.0 255.255.255.0 172.16.100.2
ip route 172.16.107.0 255.255.255.0 172.16.100.2
ip route 172.16.108.0 255.255.255.0 172.16.100.2
ip route 172.16.209.0 255.255.255.0 172.16.206.10
ip route 172.16.210.0 255.255.255.0 172.16.206.10
ip route 172.16.211.0 255.255.255.0 172.16.206.10
ip route 172.16.212.0 255.255.255.0 172.16.206.10
access-list 1 permit 172.16.0.0 0.0.255.255
access-list 1 permit 128.3.2.0 0.0.0.255
snmp-server community public RO
!
line con 0
line aux 0
line vty 0 4
password router
login
!
end

예제3)
router#sh conf
Using 1215 out of 32762 bytes
!
version 11.2
no service password-encryption
no service udp-small-servers
no service tcp-small-servers
!
hostname router
!
enable secret 5 $1$40jO$hyLEyHgr4FB7uItdw3SXW1
enable password decolan
!
ip nat pool dsec 210.217.42.1 210.217.42.100 netmask 255.255.0.0
ip nat inside source list 1 pool dsec overload
ip domain-name kornet21.net
ip name-server 168.126.63.1
ip name-server 147.47.1.1
!
interface Ethernet0
ip address 210.217.42.1 255.255.0.0 secondary
ip address 130.1.3.5 255.255.0.0
ip nat inside
!
interface Serial0
ip address 192.168.62.58 255.255.255.252
ip nat outside
ip rip authentication mode 0
!
interface Serial1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.62.57
ip route 130.1.0.0 255.255.0.0 130.1.3.11
ip route 130.3.0.0 255.255.0.0 130.1.3.11
ip route 130.4.0.0 255.255.0.0 130.1.3.11
ip route 130.10.0.0 255.255.0.0 130.1.3.11
access-list 1 permit 130.1.0.0 0.0.255.255
access-list 1 permit 130.2.0.0 0.0.255.255
access-list 1 permit 130.3.0.0 0.0.255.255
access-list 1 permit 130.7.0.0 0.0.255.255
access-list 1 permit 130.4.0.0 0.0.255.255
access-list 1 permit 130.10.0.0 0.0.255.255
!
line con 0
line aux 0
line vty 0 4
password decolan
login
!
end

예제4)
router#sh conf
Using 1276 out of 32762 bytes
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
service udp-small-servers
service tcp-small-servers
!
hostname router
!
enable secret 5 $1$i9vO$MhVhuIF/6NGwDr0kuVXFK0
enable password router
!
ip nat pool sm_pri1 210.183.57.64 210.183.57.95 netmask 255.255.255.224
ip nat pool sm_pri 210.113.59.66 210.113.59.126 netmask 255.255.255.192
ip nat inside source list 1 pool sm_pri
ip nat inside source list 2 pool sm_pri1
ip nat inside source static 195.7.7.253 210.113.59.65
no ip domain-lookup
!
!
!
interface Ethernet0
ip address 195.7.7.254 255.255.255.0
ip nat inside
!
interface Serial0
ip address 192.168.239.190 255.255.255.252
ip nat outside
no keepalive
!
interface Serial1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0
ip route 195.7.8.0 255.255.255.0 195.7.7.250
ip route 195.7.9.0 255.255.255.0 195.7.7.250
ip route 195.7.10.0 255.255.255.0 195.7.7.250
ip route 195.7.11.0 255.255.255.0 195.7.7.250
!
access-list 1 permit 195.7.7.0 0.0.0.255
access-list 1 permit 195.7.10.0 0.0.0.255
access-list 2 permit 195.7.8.0 0.0.0.255
access-list 2 permit 195.7.9.0 0.0.0.255
access-list 2 permit 195.7.11.0 0.0.0.255
!
line con 0
line aux 0
line vty 0 4
password suwon
login
!
end

출처 : 네트워크 전문가 따라잡기, 고공질주(ciscoda)님

'공부방 > 네트워크' 카테고리의 다른 글

라우팅 재분배  (0) 2009.05.27
IP unnumbered와 helper 주소 사용하기  (0) 2009.05.26
시스코 HSRP 설정하기  (0) 2009.05.26
라우터에서 NAT 설정하기  (0) 2009.05.22
라우터에서 DHCP서버 구축하기  (0) 2009.05.22
어떤 라우팅 프로토콜에서 갖고 있는 경로정보를 다른 라우팅 프로토콜의 메시지로 보내주는 것을 재분배라고 합니다.

- RIP 와 EIGRP간 라우팅 재분배

(config)#router rip
(config-route)#network 10.1.1.0
(config-route)#redistribute [protocol] metric [metric]
(config-route)#redistribute eigrp 100  metric 2
(config-route)#redistribute static metric 2
(config)#router eigrp 100
(config-route)#network 192.168.100.0
(config-route)#redistribute rip metric 10000 100 255 1 1500
혹은
(config-route)#redistribute rip
(config-route)#redistribute static
(config-route)#default-metric 10000 100 255 1 1500

- OSPF와 EIGRP간 라우팅 재분배

(config)#router ospf 1
(config-route)#network 10.1.1.0 255.255.255.0 area 0
(config-route)#network 10.1.2.0 255.255.255.0 area 0
(config-route)#redistribute eigrp 100 subnets
(config)#router eigrp 100
(config-route)#network 192.168.100.0
(config-route)#redistribute ospf 1 metric 10000 100 255 1 150
(config-route)#distance [administrative] [distance]
- 라우팅 재분배시 관리거리를 정의합니다.(보통 프로토콜별 기본 값이 있습니다. 굳이 사용할 필요는...( "))
(config-route)#distance 85

* 라우팅 재분배시 관리거리의 기본값은
STATIC-0, EIGRP-90, IGRP-100, OSPF-110, RIP-120, 입니다.

- 패시브 인터페이스
라우팅 업데이트를 받기만 하고 보내지 않도록 설정하는 것을 말합니다.

(config)#router eigrp 100
(config-route)#network 192.168.100.0
(config-route)#passive-interface [interface]
(config-route)#passive-interface s0
(config-route)#passive-interface e0
(config)#router rip
(config-route)#network 10.1.1.0
(config-route)#passive-interface s0
(config-route)#passive-interface e0


'공부방 > 네트워크' 카테고리의 다른 글

Cisco 라우터 NAT 설정  (0) 2009.07.08
IP unnumbered와 helper 주소 사용하기  (0) 2009.05.26
시스코 HSRP 설정하기  (0) 2009.05.26
라우터에서 NAT 설정하기  (0) 2009.05.22
라우터에서 DHCP서버 구축하기  (0) 2009.05.22
- IP unnumbered 란?
시리얼 인터페이스에 ip를 셋팅하지 않고 다른 인터페이스의 ip를 빌리는 설정입니다.
조건은,
1. 인터페이스는 시리얼이고 Point-to-Point링크를 통해 연결되어야 합니다.
2. 같은 마스크를 갖는 같은 메이저 네트워크를 사용해서, 시리얼회선 양쪽에서 IP를 임대하는 LAN 인터페이스들에 주소를 지정합니다.(혹은 서브네팅을 하지 않는 서로 다른 메이저 네트워크들을 사용해서, 시리얼 링크의 양쪽에서 LAN 인터페이스들에 주소를 지정합니다.)
하지만 IP unnumbered는 ping을 통한 회선 up/down감지가 어렵고, 시리얼인터페이스를 통해 IOS 이미지 부팅이 불가능하며, IP보안옵션을 사용할 수 없는 단점이 있습니다.

(config)#int e0
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#no shut
(config-if)#int s0
(config-if)#ip unnumbered e0
(config-if)#no shut

- ip helper-address
보통은 라우터에서 각각의 서브넷에서 발생한 브로드캐스트는 서로 다른 서브넷으로 전달하지 않지만 ip helper-address 명령은 UDP브로드캐스트를 다른 서브넷으로 전달하는 역할을 합니다.
이 명령을 사용하는 이유는 각각의 서브넷에서 DHCP서버를 사용하는 경우 모든 서브넷에 별도의 DHCP서버를 두는 것은 비용이 많이 발생하기 때문에 DHCP서버를 한대 두고 모든 서브넷에 IP를 할당하고자 할때 사용하게 됩니다.
이때 브로드캐스트 패킷은 유니캐스트 패킷으로서 특정 IP주소(DHCP서버)로 전달하거나 브로드캐스트로서 특정 네트워크나 서브넷으로 전달할 수 있습니다.

- IP helper(유니캐스트 설정)
(config-if)#ip helper-address 192.168.100.254

- IP helper(다이렉트 브로드캐스트 설정)
(config-if)#int e0
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#ip helper-address 192.168.100.255
(config-if)#int e3
(config-if)#a\ip address 192.168.100.1 255.255.255.0
(config-if)#ip direct-broadcast

- ip helper-address는 기본적으로 다음 UDP포트에 대해서 전달합니다.
TIME(37), TACACS(49), DNS(53), BOOTP/DHCP서버(67), BOOTP/DHCP클라이언트(68), TFTP(69), NetBIOS 이름서비스(137), NetBIOS 데이터그램(138)

- 기본적으로 전달되는 포트 이외에 다른 포트에 대한 설정은 아래와 같습니다.
(config)#no ip forward-protocol udp 37
(config)#no ip forward-protocol udp 49
(config)#no ip forward-protocol udp 137
(config)#no ip forward-protocol udp 138
(config)#ip forward-protocol udp 517

'공부방 > 네트워크' 카테고리의 다른 글

Cisco 라우터 NAT 설정  (0) 2009.07.08
라우팅 재분배  (0) 2009.05.27
시스코 HSRP 설정하기  (0) 2009.05.26
라우터에서 NAT 설정하기  (0) 2009.05.22
라우터에서 DHCP서버 구축하기  (0) 2009.05.22
(config)#int e0
(config-if)#ip address 10.1.1.2 255.255.255.0
(config-if)#no shut

(config-if)#standby [group] ip [address]
- HSRP 그룹번호와 가상 IP주소를 셋팅합니다.
(config-if)#standby 100 ip 10.1.1.1

(config-if)#standby [group] priority [priority]
- HSRP 그룹에 대한 우선순위 지정합니다.(디폴트는 100이며 우선순위가 높은 라우터가 Active로 동작합니다.)
(config-if)#standby 100 priority 120

(config-if)#standby [group] timer [hello] [holdtime]
- Hello 패킷 주기와 홀드타임을 정합니다. 디폴트는 Hello는 3초 홀드타임은 10초입니다.
  즉, 10초동안 hello 패킷을 받지 못하면 Standby라우터가 Active가 됩니다.
(config-if)#standby 100 timer 3 10

(config-if)#standby group preempt
- 기본적으로 HSRP는 한번 Active가 되면 우선순위가 낮아져도 계속 Active상태가 됩니다.
그러나 위 명령어를 사용하면 우선 순위가 높은 라우터가 Active상태가 됩니다.
원래 Active인 라우터에 장애가 발생해서 Standby가 일시적으로 Active가 되어도 장애가 복구된 후에는 다시 원래 Active였던 라우터가 다시 Active로 동작하게 됩니다.
(config-if)#standby 100 preempt

(config-if)#standby group track [interface] [priority]
- HSRP프로세스가 감시할 인터페이스를 설정합니다. 감시하는 인터페이스가 다운되면 우선순위값을 기본값(10)만큼 감소시키고 [priority] 를 설정했다면 설정한 만큼 감소시킵니다.

(config-if)#standby 100 track s0 30

HSRP 상태를 조회하는 명령은 show standby 를 치면 됩니다.

'공부방 > 네트워크' 카테고리의 다른 글

라우팅 재분배  (0) 2009.05.27
IP unnumbered와 helper 주소 사용하기  (0) 2009.05.26
라우터에서 NAT 설정하기  (0) 2009.05.22
라우터에서 DHCP서버 구축하기  (0) 2009.05.22
라우터에서 EIGRP 설정  (0) 2009.05.22
1. STATIC NAT 설정

#conf t
(config)#ip nat inside source static [local-ip] [global-ip]
- 내부 Local 주소와 내부 Grobal 주소 사이에 정적 변환을 수립합니다.
(config)#ip nat inside source static 10.1.1.2 192.168.100.2

(config)#int e0
(config-if)#ip nat inside
- 내부 인터페이스에 NAT설정합니다.
(config)#int e0
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#ip nat inside
(config-if)#exit

(config)#int s0
(config-if)#ip nat outside
- 외부 인터페이스에 NAT설정합니다.
(config)#int s0
(config-if)#ip address 192.168.100.1 255.255.255.0
(config-if)#ip nat outside
(config-if)#exit

2. Dynamic NAT 설정

(config)#ip nat pool [name] [start-ip] [end-ip] [netmask netmask|prefix-length prefix-length]
(config)#ip nat inside source list 1 pool [name]
- 할당될 Global 주소 영역을 설정합니다.
(config)#ip nat pool TEST_POOL 192.168.100.10 192.168.100.100 netmask 255.255.255.0
(config)#ip nat inside source list 1 pool TEST_POOL

(config)#access-list
- 변환될 IP주소를 ACL로 정의합니다.
(config)#access-list 1 permit 10.1.1.0 0.0.0.255

(config)#int e0
(config-if)#ip nat inside
- 내부 인터페이스에 NAT설정합니다.
(config)#int e0
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#ip nat inside
(config-if)#exit

(config)#int s0
(config-if)#ip nat outside
- 외부 인터페이스에 NAT설정합니다.
(config)#int s0
(config-if)#ip address 192.168.100.1 255.255.255.0
(config-if)#ip nat outside
(config-if)#exit

3. 포트 주소 변환(PAT)
- 여러개의 내부주소를 하나의 공인IP로 변환해주는 설정

#conf t
(config)#ip nat inside source list 1 interface s0 overload
(config)#int e0
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#ip nat inside
(config-if)#exit
(config)#int s0
(config-if)#ip address 192.168.100.1 255.255.255.0
(config-if)#ip nat outside
(config-if)#exit
(config)#access-list 1 permit 10.1.1.0 0.0.0.255

'공부방 > 네트워크' 카테고리의 다른 글

IP unnumbered와 helper 주소 사용하기  (0) 2009.05.26
시스코 HSRP 설정하기  (0) 2009.05.26
라우터에서 DHCP서버 구축하기  (0) 2009.05.22
라우터에서 EIGRP 설정  (0) 2009.05.22
라우터에서 OSPF 설정  (0) 2009.05.15

1. DHCP 명령어 형식

#conf t
(config)#ip dhcp pool [pool_name]
- DHCP 풀을 생성하고 DHCP설정모드로 값니다.
(config)#ip dhcp pool TESET

(config-dhcp)#network [network-number][mask | /prefix-length]
- DHCP에 사용될 네트워크 주소를 지정합니다.
(config-dhcp)#network 10.1.1.0 255.255.255.0

(config-dhcp)#default-router [address] [address2...address8]
- 디폴트 라우터(디폴트 게이트웨이)를 지정합니다.
(config-dhcp)#default-router 10.1.1.1

(config-dhcp)#dns-server [address] [address2...address8]
- DNS서버를 지정합니다.

(config-dhcp)#netbios-name-server [address] [address2...address8]
- WINS 서버를 지정합니다.
(config-dhcp)#netbios-name-server 10.1.1.1

(config-dhcp)#domain-name [domain_name]
- 도메인 이름을 지정합니다.
(config-dhcp)#domain-name ABC.co.kr

(config-dhcp)#exit
(config)#ip dhcp excluded-address [start-address] [last-address]
- DHCP 풀에서 제외할 주소를 지정합니다.
(config)#ip dhcp excluded-address 10.1.1.1 10.1.1.100

'공부방 > 네트워크' 카테고리의 다른 글

시스코 HSRP 설정하기  (0) 2009.05.26
라우터에서 NAT 설정하기  (0) 2009.05.22
라우터에서 EIGRP 설정  (0) 2009.05.22
라우터에서 OSPF 설정  (0) 2009.05.15
라우터에서 프레임 릴레이 설정  (0) 2009.05.15
1. EIGRP의 비용 계산식

Cost = [ k1 * Bandwidth + (k2 * Bandwidth)/(256-Load) + K3 * Delay ] * [ k5 / (Reliability + K4) ]
(k1, k3는 기본값이 1이고, k2, k4, k5는 기본값이 0임)

이때, K5=0으로 하면 신뢰도를 고려하지 않겠다는 뜻으로 비용은 아래와 같습니다.

Cost = k1 * Bandwidth + (k2 * Bandwidth)/(256-Load) + K3 * Delay

- 대역폭(Bandwidth)의 계산방법은

Bandwidth = 10^7 / line_bandwidth(kbps)

- 지연(Delay)의 계산방법은

Delay = line_delay(micro-second) / 10

따라서 k의 변수를 모두 기본값으로 셋팅하는 경우

Cost = Bandwidth + Delay
Cost = 10^7 / line_bandwidth(kbps) + line_delay(micro-second) / 10

가 됩니다.


2. EIGRP 라우팅 프로토콜 설정

#conf t
(config)#router eigrp 100
(config-router)#network 10.1.1.0 0.0.0.255
(config-router)#variance 3                           
- 여러개의 경로를 이용하는 옵션으로 3으로 설정하면 경로중 최소값의 3배 이하인 경로는 모두 라우팅테이블에 등록되어 라우팅이 가능하도록 해줍니다.
(config-router)#traffic-share {balance | min} 
- 트래픽 분산옵션으로 Balance는 비용값에 따라 분배하고, Min은 최소비용경로만 사용합니다.
(config-router)#no auto-summary
- Eigrp는 기본으로 클래스단위의 주소형태를 사용하므로 Classless 네트워크를 사용하시려면 반드이 이 옵션을 해주셔야 합니다.
(config-router)#ip summary-address eigrp 100 10.1.0.0 255.255.0.0
- 수동으로 라우팅을 요약하는 설정입니다.

- OSPF프로토콜 설정

#conf t
(config)#router ospf process-id
(config-router)#network network-number area

예제)

#conf t
(config)#router ospf 1
(config-router)#network 10.1.1.0 0.0.0.255 area 0

- Frame-relay와 같이 비브로트케스트망에서 OSPF설정

#conf t
(config)#int lo 0
(config-if)#ip address 10.1.10.1 255.255.255.0
(config-if)#ip ospf network point-to-point
(config-if)#exit
(config)#int s0
(config-if)#encapsulation frame-relay
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#no shut
(config-if)#exit
(config)#router ospf 1
(config-router)#network 10.1.0.0 0.0.255.255 area 0
(config-router)#neighbor 10.1.1.2
(config-router)#neighbor 10.1.1.3

'공부방 > 네트워크' 카테고리의 다른 글

라우터에서 DHCP서버 구축하기  (0) 2009.05.22
라우터에서 EIGRP 설정  (0) 2009.05.22
라우터에서 프레임 릴레이 설정  (0) 2009.05.15
라우터에서 PPP모드 사용하기  (0) 2009.05.15
VLAN 설정하기  (0) 2009.05.15
1. 프레임 릴레이 설정

#config t
(config)#int s0
(config-if)#encapsulation frame-relay

- 프레임 릴레이 맵 설정
(config-if)#frame-relay map ip 10.1.1.1 110 broadcast

- 프레임 릴레이 맵 상태 확인
#show frame-relay map

- 프레임 릴레이 PVC 보기
#show frame-relay pvc

2. 프레임 릴레이 다중연결

#config t
(config)#int s0
(config-if)#encapsulation frame-relay
(config-if)#frame-relay map ip 10.1.1.1 610 broadcast
(config-if)#frame-relay map ip 10.1.1.1 620 broadcast

3. 프레임 릴레이에서 Point to  Point 설정
(point-to-point 방식은 하나의 인터페이스에서 하나의 PVC만 지원하므로 PVC내부에서 여러개의 서브 인터페이스를 갖도록 합니다.)

(config-if)#int s0.1 point-to-point
(config-if)#bandwidth 256
(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#frame-relay interface-dlci 510

4. 프레임 릴레이에서 Multi Point 설정
(Multi Point 방식은 하나의 인터페이스에서 여러개의 PVC를 지원하고, PVC내에서도 서브인터페이스를 지원합니다.)

(config-if)#ip address 10.1.1.1 255.255.255.0
(config-if)#frame-relay map ip 10.1.1.2 510 broadcast
(config-if)#frame-relay map ip 10.1.1.3 520 broadcast

5. 프레임 릴레이 스위치 설정하기

#conf t
(config)#frame-relay switching
(config)#int s0
(config-if)#encapsulation frame-relay
(config-if)#frame-relay intf-type dce
(config-if)#frame-relay route 510 interface serial 1 610
(config-if)#frame-relay route 520 interface serial 2 620
(config-if)#no shut
(config-if)#exit
(config)#int s1
(config-if)#encapsulation frame-relay
(config-if)#frame-relay intf-type dce
(config-if)#frame-relay route 610 interface serial 0 510
(config-if)#no shut
(config-if)#exit
(config)#int s2
(config-if)#encapsulation frame-relay
(config-if)#frame-relay intf-type dce
(config-if)#frame-relay route 620 interface serial 0 520
(config-if)#no shut
(config-if)#exit

1. 인터페이스 PPP로 변경

#conf t
(config)#int s0
(config-if)#encapsulation ppp

2. PPP사용자 인증 설정

#conf t
(config)#hostname RouterA
(config)#enable secret enapss
(config)#username id password pass
(config)#int s0
(config-if)#ppp authentication { chap | chap pap | pap chap | pap }

+ Recent posts