Cisco: Konfigurasi NAT: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 28: | Line 28: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Router1#sh ip nat statistics | Router1#sh ip nat statistics | ||
Total translations: 1 (1 static, 0 dynamic, 0 extended) | Total translations: 1 (1 static, 0 dynamic, 0 extended) | ||
Outside Interfaces: FastEthernet0/1 | Outside Interfaces: FastEthernet0/1 | ||
Inside Interfaces: FastEthernet0/0 | Inside Interfaces: FastEthernet0/0 | ||
Hits: 10 Misses: 36 | Hits: 10 Misses: 36 | ||
Expired translations: 19 | Expired translations: 19 | ||
Dynamic mappings: | Dynamic mappings: | ||
Router1#sh ip nat translations | Router1#sh ip nat translations | ||
Pro Inside global Inside local Outside local Outside global | Pro Inside global Inside local Outside local Outside global | ||
— 12.12.12.12 10.10.10.2 — | — 12.12.12.12 10.10.10.2 — | ||
Router1#sh ip route | Router1#sh ip route | ||
Gateway of last resort is 12.12.12.2 to network 0.0.0.0 | Gateway of last resort is 12.12.12.2 to network 0.0.0.0 | ||
10.0.0.0/24 is subnetted, 1 subnets | 10.0.0.0/24 is subnetted, 1 subnets | ||
C 10.10.10.0 is directly connected, FastEthernet0/0 | C 10.10.10.0 is directly connected, FastEthernet0/0 | ||
12.0.0.0/24 is subnetted, 1 subnets | 12.0.0.0/24 is subnetted, 1 subnets | ||
C 12.12.12.0 is directly connected, FastEthernet0/1 | C 12.12.12.0 is directly connected, FastEthernet0/1 | ||
S* 0.0.0.0/0 [1/0] via 12.12.12.2 | S* 0.0.0.0/0 [1/0] via 12.12.12.2 | ||
Latest revision as of 23:16, 31 October 2025
- FastEthernet1 (f0/0) dengan IP 192.168.1.0. Interface ini terhubung ke jaringan yang akan di NAT
- Serial 0/0/0 dengan IP 200.200.200.1. Interface ini terhubung ke internet. Masuk ke mode privileged config t
Router# configure terminal Router(config)# interface fa0/0 (IP Private) Router(config-if)# ip add 192.168.0.1 255.255.255.0 Router(config)# interface s0/0/0 (IP Public) Router(config-if)# ip add 200.200.200.1 255.255.255.0
- Interface tadi harus terhubung ke jaringan yang akan di NAT.
- Konfigurasi access list untuk nantinya berguna dalam proses NAT
HQ(config)# access-list 1 permit 192.168.1.0 0.0.0.255
- Konfigurasi router supaya NAT semua paket dari IP Private 192.168.1.0 ke dalam IP Public 200.200.200.2 – 6
HQ(config)# ip nat pool INTERNET 200.200.200.2 200.200.200.6 netmask 255.255.255.248 HQ(config)# ip nat inside source list 1 pool INTERNET overload
- Selanjutnya pilih saja interface yang langsung terhubung dengan NAT, dan definisikan network pada jaringan ini sebagai network yang akan di NAT.
HQ(config)# int f0/0 HQ(config)# ip nat inside HQ(config)# ip s0/0/0 HQ(config)# ip nat outside
- Konfigurasi selesai. Cek apakah host pada jaringan 192.168.1.0 dapat terhubung ke dunia maya. Cek juga konfigurasi NAT pada router dengan instruksi show ip nat translation.
<syntaxhighlight lang="bash">
Router1#sh ip nat statistics
Total translations: 1 (1 static, 0 dynamic, 0 extended)
Outside Interfaces: FastEthernet0/1
Inside Interfaces: FastEthernet0/0
Hits: 10 Misses: 36
Expired translations: 19
Dynamic mappings:
Router1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
— 12.12.12.12 10.10.10.2 —
Router1#sh ip route
Gateway of last resort is 12.12.12.2 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 12.12.12.2