Lab 2.1 Security Router (Firewall) with 2 methode

Assalamualaikum wr wb

Jumpa lagi di Fajar Blog's. Pada kesempatan kali ini saya akan membahas pengamanan di Routerboard. Pengamanan disini mengunakan firewall filter dengan chain input. Untuk lebih jelasnya mari simak postingan berikut.
See you again in Fajar Blog's. On this occasion I will discuss security in Routerboard. Security here using a firewall filter with the input chain. For more details, let's look at the following post.


A. Tujuan

A. Purpose

  • Dapat mengetahui firewall di MikroTik
  • Knowing firewall in MikroTik
  • Mengetahui teknik firewall yang ada
  • Knowing the existing firewall techniques
  • Mengetahui jenis firewall di MikroTik
  • Knowing type of firewall in MikroTik

B. Bahan-bahan

B. Materials

1 Unit PC / laptop
  • 1 Unit PC / laptop
  • 1 Unit PC / laptop
  • Routerboard
  • Routerboard 
  • Kabel UTP
  • UTP cable
  • Winbox
  • Wonbox
  • Aplikasi NMAP
  • NMAP application

C. Konsep Dasar

C. Basic Concept
Firewall adalah perangkat yang berfungsi untuk memeriksa dan menentukan paket data yang dapat keluar atau masuk dari sebuah jaringan. Dengan kemampuan tersebut maka firewall berperan dalam melindungi jaringan dari serangan yang berasal dari jaringan luar (outside network). Firewall mengimplementasikan packet filtering dan dengan demikian menyediakan fungsi keamanan yang digunakan untuk mengelola aliran data ke, dari dan melalui router. Sebagai contoh, firewall difungsikan untuk melindungi jaringan lokal (LAN) dari kemungkinan serangan yang datang dari Internet. Selain untuk melindungi jaringan, firewall juga difungsikan untuk melindungi komputer user atau host (host firewall).
A firewall is a device that serves to examine and determine the data packets that can get in or out of a network. With this capability, firewall plays a role in protecting the network from attacks originating from outside the network (outside the network). Implement packet filtering firewall and thus provides security functions that are used to manage the flow of data to, from and through the router. For example, the firewall is enabled to protect the local network (LAN) from possible attacks coming from the Internet. In addition to protecting the network, a firewall is also intended to protect the user or host computer (host firewalls).

Firewall digunakan sebagai sarana untuk mencegah atau meminimalkan risiko keamanan yang melekat dalam menghubungkan ke jaringan lain. Firewall jika dikonfigurasi dengan benar akan memainkan peran penting dalam penyebaran jaringan yang efisien dan infrastruktur yang aman . 
Firewalls are used as a means to prevent or minimize the security risks inherent in connecting to other networks. Firewall if configured correctly will play an important role in the deployment of efficient networks and secure infrastructure.

Chain Pada Firewall
Chain on Firewall
Firewall beroperasi dengan menggunakan aturan firewall. Setiap aturan terdiri dari dua bagian - matcher yang sesuai arus lalu lintas terhadap kondisi yang diberikan dan tindakan yang mendefinisikan apa yang harus dilakukan dengan paket yang cocok. Aturan firewall filtering dikelompokkan bersama dalam chain. Hal ini memungkinkan paket yang akan dicocokkan terhadap satu kriteria umum dalam satu chain, dan kemudian melewati untuk pengolahan terhadap beberapa kriteria umum lainnya untuk chain yang lain.
Firewall operates by using firewall rules. Each rule consists of two parts - matcher corresponding traffic flow for the given conditions and actions define what should be done with the right plan. Filtering firewall rules are grouped together in a chain. This allows packets to be matched against one common criterion in one chain, and then passed over for processing against some other common criteria to another chain.

Ada tiga chain yang telah ditetapkan pada RouterOS Mikrotik :
There are three pre-defined chain in Mikrotik RouterOS:
  • Input - digunakan untuk memproses paket memasuki router melalui salah satu interface dengan alamat IP tujuan yang merupakan salah satu alamat router. Chain input berguna untuk membatasi akses konfigurasi terhadap Router Mikrotik.
  • Input - used to process packets entering the router through one interface with the IP address of the destination which is one of the router's address. Chain input allows you to restrict access to Mikrotik Router configuration.
  • Forward - digunakan untuk proses paket data yang melewati router.
  • Forward - used to process the data packets passing through the router.
  • Output - digunakan untuk proses paket data yang berasal dari router dan meninggalkan melalui salah satu interface.
  • Output - used to process the data packets coming from the router and leave through one interface.
Pada konfigurasi firewall mikrotik ada beberapa pilihan Action, diantaranya :
In the mikrotik  firewall configuration there are several options Action, including:
  • Accept : paket diterima dan tidak melanjutkan membaca baris berikutnya
  • Accept : packets received and not continue reading the next line
  • Drop : menolak paket secara diam-diam (tidak mengirimkan pesan penolakan ICMP) 
  • Drop : reject packets silently (do not send ICMP messages rejection)
  • Reject : menolak paket dan mengirimkan pesan penolakan ICMP
  • Reject : reject packet and send an ICMP message rejection
  • Jump : melompat ke chain lain yang ditentukan oleh nilai parameter jump-target
  • Jump : jump to another chain that is determined by the value of the parameter jump-targets
  • Tarpit : menolak, tetapi tetap menjaga TCP connection yang masuk (membalas dengan SYN/ACK untuk paket TCP SYN yang masuk)
  • Tarpit : refuse, but keep the incoming TCP connection (reply with a SYN / ACK for incoming TCP SYN packets)
  • Passthrough : mengabaikan rule ini dan menuju ke rule selanjutnya
  • Passthrough : ignore this rule and go to the next rule
  • log : menambahkan informasi paket data ke log
  • log : adding information to the log data packets
Teknik pada Firewall :
Technique on Firewall :
Drop some, accept all
Yaitu firewall menolak/membuang beberapa paket yang diinginkan dan tidak dibutuhkan kemudian menerima/mengizinkan semua paket 
That firewall reject / discard some desired package and not needed then accept / allow all packets

Accept some, drop all
Yaitu firewall mengizinkan/menerima beberapa paket yang diinginkan dan dibutuhkan kemudian menolak/membuang semua paket.
That firewalls allow / accept some packages they want and need then reject / discard all packets.

D. Langkah-langkah

D. Steps
Hubungkan Routerboard anda ke Laptop / PC dengan kabel UTP ke Ether2.
Connect your Routerboard to Laptop / PC with a UTP cable to ether2. 

Buka winbox lalu pilih MAC Address untuk login. Login dengan menggunakan user admin dan password kosong.
Open winbox and select MAC Address to login. Log in using the admin user and empty password .

Buat IP Address untuk ether2. Klik IP -> Addresses.
Create IP Address for ether2. Click IP -> Addresses.

Klik icon plus "+" untuk menambahkan IP Address. Isikan IP Address yang diinginkan dan pilih interfacenya. Disini saya memberikan IP Address 10.10.10.1 dengan /24 untuk ether2. Jika sudah klik "Apply" dan "OK"
Click the plus icon "+" to add the IP Address. Fill in the desired IP address and select the interface. Here I give the IP address 10.10.10.1 with a / 24 to ether2. If you have click "Apply" and "OK"

Penambahan IP Address telah berhasil.
The addition of IP Address has been successful.

Keluar dari winbox lalu atur IP Address pada Komputer / laptop anda. Atur IP sesuai dengan IP address yang telah diberikan pada ether2 tadi.
Exit from Winbox and set the IP address on the computer / laptop. Set the IP in accordance with the IP address that has been given to ether2 earlier.

Buka winbox lagi lalu login. Anda dapat login menggunakan MAC Address ataupun IP Address. Disini saya login menggunakan MAC Address.
Open winbox then login again. You can log in using the MAC Address or IP Address. Here I login using the MAC address.

Isikan DNS dengan mengklik "IP -> DNS"
Fill in the IP DNS by clicking  "IP -> DNS"

Isikan DNS server dengan 202.43.278.245 (no.1) lalu beri centang pada "Allow Remote Request" (no.2) kemudian klik "OK" (no.3)
Fill in the DNS server 202.48.278.245 (no.1) and then checklist the "Allow Remote Request" (no.2) and then click "OK" (no.3)

Buka terminal dengan mengklik "New Terminal"
Open a terminal by clicking the "New Terminal"

I. Teknik Accept some, drop all

Disini saya akan membuat firewall filter dengan memperbolehkan / membuka port 53 yaitu DNS dan menutup /menolak semua port.
Buat rule pertama yaitu untuk memperbolehkan port 53 pada ether2. Ketikkan perintah :
Here I will make the firewall filters to allow / open port 53 is DNS and closing / reject all ports.
Create the first rule is to allow port 53 on ether2. Type the command :
ip firewall filter add chain=input in-interface=ether2 protocol=tcp dst-port=53 action=accept

Buat rule kedua yaitu untuk menolak atau menutup semua. Ketikkan perintah :
Create a second rule is to reject or close all. Type command :
ip firewall filter add chain=input in-interface=ether2 protocol=tcp action=drop

Lihat firewall filter yang ada dengan perintah:
View existing firewall filter with the command:
ip firewall filter print

Jika melalui GUI klik "IP -> Firewall"
If via GUI click "IP -> Firewall"

Pada tab "Filter Rules" sudah terbuat rule firewall tadi.
On the tab "Filter Rules" have been made earlier firewall rule.

Cek port yang terbuka dengan menggunakan Zenmap. Pada kolom target isikan IP Address ether2. Jika sudah klik "Scan". Jika terlihat seperti pada gambar, port yang terbuka hanya port 54 (DNS) maka firewall berhasil berjalan.
Check open ports by using Zenmap. In the  target field enter the IP Address of ether2. If you have click "Scan". If it looks like in the picture, open ports only port 54 (DNS), the managed firewall running succesfull.

Sekarang saya akan membuat semua port terbuka tetapi hanya untuk 1 IP Address saja yaitu IP Address milik admin. Jadi yang dapat mengakses semua port hanya admin saja yang menggunakan IP Address tersebut, client lain hanya dapat mengakses port 53 (DNS). Ketikkan perintah :
Now I will make all the ports open, but only for one IP addressthat is only the IP address belongs to the admin. So that you can access all ports only admin who uses the IP address, another client can only connect to port 53 (DNS). Type the command:
ip firewall filter add chain=input in-interface=ether2 protocol=tcp src-address=10.10.10.2 action=accept

Lihat firewall filter yang ada dengan perintah:
View existing firewall filter with the command:
ip firewall filter print

Ubah urutan rule firewall agar dapat berjalan sesuai keinginan. Untuk memindahkan rule dapat menggunakan perintah " ip firewall filter move 1 2 " (sesuai nomor yang ingin dipindah). Atur rule firewall hingga menjadi seperti pada gambar
Change the order of firewall rules to run as desired. To move a rule can use the command "ip firewall filter move 1 2" (according to the number you want to move). Set the firewall rule to be like in the picture.

Jika melalui GUI klik "IP -> Firewall"
If via GUI click "IP -> Firewall"

Pada tab "Filter Rules" sudah terbuat rule firewall tadi.
On the tab "Filter Rules" have been made earlier firewall rule.


Saya mengakses mikrotik menggunakan IP Address milik admin yaitu dengan semua port terbuka.
I use a IP Address admin to access the mikrotik that with all the ports open.

Cek menggunakan Zenmap. Pada kolom target isikan IP Address ether2. Jika sudah klik "Scan". Karena saya menggunakan IP Address admin maka semua port terbuka.
Check using Zenmap. In the  target field enter the IP Address of ether2. If you have click "Scan". Because I am use the IP Address admin then all the ports open.

Sekarang saya mengubah IP Address lain dan ingin mengecek port yang terbuka.
Now I change the IP address of other and want to check opened ports.

Cek menggunakan Zenmap. Pada kolom target isikan IP Address ether2. Jika sudah klik "Scan". Maka port yang terbuka hanya port 53 (DNS) karena yang dapat mengakses semua port hanya IP Address 10.10.10.2 (admin).
Check using Zenmap. In the  target field enter the IP Address of ether2. If you have click "Scan". Then open ports only port 53 (DNS) because that can access all ports only the IP address 10.10.10.2 (admin).


II. Teknik Drop some, accept all

Jika menggunakan teknik drop some accept all, pertama kita harus membuat firewall filter untuk interface ether2 dengan memasukkan port yang tidak di perbolehkan. Juga tuliskan IP Address yang tidak diperbolehkan untuk mengakses semua port. Pada port, tuliskan semua port kecuali port 53 (DNS) agar hanya dapat mengakses port 53 saja. Pada Address tuliskan IP 10.10.10.3-10.10.10.255 karena IP 10.10.10.2 adalah IP admin yang diperbolehkan untuk mengakses semua port. Ketikkan perintah :
If using technique drop some accept all,  first we must create a firewall filter for ether2 interface by entering the port is not allowed. Also write down the IP addresses that are not allowed to access the port. At the port, write down all ports except port 53 (DNS) that can only access port 53 only. In the IP Address enter the IP 10.10.10.2 10.10.10.3-10.10.10.255 because IP 10.10.10.2 is IP admin that allowed to access the port. Type the command:
ip firewall filter add chain=input in-interface=ether2 protocol=tcp dst-ports=21,23,80,22,2000,8291 src-address=10.10.10.3-10.10.10.255 action=drop

Kemudian buat rule untuk membolehkan port dan IP Address yang tidak dituliskan diatas, yaitu port 53 dan IP 10.10.10.2 (IP admin). Ketikkan perintah :
Then create a rule to allow the ports and IP addresses are not written above, that is port 53 and IP 10.10.10.2 (IP admin). Type the command :
ip firewall filter add chain=input in-interface=ether2 protocol=tcp action=accept

Lihat firewall filter yang ada dengan perintah:
View existing firewall filter with the command:


Jika melalui GUI klik "IP -> Firewall"
If via GUI click "IP -> Firewall"

Pada tab "Filter Rules" sudah terbuat rule firewall tadi.
On the tab "Filter Rules" have been made earlier firewall rule.

Saya mengakses mikrotik menggunakan IP Address milik admin yaitu dengan semua port terbuka.
I use a IP Address admin to access the mikrotik that with all the ports open.


Cek menggunakan Zenmap. Pada kolom target isikan IP Address ether2. Jika sudah klik "Scan". Karena saya menggunakan IP Address admin maka semua port terbuka.
Check using Zenmap. In the  target field enter the IP Address of ether2. If you have click "Scan". Because I am use the IP Address admin then all the ports open.

Sekarang saya mengubah IP Address lain dan ingin mengecek port yang terbuka.
Now I change the IP address of other and want to check opened ports.

Cek menggunakan Zenmap. Pada kolom target isikan IP Address ether2. Jika sudah klik "Scan". Maka port yang terbuka hanya port 53 (DNS) karena yang dapat mengakses semua port hanya IP Address 10.10.10.2 (admin).
Check using Zenmap. In the  target field enter the IP Address of ether2. If you have click "Scan". Then open ports only port 53 (DNS) because that can access all ports only the IP address 10.10.10.2 (admin).
Selesai.

Berikut video tutorialnya:



Sekian, semoga bermanfaat.
Jangan lupa tinggalkan komentar ya gaes.

Wassalamualaikum wr wb


EmoticonEmoticon

Like this blog? Keep us running by whitelisting this blog in your ad blocker.

Thank you!

×