Shorewall adalah salah satu tools firewall pada linux yang berbasiskan iptables. Shorewall terdapat konsep “zone” yang memudahkan kita untuk menentukan policy firewall, daripada kite melakukan konfigurasi secara manual dengan iptables. Misalnya network ente adalah spt gambar dibawah ini :
maka untukmemudahkan kita, asumsikan saja ada 3 zona yang dapat di definisikan, yaitu :
1. LAN, yaitu jaringan lokal, kita definisikan sebagai zona lok
2. Internet, yaitu koneksi kita ke internet, kita definisikn sebagai zona net
3. Komputer Firewall kita secara otomatis bernama zona $FW
Berikut ini adalah step-by-step konfigurasi yang diterapkan
ini ane testing di debian
sebelumnya ente kudu remove “ipchains” jika dah keinstal di mesin ente by running this command
# apt-get remove ipchains
setelah itu
1. Install shorewall dari repository terdekat
1 2 | root@mygo:~# apt-get install shorewall shorewall-doc 2. Kopi konfigurasi dari template yg ada |
1 2 3 4 5 | root@mygo:~# cd /usr/share/doc/shorewall-common/default-config root@mygo:~# cp zones /etc/shorewall/ root@mygo:~# cp interfaces /etc/shorewall/ root@mygo:~# cp policy /etc/shorewall/ root@mygo:~# cp rules /etc/shorewall/ |
3. Setting Shorewall sebagai berikut :
a. konfigurasi zona
1 2 3 4 | root@mygo:~# vim /etc/shorewall/zones fw firewall lok ipv4 net ipv4 |
b. konfigurasi interface
1 2 3 | root@mygo:~# vim /etc/shorewall/interfaces lok eth0 detect tcpflags,nosmurfs net eth1 detect tcpflags,nosmurfs |
c. konfigurasi policy
1 2 3 4 5 6 | root@mygo:~# vim /etc/shorewall/policy $FW all ACCEPT lok $FW DROP info lok net DROP info net $FW DROP info net lok DROP info |
d. konfigurasi rules
1 2 3 4 5 | root@mygo:~# vim /etc/shorewall/rules ACCEPT lok $FW tcp 80 ACCEPT net $FW tcp 80 ACCEPT lok $FW tcp 53 ACCEPT lok $FW udp 53 |
4. Testing konfigurasi sebelum menjalankannya
1 2 | root@mygo:~# shorewall check root@mygo:~# shorewall start |
5. Coba me-restart shorewall untuk memastikan tidak ada error
1 2 | root@mygo:~# shorewall restart root@mygo:~# shorewall safe-restart |
6. Setting Shorewall agar automatis berjalan sewaktu booting
1 2 | root@mygo:~# vim /etc/default/shorewall startup=1 |
Happy securing your self with firewall…
1 2 3 4 5 6 7 8 9 10 11 | shorewall shorewall-nat shorewall-accounting shorewall-hosts shorewall-interfaces shorewall-routestopped shorewall.conf shorewall-masq shorewall-policy shorewall-rules shorewall-zones |
Ok Sekian dulu dari saya.