Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| networking:cisco:static-nat [2026/02/04 23:41] – [Cisco : Static NAT [U]] ilyasa | networking:cisco:static-nat [2026/02/04 23:51] (current) – ilyasa | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| NAT (Network Address Translation) statis adalah tipe NAT di mana satu alamat IP publik secara permanen dipetakan ke satu alamat IP privat dalam jaringan internal. Ini berarti bahwa alamat IP publik tertentu selalu merujuk ke perangkat atau server tertentu di dalam jaringan privat. NAT statis biasanya digunakan ketika Anda ingin perangkat dalam jaringan internal dapat diakses dari luar jaringan (misalnya, dari internet) dengan alamat IP publik yang tetap | NAT (Network Address Translation) statis adalah tipe NAT di mana satu alamat IP publik secara permanen dipetakan ke satu alamat IP privat dalam jaringan internal. Ini berarti bahwa alamat IP publik tertentu selalu merujuk ke perangkat atau server tertentu di dalam jaringan privat. NAT statis biasanya digunakan ketika Anda ingin perangkat dalam jaringan internal dapat diakses dari luar jaringan (misalnya, dari internet) dengan alamat IP publik yang tetap | ||
| ===== Syntax ===== | ===== Syntax ===== | ||
| - | ==== Some acction ==== | + | |
| - | ^ Command ^ Description ^ | + | <code js> |
| - | | '' | + | ip nat inside source static |
| - | | '' | + | </ |
| - | Contoh: | + | |
| + | * local-ip: Ini merupakan private ip address di local network yang akan dipetakan ke public ip address | ||
| + | * global-ip: Ini merupakan public ip address yang akan dilihat oleh internet | ||
| + | |||
| + | Untuk menkonfigurasi NAT static kamu harus menentukan interface inside dan outsite terlebih dahulu dengan: | ||
| < | < | ||
| - | vlan 10 | + | interface [interface] |
| - | name VLAN-10 | + | ip nat inside |
| - | vlan 20 | + | interface [interface] |
| - | name VLAN-20 | + | ip nat outside |
| - | vlan 99 | + | |
| - | name VLAN-Management | + | |
| </ | </ | ||
| ===== Topologi ===== | ===== Topologi ===== | ||
| - | Gambar topology | + | {{ : |
| - | Goals Topology | + | Tujuan: Kita mempunyai pool ip public 100.0.0.0/ |
| + | |||
| + | <hidden Preconfig> | ||
| + | * **R1 : Proconfig** | ||
| + | <code js> | ||
| + | hostname R1 | ||
| + | ! | ||
| + | ip dhcp excluded-address 192.168.1.1 | ||
| + | ! | ||
| + | ip dhcp pool LAN | ||
| + | | ||
| + | | ||
| + | | ||
| + | ! | ||
| + | ! | ||
| + | interface FastEthernet0/ | ||
| + | ip address 203.0.113.1 255.255.255.252 | ||
| + | no shutdown | ||
| + | ! | ||
| + | interface FastEthernet0/ | ||
| + | ip address 192.168.1.254 255.255.255.0 | ||
| + | no shutdown | ||
| + | ! | ||
| + | ip route 0.0.0.0 0.0.0.0 203.0.113.2 | ||
| + | </ | ||
| + | * **Intenet: Cisco router to simulate internet** | ||
| + | <code js> | ||
| + | hostname internet | ||
| + | ! | ||
| + | ! | ||
| + | interface Loopback0 | ||
| + | ip address 142.251.175.113 255.255.255.255 | ||
| + | ! | ||
| + | interface FastEthernet0/ | ||
| + | ip address 203.0.113.2 255.255.255.252 | ||
| + | no shutdown | ||
| + | ! | ||
| + | interface FastEthernet0/ | ||
| + | ip address 8.8.8.1 255.255.255.0 | ||
| + | no shutdown | ||
| + | ! | ||
| + | ip route 100.0.0.0 255.255.255.0 203.0.113.1 | ||
| + | </ | ||
| + | |||
| + | * **Linux DNS server with a single records ** | ||
| + | Linux DNS server with a single records | ||
| + | < | ||
| + | DNS A Record google.com –> 142.251.175.113 | ||
| + | </ | ||
| + | </ | ||
| ===== Konfigurasi ===== | ===== Konfigurasi ===== | ||
| - | | + | |
| + | | ||
| + | |||
| + | <code js> | ||
| + | R1(config)# | ||
| + | R1(config-if)# | ||
| + | R1(config)# | ||
| + | R1(config-if)# | ||
| + | </ | ||
| + | |||
| + | * **R1 : Mempetakan ip 100.0.0.x/ | ||
| + | |||
| + | <code js> | ||
| + | R1(config)# | ||
| + | R1(config)# | ||
| + | R1(config)# | ||
| + | </ | ||
| + | |||
| + | ===== Testing ===== | ||
| + | * **PC1 : Test ping dan hasil capture** | ||
| < | < | ||
| - | Switch(config)# | + | PC1> ip dhcp |
| - | Switch(config-vlan)# | + | DORA IP 192.168.1.1/ |
| - | Switch(config-vlan)# | + | |
| - | Switch(config)# | + | PC1> ping google.com |
| - | Switch(config-vlan)# | + | google.com resolved to 142.251.175.113 |
| - | Switch(config-vlan)# | + | |
| + | 84 bytes from 142.251.175.113 icmp_seq=1 ttl=254 time=19.694 ms | ||
| + | 84 bytes from 142.251.175.113 icmp_seq=2 ttl=254 time=20.258 ms | ||
| + | 84 bytes from 142.251.175.113 icmp_seq=3 ttl=254 time=15.912 ms | ||
| + | 84 bytes from 142.251.175.113 icmp_seq=4 ttl=254 time=16.214 ms | ||
| + | ^c | ||
| </ | </ | ||
| - | | + | {{ : |
| + | |||
| + | * **PC2 : Test ping dan hasil capture** | ||
| < | < | ||
| - | Switch(config)# | + | PC2> ping google.com -c 1 |
| - | Switch(config-if)# | + | google.com resolved to 142.251.175.113 |
| - | Switch(config-if)# | + | |
| - | Switch(config-if)# | + | |
| - | Switch(config)# | + | 84 bytes from 142.251.175.113 icmp_seq=1 ttl=254 time=30.073 ms |
| - | Switch(config-if)# | + | |
| - | Switch(config-if)# | + | |
| - | Switch(config-if)# | + | |
| </ | </ | ||
| - | ===== Testing ===== | + | {{ : |
| + | |||
| + | * **PC3 : Test ping dan hasil capture** | ||
| + | |||
| + | < | ||
| + | PC3> ping google.com -c 1 | ||
| + | google.com resolved to 142.251.175.113 | ||
| + | |||
| + | 84 bytes from 142.251.175.113 icmp_seq=1 ttl=254 time=20.609 ms | ||
| + | </ | ||
| + | {{ : | ||
| + | |||
| + | * **R1 : logs nat translations** | ||
| + | <code js> | ||
| + | R1#show ip nat translations | ||
| + | Pro Inside global | ||
| + | icmp 100.0.0.1: | ||
| + | icmp 100.0.0.1: | ||
| + | icmp 100.0.0.1: | ||
| + | icmp 100.0.0.1: | ||
| + | icmp 100.0.0.1: | ||
| + | --- 100.0.0.1 | ||
| + | icmp 100.0.0.2: | ||
| + | --- 100.0.0.2 | ||
| + | icmp 100.0.0.3: | ||
| + | --- 100.0.0.3 | ||
| + | </ | ||