Pertemuan 12: NAT & PAT Configuration

Progress Pembelajaran 12/16
Tujuan Pembelajaran

Mahasiswa mampu mengkonfigurasi static NAT, dynamic NAT dengan pool, dan PAT (Port Address Translation) untuk konektivitas dari jaringan internal ke external, serta memahami konsep penghematan IP public.

Konsep Network Address Translation (NAT)

1. Pengertian NAT dan Tujuannya

NAT (Network Address Translation) adalah teknik yang memungkinkan multiple devices dalam jaringan private berbagi single public IP address untuk mengakses internet.

Manfaat NAT
  • Penghematan IP Public: Mengurangi kebutuhan IP public
  • Security: Menyembunyikan topology internal
  • Flexibility: Mudah mengubah ISP tanpa renumbering
  • IPv4 Preservation: Memperpanjang usia IPv4
Konsep Dasar NAT
  • Inside Local: IP private di jaringan internal
  • Inside Global: IP public yang mewakili internal
  • Outside Local: IP seperti yang terlihat dari internal
  • Outside Global: IP public actual di internet
2. Jenis-Jenis NAT
Jenis NAT Konsep Penggunaan Keuntungan Keterbatasan
Static NAT One-to-one mapping tetap Servers yang perlu diakses dari external Predictable, full bidirectional access Tidak menghemat IP public
Dynamic NAT One-to-one mapping dari pool Group of users needing internet access Menghemat IP public Limited oleh size of pool
PAT (NAT Overload) Many-to-one dengan port translation Most common untuk internet access Maximum IP conservation Some protocols tidak compatible
3. NAT Operation Process
1
Packet Outbound

Host mengirim packet ke internet

2
NAT Translation

Router mengganti source IP/port

3
Forward Packet

Packet dikirim dengan IP public

4
Return Traffic

Router reverse translation berdasarkan NAT table

4. NAT Terminology
Interface Types
  • Inside Interface: Terhubung ke jaringan internal (private)
  • Outside Interface: Terhubung ke jaringan external (public)
  • NAT Boundary: Point dimana translation terjadi
Address Types
  • Inside Local: IP asli host di jaringan internal
  • Inside Global: IP yang mewakili host di internet
  • Outside Global: IP actual destination di internet
  • Outside Local: IP destination seperti yang terlihat dari internal

Job Sheet Praktikum

Informasi Job Sheet

Durasi: 170 menit

Topik: NAT & PAT Configuration

Bobot: 8%

Tujuan: Implementasi berbagai jenis NAT

Tools: Cisco Packet Tracer

Penilaian: Unjuk Kerja

Diagram Topologi NAT
Internal Network
192.168.10.0/24
PC1: 192.168.10.10
PC2: 192.168.10.11
WebSrv: 192.168.10.170
FTPSrv: 192.168.10.101
Border Router
NAT Device
Inside: 192.168.10.1
Outside: 200.170.50.2
Internet
200.170.50.0/24
NAT Pool: 200.170.50.10-20
Web Server Static: 200.170.50.170
PAT: 200.170.50.2
Keterangan Topologi:
  • Internal Network: Jaringan private 192.168.10.0/24 dengan multiple devices
  • Border Router: Router dengan NAT configuration (inside/outside interfaces)
  • Internet: Jaringan public 200.170.50.0/24 mensimulasikan internet
  • NAT Pool: Range IP public 200.170.50.10-20 untuk dynamic NAT
  • Static NAT: Web server mapping ke 200.170.50.170
  • PAT: Menggunakan interface IP 200.170.50.2 untuk overload
IP Addressing Plan
Device/Role Interface/IP Address Type Description
Internet Router Gig0/0 200.170.50.1 Public ISP Gateway
Border Router Gig0/0 (Outside) 200.170.50.2 Public Internet-facing
Border Router Gig0/1 (Inside) 192.168.10.1 Private Internal network
PC1 NIC 192.168.10.10 Private Internal client
PC2 NIC 192.168.10.11 Private Internal client
Web Server NIC 192.168.10.170 Private Internal web server
FTP Server NIC 192.168.10.101 Private Internal FTP server
NAT Pool Dynamic NAT 200.170.50.10-20 Public For client translation
Static NAT Web Server 200.170.50.170 Public Web server public IP
Langkah Kerja Detail
Langkah 1: Persiapan Topologi dan Basic Connectivity

Buat topologi dan konfigurasi IP dasar pada semua devices:

Internet Router (Simulates ISP):
enable
configure terminal
hostname R-INTERNET
interface gigabitethernet 0/0
  ip address 200.170.50.1 255.255.255.0
  no shutdown
exit
Border Router (NAT Device):
enable
configure terminal
hostname R-BORDER
interface gigabitethernet 0/0
  ip address 200.170.50.2 255.255.255.0
  no shutdown
exit
interface gigabitethernet 0/1
  ip address 192.168.10.1 255.255.255.0
  no shutdown
exit
Konfigurasi default route di Border Router:
ip route 0.0.0.0 0.0.0.0 200.170.50.1
Test konektivitas dasar:
! Dari Border Router ping ke Internet Router
ping 200.170.50.1

! Expected: Success rate 100%
Scenario 1: Static NAT (One-to-One Mapping)

Implementasi Static NAT untuk Web Server agar bisa diakses dari internet:

Konfigurasi Static NAT untuk Web Server:
! Static NAT mapping
ip nat inside source static 192.168.10.170 200.170.50.170
Tentukan interface NAT (Inside/Outside):
! Configure inside interface
interface gigabitethernet 0/1
  ip nat inside
exit

! Configure outside interface
interface gigabitethernet 0/0
  ip nat outside
exit
Verifikasi Static NAT:
show ip nat translations
show ip nat statistics

! Expected output:
! Pro Inside global Inside local Outside local Outside global
! --- 200.170.50.170 192.168.10.170 --- ---
Testing dari Internet Router:
! Ping ke public IP Web Server
ping 200.170.50.170

! Web access test (jika web server aktif)
! http://200.170.50.170
Kegunaan Static NAT:

Static NAT digunakan untuk servers yang perlu diakses dari external network. Mapping bersifat permanent dan bidirectional.

Scenario 2: Dynamic NAT with Pool

Implementasi Dynamic NAT dengan pool untuk internal clients:

Buat NAT pool untuk internal clients:
! Create NAT pool
ip nat pool DYNAMIC-POOL 200.170.50.10 200.170.50.20 netmask 255.255.255.0
Buat access-list untuk menentukan hosts yang akan di-NAT:
! ACL untuk internal network
access-list 1 permit 192.168.10.0 0.0.0.255
Hubungkan ACL dengan NAT pool:
! Bind ACL to NAT pool
ip nat inside source list 1 pool DYNAMIC-POOL
Verifikasi Dynamic NAT:
show ip nat translations
show ip nat statistics

! Generate traffic dari internal PCs
! Dari PC1: ping 200.170.50.1
! Dari PC2: ping 200.170.50.1
Expected NAT Table:
! Setelah generate traffic:
! Pro Inside global Inside local Outside local Outside global
! tcp 200.170.50.10:1024 192.168.10.10:1024 200.170.50.1:23 200.170.50.1:23
! tcp 200.170.50.11:1025 192.168.10.11:1025 200.170.50.1:23 200.170.50.1:23
Scenario 3: PAT (Port Address Translation) - Many-to-One

Implementasi PAT untuk menghemat IP public dengan menggunakan single IP untuk multiple clients:

Hapus konfigurasi dynamic NAT sebelumnya:
! Remove dynamic NAT configuration
no ip nat inside source list 1 pool DYNAMIC-POOL
Konfigurasi PAT menggunakan interface external:
! PAT menggunakan interface IP
ip nat inside source list 1 interface gigabitethernet 0/0 overload
Verifikasi PAT:
show ip nat translations
show ip nat statistics

! Generate traffic dari multiple internal PCs
! Dari PC1: ping 200.170.50.1
! Dari PC2: ping 200.170.50.1
! Dari Web Server: ping 200.170.50.1
Expected PAT Translation Table:
! Perhatikan port numbers yang berbeda:
! Pro Inside global Inside local Outside local Outside global
! icmp 200.170.50.2:512 192.168.10.10:512 200.170.50.1:512 200.170.50.1:512
! icmp 200.170.50.2:513 192.168.10.11:513 200.170.50.1:513 200.170.50.1:513
! icmp 200.170.50.2:514 192.168.10.170:514 200.170.50.1:514 200.170.50.1:514
Keuntungan PAT:

PAT memungkinkan ratusan devices berbagi single IP public menggunakan different port numbers, menghemat IP public secara maksimal.

Scenario 4: Mixed NAT Configuration

Implementasi kombinasi Static NAT + PAT untuk environment production:

Kombinasi Static NAT untuk server + PAT untuk clients:
! Static NAT untuk Web Server (jika belum)
ip nat inside source static 192.168.10.170 200.170.50.170

! PAT untuk other hosts
ip nat inside source list 1 interface gigabitethernet 0/0 overload
Verifikasi mixed configuration:
show ip nat translations

! Expected output menunjukkan:
! - Static mapping untuk web server
! - Dynamic PAT entries untuk clients
! Pro Inside global Inside local Outside local Outside global
! --- 200.170.50.170 192.168.10.170 --- ---
! tcp 200.170.50.2:1024 192.168.10.10:1024 200.170.50.1:80 200.170.50.1:80
! tcp 200.170.50.2:1025 192.168.10.11:1025 200.170.50.1:80 200.170.50.1:80
Scenario 5: Port Forwarding (Static PAT)

Implementasi port forwarding untuk FTP Server yang berada di belakang NAT:

Konfigurasi port forwarding untuk FTP Server:
! Port forwarding untuk FTP
ip nat inside source static tcp 192.168.10.101 21 200.170.50.2 21
ip nat inside source static tcp 192.168.10.101 20 200.170.50.2 20
Testing port forwarding:
! Dari Internet Router, test FTP connection
ftp 200.170.50.2

! Expected: Berhasil connect ke FTP server internal
! Username/password sesuai konfigurasi FTP server
Verifikasi port forwarding:
show ip nat translations

! Expected output:
! Pro Inside global Inside local Outside local Outside global
! tcp 200.170.50.2:21 192.168.10.101:21 200.170.50.1:1030 200.170.50.1:1030
! tcp 200.170.50.2:20 192.168.10.101:20 --- ---
Langkah 6: Advanced NAT Features dan Troubleshooting

Konfigurasi advanced NAT features dan troubleshooting common issues:

NAT Timeout Configuration:
! Adjust NAT timeouts
ip nat translation timeout 3600   ! 1 hour
ip nat translation tcp-timeout 7200   ! 2 hours
ip nat translation udp-timeout 300   ! 5 minutes
ip nat translation dns-timeout 60   ! 1 minute
NAT Verification dan Monitoring:
! Detailed NAT information
show ip nat translations verbose
show ip nat statistics

! Clear NAT translations
clear ip nat translation *

! Debug NAT operations
debug ip nat
undebug all   ! Setelah selesai
Troubleshooting Common NAT Problems:
! No translation occurring
debug ip nat
show ip nat statistics

! Incorrect NAT rules
show running-config | include nat

! Interface not configured correctly
show ip interface brief
show running-config interface gigabitethernet 0/0
show running-config interface gigabitethernet 0/1
NAT Order of Operations:
! Inside-to-Outside process:
! 1. Check if packet is routable
! 2. Check NAT table for existing translation
! 3. Apply NAT rules (inside source)
! 4. Route packet

! Outside-to-Inside process:
! 1. Check NAT table for existing translation
! 2. Apply NAT rules (outside source jika ada)
! 3. Route packet

Real-World Scenario

Enterprise NAT Requirements
Requirement: Perusahaan dengan 50 employees tetapi hanya memiliki 5 IP public.
Solution Design:
  • PAT: Untuk employee internet access
  • Static NAT: Untuk web server dan email server
  • Port Forwarding: Untuk specific services
  • NAT Pool: Untuk VPN users jika diperlukan
Configuration Summary:
! PAT untuk employees
ip nat inside source list INTERNAL-USERS interface Gig0/0 overload

! Static NAT untuk servers
ip nat inside source static 192.168.10.80 203.0.113.80   ! Web
ip nat inside source static 192.168.10.25 203.0.113.25   ! Mail

! Port forwarding untuk FTP
ip nat inside source static tcp 192.168.10.90 21 203.0.113.90 21

NAT Best Practices

Configuration Best Practices
  • Gunakan PAT untuk menghemat IP public
  • Static NAT untuk servers yang perlu diakses dari external
  • Document NAT rules dengan jelas
  • Monitor NAT translations regularly
  • Use meaningful names untuk NAT pools
  • Test NAT functionality thoroughly
Common Mistakes to Avoid
  • Lupa konfigurasi ip nat inside/outside pada interface
  • Wrong ACL definition untuk dynamic NAT/PAT
  • NAT pool IP range tidak valid atau overlap
  • Lupa overload keyword untuk PAT
  • Incorrect order of NAT operations
  • Missing default route untuk external traffic

Checklist Verifikasi

Scenario Test Case Verification Command Expected Result Status
Static NAT Web Server Access show ip nat translations Static mapping exists Check
Dynamic NAT Client Translation show ip nat statistics Dynamic entries in table Check
PAT Multiple Clients show ip nat translations Same IP, different ports Check
Port Forwarding FTP Service ftp 200.170.50.2 FTP connection success Check
Mixed NAT All Services show ip nat translations Mixed static/dynamic entries Check