Home

NAT Configuration

Leave a comment

NAT itu terbagi 2, Statis dan Dinamis

Tipe2 dari Statis dan Dinamis juga banyak…kita bahas satu2

==============================

Important Keyword

Kita bikin di interface loopback1 “ceritanya” ada LAN, pake keyword secondary, jadi ada 3 ip di satu interface (harus 1 network yah IP-IP secondary nya)

Trus ip route ke loopback R2, pake default route aja

Nah…important keyword dalam implementasi NAT adalah ip nat inside/ip nat outside

Di interface loopback1 (ato interface yang mengarah ke LAN Network) kita ketik ip nat inside, supaya si R1 tau…ini IP yang mau ditranslate

Di interface fa0/0 kita kasi ip nat outside, supaya R1 tau…ini interface tempat hasil translate-an IP nya

Kadang mudahnya gini:

  • Di suatu interface yang kita “mark” ip nat inside…tandanya itu Interface yang mengarah ke Network Local/LAN (Private IP)
  • Klo di interface itu kita “mark” ip nat outside…berarti interface ini tempat IP Public…mengarah ke WAN/ISP

===========================

Static NAT

1:1 Translation (1 buah IP di translate/dirubah ke 1 buah IP lainnya)

Di R2 juga sama, sekarang kita liat konfigurasi Static 1:1 translation
nya dibawah ini

Konfigurasi diatas artinya…”woi router…interface yang gw “mark” ip nat inside tolong mentranslate/rubah ip 1.1.1.1 ke 12.12.12.11 (ato 1.1.1.2 ke 12.12.12.2)

Coba kita ping (pake source yah…jadi ceritanya kita ping dari LAN kita, klo ping dari routernya sendiri ga akan dapet NAT-nya)

Nah..kita bisa liat…IP 1.1.1.1 (Inside Local) di translate ke 12.12.12.11 (Inside Global)

Begitu pula IP 1.1.1.2 ditranslate ke 12.12.12.12

Apaan sih Inside Global dan Local serta Outside Local dan Global?!

  • Inside Local = IP yang terdapat di interface yang sudah di mark “ip nat inside”
  • Inside Global = ini yang di mark “ip nat outside”
  • Outside Local = biasanya IP tetangganya (directly connected neighbor)
  • Outside Global = biasanya tempat tujuan berada

IP to Interface IP (Mapping 1 buah IP ke IP Interface)

Ini artinya “tolong translate IP berikut ini (1.1.1.1/1.1.1.2) ke IP yang ada di Interface fa0/0

Nah…diatas kita coba ping dari 1.1.1.1 trus dari 1.1.1.2, yang keliatan adalah IP yang terakhir kali nge-ping (1.1.1.2, IP 1.1.1.1 sudah di delete dari nat translation-nya)

Pool Network to Pool Network (define network untuk ditranslate lalu define network hasil translate)

Lebih fleksibel, configurasinya lebih ga ribet (daripada kita harus define 1-1 ip yang di translate…mending define “range” ip nya aja)

Ini artinya “tolong tanslate network 1.1.1.0 ke network 10.0.0.0 dengan prefix /24

Verifikasinya tinggal liat gambar diatas

Static Extendable (1:2 translations)

Jadi 1 IP ditranslate ke 2 IP atau lebih

Ini artinya “tolong translate 1.1.1.1 ke ip 10.1.1.1 ATAU 20.1.1.1“, dengan keyword extendable

Ketika R2 mau mengakses 1.1.1.1, dia bisa pake 10.1.1.1 ato 20.1.1.1, contoh kita mo telnet dari R2 ke R1:

Create telnet dulu, trus coba telnet ke 10.1.1.1 dan 20.1.1.1 (untuk ke 1.1.1.1)

===================================

Dynamic NAT

ACL to Range IP (IP yang mau di translate di filter dulu oleh ACL trus di translate ke pre-defined range IP)

Konfigurasi diatas maksudnya “tolong translate IP-IP yang ada di pool DINAMIS ke IP 12.12.12.11 sampai 12.12.12.13 dengan prefix /24

Create juga pool dan ACL nya yah (jangan lupa)

Hasil nat translation-nya bisa di lihat diatas

Reverse ACL to Range IP (klo tadi yang di translate adalah ip nat inside source, sekarang ip nat inside destination)

Tipe NAT seperti ini berguna klo ada traffic dari luar mau masuk, untuk telnet router kita misalnya

Tentu IP yang mau telnet itu harus diizinkan dulu (baca: dipermit ACL) untuk di translate ke IP Local

Pada gambar diatas..R2 telnet dengan menggunakan IP 12.12.12.11 dan di translate ke IP 1.1.1.1 (“show ip nat tr”-nya dibawah)

NAT Overload (IP ke Interface)

Nah…biasanya kita pake ginian nih, ini tipe NAT paling populer

Disini maksudnya “tolong translate IP-IP yang di permit oleh ACL nomor 1 ke IP yang ada di Fa0/0

Overload = cek article NAT gw tentang overload (also known as PAT – Port Address Translation)

Kok sama ya…kek yang di static? Ya memang…yang membedakan statis dan dinamis adalah cara router memilih IP mana saja yang mau ditranslate (static = input sendiri, dinamis = pake ACL/Pool)

NAT Overload (IP ke Pool IP)

Like the name said…sama2 overload…tapi IP yang “lolos” dari ACL akan di translate ke Pool IP yang sudah disediakan

Contoh configurasi:

Untuk nge-tes nya…kita harus bareng2 dari 2 komputer (misalkan) ping ke R2…baru di show ip nat tr

===============================

Dual NAT

Will be updated soon…

NAT Load balancing (salah satu contoh dual NAT)

NAT (Network Address Translation)

5 Comments

It’s time to NAT !!!

NAT itu gunanya buat apa sih ????

IPv4 (yang sekarang lagi kita pake di dunia saat ini buat pengalamatan device di jaringan computer)…terbagi atas IP Private dan IP Public…kenapa begitu ?

It’s to prevent IP exhaustion

Nah..IP private sendiri hanya berguna di local…anybody can use it and configure it….

Sedangkan IP Public berguna untuk berhubungan dengan network lain / cloud..ato yang sering kita bilang…INTERNET

Nah…bagaimana IP Private di kantor / local kita bisa internetan ??? cara nya adalah dengan mengubah IP Private ke Public donk ??

Apa yang bisa ngubah IP Private ke Public ??? ISP lah…wkwkwk

Tapi cara mengubah IP private ke Public itulah yang disebut NAT (Network Address Translation) , konfig nya di router

Biasanya klo dalam topology jaringan, NAT itu di aplikasikan di Stub Topology

Apa tu topology stub…here’s the idea…

Stub = Only 1 exit to the outside/other side….

Inside local address = Private Address..’nuff said

Inside Global Address = Address “terjemahan” si ISP buat IP private lo…

Outside Global Address = Destination IP

Tipe-tipe dari NAT

Ada 2 tipe NAT, Statis dan Dinamis

  • Static NAT: menggunakan metode 1:1…alias 1 private address dengan 1 public address, contoh computer punya IP private 192.168.X.X, ketika di NAT..dikasi IP 202.134.X.X…di kasinya tetap (Fix), static NAT biasanya digunakan buat host2 yang memang harus punya address konsisten/ga ganti2….kek web server…dan host game…biasanya buat create DotA…
  • Dynamic NAT: konsepnya sama kek DHCP…ada pool buat nampung public IP yang disediain…contohnya Speedy…liat aja klo kita restart modem…IP Public nya suka ganti2…(cek di whatismyip.com)

NAT Overload

NAT overload kadang disebut juga PAT (Port Address Translation) digunakan untuk menampung multiple private IP addresses ke 1 alamat IP public, ini metode paling umum dipake di ISP, aaaannnnnnnnddddd that’s why until recently we never run out of IPv4….

Figure 1-2 computer masing2 dengan IP 10.10 dan 10.11 ingin konek ke internet

Figure 2-NAT Router kemudian membaca private IP dari masing2 client beserta PORT nya…di convert ke public IP yang sama DENGAN port yang berbeda

PERTANYAANNYA ADALAH….GIMANA KLO YANG NGIRIM PORT NYA SAMA ??

Jawabannya pake gambar lagi…

Figure 3-Computer B (10.11) dengan port 1444 kirim paket

Figure 4-“ok…gw konversi jadi public IP dengan port 1444 jg” kata router NAT

Figure 5-komputer C (10.12) mau kirim juga..port nya SAMA..1444

Figure 6-“weleh…portnya sama…ya uda gw ganti port nya jadi 1445” kata router NAT…nanti pas paket dikirim balik…portnya tetep 1445 buat IP 10.12

NAT Benefit dan Drawback

SAATNYA KONFIGGG !!!

*ane rada males nyontohin langsung…copas aja dah

Static NAT Configuration

Static NAT Configuration Example

Dynamic NAT Configuration

Dynamic NAT Network

Dynamic NAT Configuration Example

NAT Overload Configuration

NAT Overload Configuration Example (contoh gambar sama dengan dynamic NAT)

NAT Overload with Public IP Pool Configuration Example (contoh gambar sama dengan dynamic NAT)

NOW WE TALK ABOUT PORT FORDWARDING

Klo kita mengaplikasikan NAT di network kita….berarti klo kita mo telnet…ato mo “masuk” lebih dalam ke network kita secara remote susah donk ?? karena ada proses translate IP nya itu…jadi GA BISA MASUK LANGSUNG KE IP YANG KITA TUJU

Contoh: ip kita 192.168.1.10 di merauke, papua…*seeed jauh amattt* trus kita mo ping 192.168.1.1-nya router di Zimbabwe…*bwuahahahah…makin gila gw*
, pasti nya butuh IP translation…apa lagi dengan ISP yang berbeda…sedangkan kita BENER-BENER pengen nge-ping / telnet 192.168.1.1 nya…END-TO-END Tracebility nya lost..gara2 NAT (liat NAT Benefit and Drawback diatas)

Untuk itulah ada yang disebut port forwarding

…untuk port forwarding tergantung dari vendor si config nya…kita liat yang dari Linksys nya Cisco yah….(plus bahasa inggris nya nih…gw males terjemahin)

For example, in the figure, HTTP service requests coming into this Linksys is now forwarded to the web server with the inside local address of 192.168.1.254.

If the external WAN IP address of the SOHO router is 209.165.200.158, the external user could enter http://209.165.200.158 and the Linksys router would redirect the HTTP request to the internal web server at IP address 192.168.1.254, using the default port number 80.

We could specify a port different from the default port 80. However, the external user would have to know the specific port number to use.

The approach you take to configure port forwarding depends on the brand and model of the broadband router in the network. However, there are some generic steps to follow. If the instructions supplied by your ISP or that came with the router do not provide adequate guidance, the website http://www.portforward.com provides guides for several broadband routers. You can follow the instructions to add or delete ports as required to meet the needs of any applications you want to allow or deny.

Verifying NAT Configuration

Verbose disini ibarat nambahin detail2 yang ga di tampilkan dengan hanya mengetikkan sh ip nat tr

The extended means it is looking at the extra information.  For example source and destination ports and IP addresses, as opposed to just the source addresses (diambil dari Learningnetwork.cisco.com from Paul Stewart, CCIE Security)

CLEARING IP NAT TRANSLATION

DEBUG IP NAT

WOKEH…..THATS ALL FOLKS FOR TODAY…

Older Entries