Dalam studi kasus ini, selain menggunakan NAT saya juga menggunakan OSPF ROUTING PROTOCOL agar antar router dapat saling berhubungan .
Berikut topologi network yang akan kita bahas kali ini:
Membuat nama switch:
Pada Switch0 :
Switch>enable
Switch#configure terminal
Switch(config)#hostname S0
Pada Switch5 :
Switch>enable
Switch#configure terminal
Switch(config)#hostname S5
Mengkonfigurasi VTP:
S0(config)#vtp mode server
Device mode already VTP SERVER.
S0(config)#vtp domain unsri
Changing VTP domain name from NULL to unsri
S0(config)#vtp password unsri
Setting device VLAN database password to unsri
S0(config)#end
S5(config)#vtp mode client
Setting device to VTP CLIENT mode.
S5(config)#vtp domain unsri
Changing VTP domain name from unsri to unsri
S5(config)#vtp password unsri
Setting device VLAN database password to unsri
S5(config)#end
Mangkonfigurasi Trunk Links dan Native VLAN:
S0>enable
S0#configure terminal
S0(config)#interface fastEthernet 0/1
S0(config-if)#switchport mode trunk
S0(config-if)#switchport trunk native vlan 1
S0(config-if)#interface fastEthernet 0/6
S0(config-if)#switchport mode trunk
S0(config-if)#switchport trunk native vlan 1
S0(config-if)#end
S5>enable
S5#configure terminal
S5(config)#interface fastEthernet 0/1
S5(config-if)#switchport mode trunk
S5(config-if)#switchport trunk native vlan 1
S5(config-if)#end
Membuat VLAN pada switch yang sebagai VTP server :
S0(config)#vlan 2
S0(config-vlan)#name 2
S0(config-vlan)#vlan 3
S0(config-vlan)#name 3
S0(config-vlan)#vlan 4
S0(config-vlan)#name 4
S0(config-vlan)#vlan 5
S0(config-vlan)#name 5
S0(config-vlan)#vlan 6
S0(config-vlan)#name 6
S0(config-vlan)#exit
Menggrouping port yang akan dijadikan member vlan:
S0#configure terminal
S0(config)#interface fastEthernet 0/2
S0(config-if)#switchport mode access
S0(config-if)#switchport access vlan 2
S0(config-if)#interface fastEthernet 0/3
S0(config-if)#switchport mode access
S0(config-if)#switchport access vlan 3
S0(config-if)#interface fastEthernet 0/4
S0(config-if)#switchport mode access
S0(config-if)#switchport access vlan 4
S0(config-if)#interface fastEthernet 0/5
S0(config-if)#switchport mode access
S0(config-if)#switchport access vlan 5
S0(config-if)#end
S5#configure terminal
S5(config)#interface range fastEthernet 0/2 - 3
S5(config-if)#switchport mode access
S5(config-if)#switchport access vlan 6
Switch(config-if)#end
KONFIGURASI ROUTER
Pada Router0 :
Router>enable
Router#configure terminal
Router(config)#hostname R0
Pada Router1 :
Router>enable
Router#configure terminal
Router(config)#hostname R1
Pada Router2 :
Router>enable
Router#configure terminal
Router(config)#hostname R2
Pada Router3 :
Router>enable
Router#configure terminal
Router(config)#hostname R3
Pada Router4 :
Router>enable
Router#configure terminal
Router(config)#hostname R4
Jadikan port fa0/0 on terlebih dahulu :
R0(config)#interface fastEthernet 0/0
R0(config-if)#no shutdown
R0(config-if)#exit
Mengkonfigurasi INTER-VLAN ROUTING Sehingga antar VLAN dapat saling berhubungan satu sama lain.
R0(config)#interface fastEthernet 0/0.2
R0(config-subif)#encapsulation dot1Q 2
R0(config-subif)#ip address 192.168.1.1 255.255.255.252
R0(config-subif)#interface fastEthernet 0/0.3
R0(config-subif)#encapsulation dot1Q 3
R0(config-subif)#ip address 192.168.1.5 255.255.255.252
R0(config-subif)#interface fastEthernet 0/0.4
R0(config-subif)#encapsulation dot1Q 4
R0(config-subif)#ip address 192.168.1.9 255.255.255.252
R0(config-subif)#interface fastEthernet 0/0.5
R0(config-subif)#encapsulation dot1Q 5
R0(config-subif)#ip address 192.168.1.13 255.255.255.252
R0(config-subif)#interface fastEthernet 0/0.6
R0(config-subif)#encapsulation dot1Q 6
R0(config-subif)#ip address 192.168.2.1 255.255.255.248
R0(config-subif)#exit
Memasang Ip address pada router:
R0(config)#interface fastEthernet 0/1
R0(config-if)#ip address 222.124.194.2 255.255.255.252
R0(config-if)#no shutdown
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.1.2 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 172.16.0.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.1.6 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 172.16.1.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.1.10 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastEthernet 0/1
R3(config-if)#ip address 172.16.2.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R4(config)#interface fastEthernet 0/0
R4(config-if)#ip address 192.168.1.14 255.255.255.252
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#interface fastEthernet 0/1
R4(config-if)#ip address 172.16.3.1 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
Mengkonfigurasi Router dengan OSPF Routing Protocol:
R0(config)#router ospf 1
R0(config-router)#network 192.168.1.0 0.0.0.3 area 0
R0(config-router)#network 192.168.1.4 0.0.0.3 area 0
R0(config-router)#network 192.168.1.8 0.0.0.3 area 0
R0(config-router)#network 192.168.1.12 0.0.0.3 area 0
R0(config-router)#network 192.168.2.0 0.0.0.7 area 0
R0(config-router)#default-information originate
R0(config-router)#end
R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.3 area 0
R1(config-router)#network 172.16.0.0 0.0.0.255 area 0
R1(config-router)#default-information originate
R1(config-router)#end
R2(config)#router ospf 1
R2(config-router)#network 192.168.1.0 0.0.0.3 area 0
R2(config-router)#network 172.16.1.0 0.0.0.255 area 0
R2(config-router)#default-information originate
R2(config-router)#end
R3(config)#router ospf 1
R3(config-router)#network 192.168.1.0 0.0.0.3 area 0
R3(config-router)#network 172.16.2.0 0.0.0.255 area 0
R3(config-router)#default-information originate
R3(config-router)#end
R4(config)#router ospf 1
R4(config-router)#network 192.168.1.0 0.0.0.3 area 0
R4(config-router)#network 172.16.3.0 0.0.0.255 area 0
R4(config-router)#default-information originate
R4(config-router)#end
Mengkonfigurasi Default Route agar antar router dapat saling terhubung dan mengkonfigurasi NAT agar ip private dapat mengakses ke ip public:
R0#configure terminal
R0config)#ip route 0.0.0.0 0.0.0.0 222.124.194.1
R0(config)#interface fastEthernet 0/1
R0(config-if)#ip nat outside
R0(config-if)#exit
R0(config)#interface fastEthernet 0/0.2
R0(config-subif)#ip nat inside
R0(config-subif)#interface fastEthernet 0/0.3
R0(config-subif)#ip nat inside
R0(config-subif)#interface fastEthernet 0/0.4
R0(config-subif)#ip nat inside
R0(config-subif)#interface fastEthernet 0/0.5
R0(config-subif)#ip nat inside
R0(config-subif)#exit
R0(config)#ip nat inside source list 50 interface fastEthernet 0/1 verload
R0(config)#access-list 50 permit any
Cara NAT diatas sering disebut juga dengan Nat Overload. Selain itu ada juga yang namanya Nat Static, Nat Static ini digunakan agar ip public dapat mengakses ip private yang telah kita tentukan. Berikut syntaxnya :
R0(config)#ip nat inside source static 192.168.2.2 222.124.194.2
R0(config)#ip nat inside source static tcp 192.168.2.3 88 222.124.194.2 88
R0(config)#end