Static and Dynamic NAT
Materi Lab :
Setelah sedikit penjelasan mengenai NAT di part sebelumnya, disini akan kita coba praktikkan konfigurasi Static dan Dynamic NAT. Untuk PAT atau NAT Overload akan kita bahas di part selanjutnya.
Topologi :
Keterangan :
Disini akan kita coba konfigurasi NAT Static untuk Network 192.168.1.0/24 dan Dynamic NAT untuk network 192.168.2.0/24
Konfigurasi :
Pertama, setting IP Address beserta netmask untuk seluruh device yang sesuai topologi.
SaktiR1(config)#interface fa0/0
SaktiR1(configif)#no shutdown
SaktiR1(configif)#ip address 10.10.10.1 255.255.255.0
SaktiR1(configif)#exit
SaktiR1(config)#interface fa0/1
SaktiR1(configif)#no shutdown
SaktiR1(configif)#ip address 192.168.1.1 255.255.255.0
SaktiR1(configif)#exit
SaktiR1(config)#
SaktiR2(config)#interface fa0/0
SaktiR2(configif)#no shutdown
SaktiR2(configif)#ip address 11.11.11.1 255.255.255.0
SaktiR2(configif)#exit
SaktiR2(config)#interface fa0/1
SaktiR2(configif)#no shutdown
SaktiR2(configif)#ip address 192.168.2.1 255.255.255.0
SaktiR2(configif)#exit
SaktiR2(config)#
INTERNET(config)#interface fa0/0
INTERNET(configif)#no shutdown
INTERNET(configif)#ip address 10.10.10.2 255.255.255.0
INTERNET(configif)#exit
INTERNET(config)#interface fa0/1
INTERNET(configif)#no shutdown
INTERNET(configif)#ip address 11.11.11.2 255.255.255.0
INTERNET(configif)#exit
INTERNET(config)#
Selanjutnya, kita set routing dengan tipe EIGRP di ketiga router agar terhubung. Tapi ingat, jangan ikut meng-advertise ke 2 network local karena nantinya, kedua network ini akan kita setting menggunakan NAT.
SaktiR1(config)#router eigrp 10
SaktiR1(configrouter)#network 10.10.10.0
SaktiR1(configrouter)#no autosummary
SaktiR1(configrouter)#exit
SaktiR1(config)#
SaktiR2(config)#router eigrp 10
SaktiR2(configrouter)#network 11.11.11.0
SaktiR2(configrouter)#no autosummary
SaktiR2(configrouter)#exit
SaktiR2(config)#
INTERNET(config)#router eigrp 10
INTERNET(configrouter)#network 10.10.10.0
INTERNET(configrouter)#
%DUAL5NBRCHANGE: IPEIGRP 10: Neighbor 10.10.10.1
(FastEthernet0/0) is up: new adjacency
INTERNET(configrouter)#network 11.11.11.0
INTERNET(configrouter)#
%DUAL5NBRCHANGE: IPEIGRP 10: Neighbor 11.11.11.1
(FastEthernet0/1) is up: new adjacency
INTERNET(configrouter)#no autosummary
INTERNET(configrouter)#
%DUAL5NBRCHANGE: IPEIGRP 10: Neighbor 10.10.10.1
(FastEthernet0/0) resync: summary configured
%DUAL5NBRCHANGE: IPEIGRP 10: Neighbor 11.11.11.1
(FastEthernet0/1) resync: summary configured
INTERNET(configrouter)#exit
INTERNET(config)#
Cek ping. Pastikan ketiga router sudah terhubung dan bisa ping
SaktiR1#ping 11.11.11.1
Type escape sequence to abort.
Sending 5, 100byte ICMP Echos to 11.11.11.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), roundtrip min/avg/max =
15/31/59 ms
SaktiR1#
SaktiR1#ping 10.10.10.1
Type escape sequence to abort.
Sending 5, 100byte ICMP Echos to 11.11.11.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), roundtrip min/avg/max =
15/31/59 ms
SaktiR1#
STATIC NAT
Konfigurasi NAT pertama adalah Static NAT untuk network 192.168.1.0/24. Untuk pengecekan sebelum konfigurasi NAT Static client Sakti-PC1 bisa coba ping ke INTERNET.
Packet Tracer PC Command Line 1.0
C:>ping 10.10.10.2
Pinging 10.10.10.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 10.10.10.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:>ping 11.11.11.2
Pinging 11.11.11.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 11.11.11.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:>
Agar client dapat terhubung. Kita konfigurasi NAT. Misal disini, kita akan mencoba mentranslasikan IP client Sakti-PC1 menjadi 10.10.10.10.
Pertama, tentukan mana interface NAT Inside, dan mana interface NAT Outside.
SaktiR1(config)#interface fa0/0
SaktiR1(configif)#ip nat outside
SaktiR1(configif)#exit
SaktiR1(config)#interface fa0/1
SaktiR1(configif)#ip nat inside
SaktiR1(configif)#
Selanjutnya, konfigurasi translasi NAT dari IP Private menjadi IP Public dengan tipe static NAT.
SaktiR1(config)#ip nat inside source static 192.168.1.100 10.10.10.10
SaktiR1(config)#
Selanjutnya bisa dicek ping lagi dari Sakti-PC1 menuju INTERNET.
Pinging 10.10.10.2 with 32 bytes of data:
Request timed out.
Reply from 10.10.10.2: bytes=32 time=29ms TTL=254
Reply from 10.10.10.2: bytes=32 time=28ms TTL=254
Reply from 10.10.10.2: bytes=32 time=28ms TTL=254
Ping statistics for 10.10.10.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milliseconds:
Minimum = 28ms, Maximum = 29ms, Average = 28ms
C:>ping 11.11.11.2
Pinging 11.11.11.2 with 32 bytes of data:
Reply from 11.11.11.2: bytes=32 time=22ms TTL=254
Reply from 11.11.11.2: bytes=32 time=22ms TTL=254
Reply from 11.11.11.2: bytes=32 time=23ms TTL=254
Reply from 11.11.11.2: bytes=32 time=23ms TTL=254
Ping statistics for 11.11.11.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milliseconds:
Minimum = 22ms, Maximum = 23ms, Average = 22ms
C:>
Bisa dicek otput hasil translasi NAT :
SaktiR1#show ip nat translations
Pro Inside global Inside local Outside local Outside
global
icmp 10.10.10.10 192.168.1.100
SaktiR1#
DYNAMIC NAT
Pertama, tentukkan interface NAT Inside dan Interface Outside.
SaktiR2(config)#interface fa0/0
SaktiR2(configif)#ip nat outside
SaktiR2(configif)#exit
SaktiR2(config)#interface fa0/1
SaktiR2(configif)#ip nat inside
SaktiR2(configif)#exit
SaktiR2(config)#
Selanjutnya, buat rule access-list dengan mem-permit network 192.168.2.0/24
SaktiR2(config)#accesslist 1 permit 192.168.2.0 0.0.0.255
SaktiR2(config)#
Selanjutnya, buat pool untuk Dynamic NAT. Sesuai aturan, kita buat pool yang berisi IP Public dan akan kita gunakan untuk Dynamic NAT jaringan local agar terhubung ke INTERNET. Misal disini kita buat pool dengan range 11.11.11.11-11.11.11.22. Lalu translasikan.
SaktiR2(config)#ip nat pool SAKTI 11.11.11.11 11.11.11.22 netmask 255.255.255.0
SaktiR2(config)#
SaktiR2(config)#ip nat inside source list 1 pool SAKTI
Bisa dicek dengan ping dari Sakti-PC2 ke INTERNET
C:>ping 11.11.11.2
Pinging 11.11.11.2 with 32 bytes of data:
Reply from 11.11.11.2: bytes=32 time=29ms TTL=254
Reply from 11.11.11.2: bytes=32 time=25ms TTL=254
Reply from 11.11.11.2: bytes=32 time=30ms TTL=254
Reply from 11.11.11.2: bytes=32 time=20ms TTL=254
Ping statistics for 11.11.11.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milliseconds:
Minimum = 20ms, Maximum = 30ms, Average = 26ms
C:>ping 10.10.10.2
Pinging 10.10.10.2 with 32 bytes of data:
Reply from 10.10.10.2: bytes=32 time=17ms TTL=254
Reply from 10.10.10.2: bytes=32 time=43ms TTL=254
Reply from 10.10.10.2: bytes=32 time=32ms TTL=254
Reply from 10.10.10.2: bytes=32 time=34ms TTL=254
Ping statistics for 10.10.10.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milliseconds:
Minimum = 17ms, Maximum = 43ms, Average = 31ms
C:>
Bisa dicek output translasinya :
SaktiR2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 11.11.11.11:16 192.168.2.100:16 10.10.10.2:16
10.10.10.2:16
icmp 11.11.11.11:17 192.168.2.100:17 10.10.10.2:17
10.10.10.2:17
SaktiR2#
Sekian:)
Indri Novita Sari
BalasHapusAgung Prasetyo
BalasHapus