Senin, 23 Mei 2022

Lab 10. ACL Extended



Addresing:

Disini ip nya sama seperti dahulu,tinggal menambahkan :

Device                   Interface                         IP Address                     Subnet Mask          Default Gateway

CENTRAL            Fa0/0                              10.10.10.2                     255.255.255.0                     N/A
                              Fa1/0                              20.20.20.2                     255.255.255.0                     N/A



WebServer             NIC                                192.168.1.11                255.255.255.0             192.168.1.254


Tujuan
 Setting ACL Extended
Konsep Dasar
 Karakterisik ACL secara umum
 Menentukan tipe traffic yang akan di control
 Menentukan karakteristrik traffic
 Mengidentifikasi traffic dengan permit atau deny
 Dapat men-deny traffic spesifik atau secara keseluruhan
Terdapat implisit deny any pada akhir baris access list secara default
 Masing-masing baris hanya untuk satu protokol spesifik
 Masing-masing interface router maksimal hanya punya dua access list untuk masing-
    masing protocol, satu incoming traffic dan satu outgoing traffic
 Ketika access list di assign untuk interface, tentukan apakah untuk incoming atau outgoing
 Access list sifatnya global di router, tapi filter traffic hanya berlaku di interface yang di assign
    access list
 Masing-masing access list dapat di assign ke beberapa interface
 Akan tetapi tiap interface hanya boleh satu incoming dan satu outgoing
 Access list dapat digunakan untuk nge-log traffic yang match dengan access list statement
 Access list yang di applied ke inbound traffic dilakukan sebelum routing decision
 Access list yang di applied ke outbound traffic dilakukan setelah routing decision
 Ketikkan rule access list secara berurutan, dengan statement paling restrictive berada di
    atas

ACL Extended
1. Nomor : 100-199
2. Digunakan untuk filter source dan destination IP address
3. Dapat memfilter spesifik protocol IP dan port number
4. Tips : assign pada router yang terdekat dengan source (close to the source router)
Konfigurasi ACL
Untuk melakukan setting ACL di router, pertama setting rule ACL terlebih dahulu di mode global
router, kemudian langkah kedua assign rule ACL tersebut di interface.

Router(config)# access-list 100 permit/deny protocol source_IP destination_IP
Router(config)# access-list 100 permit/deny protocol source_IP port
destination_IP port
Router(config)# access-list 100 permit/deny protocol any any
Router(config)# interface fa0/0
Router(config)# ip access-group 1 in/out

Untuk menyatakan match sebuah host bisa menggunakan 2 cara :
 Dengan wildcard mask “0.0.0.0”, misal 192.168.1.1 0.0.0.0
 Dengan keyword “host”, misal host 192.168.1.1

Untuk menyatakan match semua host bisa menggunakan 2 cara :
 Dengan wildcard mask “255.255.255.255”, misal 0.0.0.0 255.255.255.255
 Dengan keyword “any”, misal any source atau destination

Konfigurasi
Login console ke R1 atau R2 untuk mempraktikkan Lab 10-ACL Extended.
Sebelum menerapkan ACL, setting OSPF Area 0 terlebih dahulu topologi diatas. Lihat solution Lab
8-OSPF.
#1. Buat rule ACL extended seperti dibawah ini:
1. Allow host 192.168.2.1 mengakses service SSH R1
2. Allow network R2 mengakses service HTTP ke mana saja
3. Deny semua trafik lainnya
Gunakan ACL number 100 untuk rule 1-3 diatas.

Tampilkan ipconfig Laptop2 sebelum disetting ACL
Laptop2>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::260:2FFF:FE42:A6D3
IP Address......................: 192.168.2.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.2.254

Laptop2 dapat melakukan tes Ping ke Laptop1 yang berada di network 192.168.1.0
Laptop2>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=13ms TTL=125
Reply from 192.168.1.1: bytes=32 time=12ms TTL=125
Reply from 192.168.1.1: bytes=32 time=13ms TTL=125
Reply from 192.168.1.1: bytes=32 time=7ms TTL=125
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 7ms, Maximum = 13ms, Average = 11ms

Setting ACL Extended di R2
R2(config)#access-list 100 permit tcp host 192.168.2.1 host 10.10.10.1 eq 22
R2(config)#access-list 100 permit tcp any any eq 80

ACL telah disetting di R2 sesuai urutan rule nomor 1-3 di atas. Mengapa menempatkan ACL-nya di
R2? Agar rule tersebut berjalan normal saat di eksekusi, maka kita taruh di dekat router source.
Ingat konsep ACL extended : close to the source router. Karena implicit deny ada dibaris
terakhir ACL, maka kita tidak perlu menuliskan rule ACL tersebut.
Setelah mensetting rule ACL di R2, langkah selanjutnya yaitu menempatkan ACL tersebut di
interface agar bekerja efektif. Rule ACL ditempatkan di interface outgoing menuju network luar di
Fa1/0 R2.

Apply ACL di Interface Fa1/0 R2
R2(config)#interface fa1/0
R2(config-if)#ip access-group 100 out

Verifikasi
Tampilkan access-list extended yang sudah dibuat di R2
R2#show access-list
Extended IP access list 100
10 permit tcp host 192.168.2.1 host 10.10.10.1 eq 22
20 permit tcp any any eq www
R2#

Tes Ping dari Laptop2 ke Laptop1
Laptop2>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

ACL sudah berjalan sesuai dengan rule nomer 3 diatas, deny semua traffic lainnya termasuk ping
dari Laptop2 ke Laptop1. Perhatikan yang memberikan reply dari router R2 (192.168.2.254).

Tes Ping dari Laptop2 ke Laptop1 dengan mengubah IP address Laptop2 selain 192.168.2.1
Laptop2>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::260:2FFF:FE42:A6D3
IP Address......................: 192.168.2.3
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.2.254

Laptop2>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Dengan IP 192.168.2.3 ternyata tidak berhasil tes Ping host yang berada di network 192.168.1.0.

Tes Ping dari Laptop2 ke R1
Laptop2>ping 10.10.10.1
Pinging 10.10.10.1 with 32 bytes of data:
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Ping statistics for 10.10.10.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Tes Ping dari Laptop2 ke R1 gagal.

Tes Ping dari Laptop2 ke router CENTRAL
Laptop2>ping 20.20.20.2
Pinging 20.20.20.2 with 32 bytes of data:
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Reply from 192.168.2.254: Destination host unreachable.
Ping statistics for 20.20.20.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Dari hasil tes Ping Laptop2 ke router CENTRAL juga gagal.

Tampilkan interface access-list extended di R2
R2#show ip interface fa1/0
FastEthernet1/0 is up, line protocol is up (connected)
Internet address is 20.20.20.1/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is 100
Inbound access list is not set
Proxy ARP is enabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is disabled
IP fast switching on the same interface is disabled

Dari output interface access-list diatas, di Fa1/0 R2 terdapat outgoing access-list dengan number
100.

Tampilkan Akses SSH dari Laptop2 ke R1
Laptop2>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::260:2FFF:FE42:A6D3
IP Address......................: 192.168.2.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.2.254
PC>

Laptop2>ssh -l admin 10.10.10.1
Open
Password:
Unauthorized access prohibited!
R1>enable
Password:
R1#
R1#

Akses SSH dari Laptop2 ke R1 berhasil. Hal ini sesuai dengan rule ACL extended nomer 1.

Tampilkan access-list extended setelah di jalankan akses SSH ke R1
R2#show access-list
Extended IP access list 100
10 permit tcp host 192.168.2.1 host 10.10.10.1 eq 22 (154 match(es))
20 permit tcp any any eq www
R2

Perhatikan pada baris pertama rule ACL terdapat 154 match(es) artinya jumlah attempt yang
match dengan rule baris ke-1 dimana Laptop2 diperbolehkan mengakses service SSH ke R1.
Jumlah match akan terus naik seiring dengan jumlah koneksi SSH dari Laptop2 ke R1.
Jalankan Web Browser di Laptop2 untuk Mengakses Web Server di Network A
Klik Laptop2 -> Pilih tab Desktop -> Klik Web Browser -> Isikan IP Web Server : 192.168.1.11 ->
ENTER.

Service HTTP WebServer berhasil diakses dari Laptop2. Coba ganti IP address Laptop2 selain
192.168.2.1, kemudian akses WebServer dan pastikan berhasil karena service HTTP memang
diperbolehkan diakses dari network R2 mana saja.

Tampilkan access-list extended setelah mengakses Web Server di R1
R2#show access-list
Extended IP access list 100
10 permit tcp host 192.168.2.1 host 10.10.10.1 eq 22 (155 match(es))
20 permit tcp any any eq www (11 match(es))
R2#

Dari output baris rule nomor 2 diatas, bagian akhir baris terdapat 11 match(es) artinya jumlah
attempt yang dilakukan oleh source any ketika mengakses HTTP.
Dari informasi output show access-list dapat disimpulkan bahwa ACL yang telah kita buat sudah
berhasil melewatkan traffic SSH dan HTTP.

Tidak ada komentar:

Posting Komentar

Lab 10. ACL Extended