본문 바로가기
네트워크 수업

[실습] 이번주 총정리 NAT DHCP pool 23.03.24

by 6^6 2023. 3. 24.
728x90

##ip address
ISP]
int f0/0
no shu
ip add 24.24.10.254 255.255.255.0
int f0/1
no shut
ip add 1.1.12.9 255.255.255.252
int f1/0 
no shut 
ip add dhcp

R2]
int f0/0
no shut
ip add 1.1.30.254 255.255.255.0
int f0/1
no shut
ip add 1.1.12.10 255.255.255.252
==============
##DHCP넣기

ISP]
ip dhcp pool NET10
network 24.24.10.0 /24
lease 8
default-router 24.24.10.0254
dns-server 168.126.63.1 8.8.8.8
class CLASS2
address range 24.24.10.1 24.24.10.253

ip dhcp pool NET20
network 1.1.30.0 /24
lease 8
default-router 1.1.30.254
dns-server 168.126.63.1 8.8.8.8
class CLASS2
address range 1.1.30.1 1.1.30.253

int f0/0
ip dhcp client class-id CLASS1
int f0/1
ip dhcp client class-id CLASS2

ip route 1.1.30.0 255.255.255.0 f0/1 1.1.12.10
ip route 0.0.0.0 0.0.0.0 f1/0 10.0.0.1 //집에서는 ipconfig /all하고 이더넷 랜카드의 게이트웨이를 목적지로 잡아야한다.

R2]
ip route 0.0.0.0 0.0.0.0 f0/1 1.1.12.9
ip helper-address 1.1.12.9



##NAT넣기

ISP]
ip access-list standard INGRESS
permit 24.24.10.0 0.0.0.255
permit 1.1.30.0 0.0.0.255
ip nat inside source list INGRESS int f1/0 overload


int range f0/0 - 1
ip nat inside
int f1/0
ip nat outside



==============
##PC1
no ip routing
int f0/0
no shut
ip add dhcp

##PC2
no ip routing
int f0/0
no shut
ip add dhcp

===========
ping 168.126.63.1 을 해보자

isp에서 show ip nat trans =>30대역이 1.1.30.1로 바뀌었다.

PC1과 PC2에서 168.126.63.1 로 날리고  isp에서 show ip nat trans 해보면 사설아이피(Inside global)로 바뀌어졌다는거 확인이 가능하다.

 

728x90

댓글