NAT - 라우터에서 해주는 설정
(라우터에서 다른 라우터로 나갈 때 사용하는 보호조치)
- inside, outside
STATIC NAT -> 1:1 IP교환
- ip nat inside source static 내부ip 공인ip
POOL NAT -> N:1 IP교환 (pool interface)
1) access-list 리스트 생성
- access-list 리스트이름 permit 네트워크 wildcark mask
2) pool 범위 설정
- ip nat pool pool이름 공인ip주소시작범위 공인ip주소마지막범위 prefix-length 프리픽스값
3-1) pool nat 설정
- ip nat inside source list 리스트이름 pool pool이름
3-2-1) pool interface 설정 (overload 설정)
- ip nat inside source list 리스트이름 pool pool이름 int 케이블이름
3-2-2) pool 설정
- ip nat inside source list 리스트이름 pool pool이름
우클릭 > Change symbol

카테고리별로 이미지를 선택할 수 있음

변경 후 필드에 아이콘 이미지가 변경된 것을 확인

MobaXterm과 같은
링크 : https://www.vandyke.com/products/securecrt/

C드라이브 > Program Files > VanDyke Software > Clients

x64 > SecureCRT
3개의 파일 모두 설치된 파일로 붙여넣기

시작(윈도우키) > SecureCRT 8.1 실행 후 라이센스 입력 부분에 crak에 포함된 key.txt 파일의 내용을 전체 복사 ➡ 붙여넣기

C:\Users\4gl\AppData\Roaming\VanDyke\Config
세션 등록하는 창

ip route 0.0.0.0 0.0.0.0 nexthop_ip
이때 앞에 0.0.0.0은 네트워크 주소고 뒤에 0.0.0.0은 network/subnet mask임
- 0.0.0.0(network/subnet mask) = 255.255.255.255(wildcard mask)
NOT 연산을 통해 값을 구할 수 있음

공인IP로 연결을 하도록 설정을 했는데 현재 내부, 외부 모두 ping으로 접근이 가능함
때문에 내부는 접근하지 못하도록 차단할 때 사용하는게 access-list임

PC1
ip 192.168.1.1/24 192.168.1.254
save
PC2
ip 192.168.1.2/24 192.168.1.254
save
R1
conf t
int f0/0
ip add 192.168.1.254 255.255.255.0
no sh
int f0/1
ip add 1.1.12.1 255.255.255.0
no sh
end
conf t
ip route 0.0.0.0 0.0.0.0 1.1.12.2
end
wr
Internet
conf t
int f0/0
ip add 1.1.12.2 255.255.255.0
no sh
int f0/1
ip add 8.8.8.1 255.255.255.0
no sh
end
wr
GoogleDNS
conf t
int f0/0
ip add 8.8.8.8 255.255.255.0
no sh
end
conf t
ip route 192.168.1.0 255.255.255.0 8.8.8.1
end
wr


R1
conf t
int f0/0
ip nat inside
conf t
int f0/1
ip nat outside
end
conf t
ip nat inside source static 192.168.1.1 1.1.12.3
R1
conf t
ip nat inside source static 192.168.1.2 1.1.12.4
R1에서 sh ip nat tr을 통해 NAT 설정 확인 가능

PC1에서 8.8.8.8로 ping을 전송하면 1.1.12.3 이라는 ip로 변환되어 나가는것을 확인할 수 있음

R1에서 PC2 NAT 설정 삭제
R1
conf t
no ip nat inside source static 192.168.1.2 1.1.12.4
access-list를 사용해 pool(outside ip) 생성
R1
conf t
access-list 1 permit 192.168.1.0 0.0.0.255
R1
conf t
ip nat pool NAT 1.1.12.100 1.1.12.200 prefix-length 24
(pool의 이름은 NAT이며 ip는 1.1.12.100 ~ 1.1.12.200까지 제공하며 프리픽스 /24 값을 제공)
ip nat inside source list 1 pool NAT
(4-1-2 실습하며 NAT 설정을 pool 로 변경)
PC2에서 ping을 쓰면 나가는 ip가 1.1.12.100인 것을 확인할 수 있음

ip nat inside source list 1 pool NAT interface f0/1
나가는 ip는 한개만 설정할 거고 outside int는 f0/1이다.
4-1-3에서 설정한 pool 설정 제거
R1
conf t
no ip nat inside list 1 pool NAT
R1에서 NAT를 interface로 설정
R1
conf t
ip nat inside source list 1 pool NAT interface f0/1
(나가는 ip는 한개만 설정할 거고 outside int는 f0/1이다.)
(모든 라우터에 ip, static만 설정되어 있고 NAT 설정이 전혀 없는 상태라고 가정하고 진행)

+)R1, Internet에서 NAT Table 확인
Internet
conf t
int f1/0
ip add DHCP
end
conf t
int f0/0
ip nat inside
int f1/0
ip nat outside
end
conf t
ip nat inside source list 1 int f1/0
access-list 1 permit any
end
sh ip nat tr
+)1번 상황과 비교하여 NAT Table 확인
R1
conf t
int f0/0
no ip nat inside
int f0/1
no ip nat outside
R1에서 NAT가 끊겨서 PC에서 ping 8.8.8.8을 하면 안되는데 내부 정보를 몰라서 안된다고함
때문에 Internet에서 PC 네트워크를 static 설정을 해줘야함
Internet
conf t
ip route 192.168.1.0 255.255.255.0 1.1.12.1

ISP
conf t
int f2/0
ip add 10.1.1.2 255.255.255.240

R1
en
sh ip nat tr
(내용 없으므로 설정 삭제할 것이 없음)
int f2/0
ip add 10.1.1.1 255.255.255.240
- S* 0.0.0.0 0.0.0.0 설정 추가해줘야함
R1
conf t
int g1/0
ip nat inside
int f2/0
ip nat outside
end
conf t
ip nat inside source static 192.168.1.100 10.1.1.3
TELNET_SERVER
conf t
int f0/0
ip add 192.168.3.3 255.255.255.0
no sh
R1
conf t
ip nat inside source static 192.168.3.3 10.1.1.4
R1
conf t
ip nat inside source static 192.168.1.4 10.1.1.5
R1
en
sh ip nat tr
TELNET_Server
conf t
username ccnp privilege 15 password cisco
line vty 0 4
login local
transport
end
conf t
ip rute 0.0.0.0 0.0.0.0 192.168.3.1
내부관리자
ping 10.1.1.3
ping 10.1.1.4
ping 10.1.1.5telnet 10.1.1.5
- userid : ccnp
- passwd : cisco
web : 10.1.1.3

R1
conf t
access-list 1 permit 192.168.0.0 0.0.255.255
/28 ➡ 252
28-24=4 -> 2^4 = 16 (배수)
사용가능한 범위 : 0~15, 16~31, 32~...
R1
conf t
ip nat pool NAT 10.1.1.6 10.1.1.14 prefix-length 30
prefix-length를 사용해도 되고 netmask를 사용해도 됨
ex) ip nat pool NAT 10.1.1.6 10.1.1.14 netmask 255.255.255.240
R1
conf t
ip nat inside source list 1 pool NAT
R1
conf t
no ip nat inside source list 1 pool NAT
no ip nat pool NAT 10.1.1.6 10.1.1.14 prefix-length 30
R1
conf t
ip nat inside source access-list 1 int f2/0
end
sh ip nat tr