Tuesday 29 April 2014

Basic access control lists exercise

An essential part of network security is being able to control what kind of traffic is being permitted to reach your network, and where that traffic is coming from.



Tugas: You are configuring a standard ACL. The ACL is designed to block traffic from the 192.168.11.0/24 network located in a student lab from accessing any local network on R3.

Solution:
Step 1: Create the ACL on router R3
- In global configuration mode, create a standard named ACL called STND-1
R3(config)# ip access-list standard STND-1

- While in standard configuration mode, add a statement that denies any packets with a source address of 192.168.11.0/24 and prints a message to the console for each matched packet.
R3(config-std-nacl)# deny 192.168.11.0 0.0.0.255 log

- Permit all other traffic
R3(config-std-nacl)# permit any

Step 2: Apply the ACL
Apply the ACL STND-1 as a filter on packets entering R3 through Serial interface 0/0/1
R3(config)# interface serial 0/0/1
R3(config-if)# ip access-group STND-1 in
R3(config-if)# end
R3# copy run start

Step 3: Test the ACL
Before testing the ACL, make sure that the console of R3 is visible. This will allow you to see the access list log message when packet is denied.

Test the ACL by pinging from PC2 to PC3. Since the ACL is designed to block traffic with source address from the 192.168.11.0/24 network, PC2 (192.168.11.10) should not be able to ping PC3

You can also use an extended ping from fa0/1 interface on R1 to the Fa0/1 interface on R3.
R1# ping ip
Target IP address: 192.168.30.1
Repeat count[5]:
Datagram size[100]:
Timeout in seconds[2]:
Extended commands[n]: y
Source address or interface: 192.168.11.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP echoes to 192.168.30.1. timeout is 2 seconds:
Packet sent with source address of 192.168.11.1
U.U.U
Success rate is 0 percent (0/5)

You should see the following message on the R3 console:
*Sep 4 03:22:58.935: %SEC-6-IPACCESSLOGNP: list STND-1 denied 0 0.0.0.0 -> 192.168.11.1, 1 packet

Di privileged EXEC mode on R3, issue the show access-list command.You see the output similiar to the following. Each line of an ACL has an associated counter showing how many packets have matched the rule.

Standard IP access list STND-1
10 deny 192.168.11.0, wildcard bits 0.0.0.255 log (5 matches)
20 permit any (25 matches)

The purpose of this ACL was to block hosts from the 192.168.11.0/24 network. Any other hosts such as those on the 192.168.10.0/24 network should be allowed access to the networks on R3. Conduct another test from PC1 to PC3 to ensure that this traffic is not blocked.

You can also use an extended ping from the Fa0/0 interface on R1 to the Fa0/1 interface on R3.

R1#ping ip
Target IP address: 192.168.30.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.10.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.10.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms


Tugas 2: Configuring an Extended ACL
Kalau ingin lebih halus, kamu harus menggunakan extended ACL. Extended ACL dapat menyaring trafik berdasarkan lebih dari hanya alamat source. Extended ACL bisa memfilter protocol, alamat source, alamt destination IP, dan source port number dan destination port number.

Satu tambahan policy lagi untuk jaringan ini, semua perangkat dari LAN 192.168.10.0/24 hanya dibolehkan untuk mencapai jaringan internal; komputer-komputer di jaringan ini tidak diperbolehkan untuk mengakses internet. Oleh karena itu, komputer-komputer ini harus diblok untuk mencapai alamat IP 209.165.200.225. Karena persyaratan ini butuh memaksakan source dan destination, maka sebuah ACL extended dibutuhkan.

Pada tugas ini, kamu mengkonfigurasi sebuah extended ACL pada R1 yang memblok trafik yang berasal dari perangkat manapun di jaringan 192.168.10.0/24 untuk mengakses 209.165.200.255 (ISP tersimulasi). ACL ini akan diaplikasikan outbound pada inteface serial 0/0/0 R1.

Sebuah best-practice untuk mengaplikasikan extended ACL adalah meletakkan mereka sedekat mungkin ke sumber.

Sebelum dimulai, pastikan bahwa kamu bisa ping ke 209.165.200.225 dari PC1.

Langkah 1: mengkonfigurasi sebuah ACL extended bernama
Di mode global configuration, buat sebuah ACL extended bernama EXTEND-1
R1(config)#ip access-list extended EXTEND-1
Perhatikan perubahan prompt untuk menunjukkan bahwa kamu sekarang berada di mode extended ACL. Dari prompt ini, tambahkan statement-statement penting untuk meblok trafik dari network 192.168.10.0/24 ke host 209.165.200.255. Gunakan kata host ketika mendefinisikan tujuan.
R1(config-ext-nacl)#deny ip 192.168.10.0 0.0.0.255 host 209.165.200.225
Ingat kembali implisit "deny all" memblok semua trafik jika tidak ada statement permit tambahan. Tambahkan pernyataan permit untuk memastikan bahwa trafik yang lain tidak terblok
R1(config-ext-nacl)#permit ip any any
Langkah 2: mengaplikasikan ACL
ACL standard, best practice nya adalah meletakkan ACL dekat dengan destination. Extended ACL biasanya diletakkan dekat dengan sumber (source). The EXTEND-1 ACL akan diletakkan pada interface serial, dan akan menyaring trafik outbound.
R1(config)#interface serial 0/0/0
R1(config-if)#ip access-group EXTEND-1 out log
R1(config-if)#end
R1#copy run start

Langkah 3: menguji ACL
Dari PC1, coba ping interface loopback R2. Ping ini seharusnya fail, karena semua trafik dari network 192.168.10.0/24 difilter ketika tujuan adalah 209.165.200.255. Jika tujuan alamat lain, ping akan berhasil.

Catatan: Trafik yang digenerate oleh R1 tidak bisa difilter dengan menggunakan ACL ini.

Untuk lebih lanjutnya, kamu bisa memastikan ini dengan mengeluarkan perintah show ip access-list pada R1 setelah mengeping.

R1#show ip access-list
Extended IP access list EXTEND-1
10 deny ip 192.168.10.0 0.0.0.255 host 209.165.200.225 (4 matches)
20 permit ip any any
Tugas 3: Mengendalikan akses ke line-line VTY dengan sebuah standard ACL
Sebuah ACL bisa diaplikasikan ke line-line vty, memungkinkan kamu untuk membatasi akses remote administration ke host-host tertentu atau network-network tertentu.

Pada contoh berikut ini, kamu akan mengkonfigurasikan sebuah standard ACL untuk mengizinkan host-host dari 2 network untuk bisa mengakses line-line VTY router. Host-host yang lain di-deny.

Langkah 1: Konfigurasi ACL
R2(config)#ip access-list standard TASK-5
R2(config-std-nacl)#permit 10.2.2.0 0.0.0.3
R2(config-std-nacl)#permit 192.168.30.0 0.0.0.255
Langkah 2: Mengaplikasikan ACL pada line vty 0 4
R2(config)#line vty 0 4
R2(config-line)#access-class TASK-5 in
R2(config-line)#end
R2#copy run start
Langkah 3: Menguji ACL
Telnet ke R2 dari R1. Percobaan koneksi akan gagal, karena IP address R1 termasuk yang ter-deny.
Telnet ke R2 dari R3. Percobaan koneksi akan berhasil;, karena alamat IP R3 tidak termasuk yang ter-deny.

Tugas 4: Troubleshooting ACL
Ketika sebuah ACL tidak secara benar dikonfigurasi atau diaplikasikan ke interface yang salah atau dalam arah yang salah, trafik jaringan akan bisa terganggu.

Step 1: Menghilangkan ACL STND-1 dari S0/0/1 router R3
Pada tugas awal, kamu telah membuat dan mengaplikasikan sebuah ACL standar bernama pada R3. Dengan menggunakan perintah show running-config untuk melihat ACL dan penempatannya. Kamu harusnya melihat bahwa sebuah ACL bernama STND-1 telah dikonfigurasi dan diaplikasikan inbound pada Serial 0/0/1. Ingat kembali bahwa ACL ini dirancang untuk memblok semua trafik jaringan dengan alamat source dari 192.168.11.0/24 dalam mengakses LAN pada R3.

Untuk menghilangkan ACL, pergi ke mode konfigurasi interface untuk Serial0/0/1 pada R3. Gunakan perintah no ip access-group STND-1 in untuk menghilangkan ACL dari interface.
R3(config)#interface serial 0/0/1
R3(config-if)#no ip access-group STND-1 in
Gunakan perintah show running-config untuk mengkonfirmasikan bahwa ACL telah dihilangkan dari interface Serial0/0/1.

Step 2: Mengaplikasikan ACL STND-1 pada S0/0/1 outbound

No comments:

Post a Comment