Untuk pengaturan firewall di ubuntu dapat menggunakan perintah ufw melalui console. ufw adalah singkatan dari “Uncomplicated Firewall” yang bikin kita mudah untuk setting iptables di linux ubuntu.
contoh penggunaannya untuk mail server Zimbra adalah sebagai berikut :
# ufw logging on <— menyalakan log
# ufw default deny <—- defaultnya dirubah jadi deny
# ufw allow ssh/tcp <— biar bisa pake ssh
# ufw allow proto tcp to any port 25 <— buat SMTP
# ufw allow proto tcp to any port 80 <— buat http
# ufw allow proto tcp to any port 110 <— buat POP3
# ufw allow proto tcp to any port 143 <— buat IMAP
# ufw allow proto tcp from 192.168.0.0/24 to any port 389 <— untuk LDAP tapi hanya LAN saja
# ufw allow proto tcp any port 443 <— buat HTTPS
# ufw allow proto tcp any port 465 <— buat SMTPS
# ufw allow proto tcp any port 993 <— buat IMAPS
# ufw allow proto tcp any port 995 <— buat POP3S
# ufw allow proto tcp any port 7071 <— buat admin cpanel Zimbra
# ufw enable <— update firewall
# ufw status <— lihat hasil konfigurasi Firewall loaded
To Action From
– —— —-
22:tcp ALLOW Anywhere
80:tcp ALLOW Anywhere
22:tcp ALLOW 192.168.0.0/24
25:tcp ALLOW Anywhere
110:tcp ALLOW Anywhere
143:tcp ALLOW Anywhere
7071:tcp ALLOW Anywhere
389:tcp ALLOW 192.168.0.0/24
443:tcp ALLOW Anywhere
465:tcp ALLOW Anywhere
993:tcp ALLOW Anywhere
995:tcp ALLOW Anywhere
Untuk delete rule yang sudah kita buat bisa dengan perintah sbb :
# ufw delete allow ssh/tcp <— menghapus rule ssh
# ufw delete allow 995/tcp <— menghapus rule port tcp 995
Posted by joseph23 