Firewall Aman MikroTik untuk IP Public via Tunnel ke Server Lokal

Diposting pada
Setelah IP Public via tunnel (SSTP / L2TP) di-NAT ke server lokal,
langkah PALING WAJIB adalah mengamankan firewall.
Tanpa firewall yang benar, server sangat rentan terhadap:

  • Port scanning
  • Brute force SSH
  • Serangan bot otomatis

Tujuan Firewall Ini

  • Hanya port penting yang boleh diakses
  • Blok semua akses lain dari internet
  • Aman untuk server Docker / WordPress / WhatsApp Gateway

Topologi

Internet
   |
IP Public (Tunnel)
   |
[MikroTik]
   |  (Firewall)
   |
Server (192.168.1.11)

Contoh Data

  • Interface Tunnel: sstp-out1
  • IP Server: 192.168.1.11

Prinsip Firewall Aman

  • Allow yang perlu saja
  • Drop sisanya
  • Stateful firewall (connection-state)

Step 1 – Allow Established & Related (WAJIB PALING ATAS)

/ip firewall filter add \
chain=forward \
connection-state=established,related \
action=accept \
comment="ALLOW ESTABLISHED, RELATED"

Step 2 – Drop Invalid Connection

/ip firewall filter add \
chain=forward \
connection-state=invalid \
action=drop \
comment="DROP INVALID"

Step 3 – Allow Port Penting ke Server

Port yang umum dibuka:

  • HTTP → 80
  • HTTPS → 443
  • SSH → 22 (opsional)

Allow HTTP & HTTPS:

/ip firewall filter add \
chain=forward \
protocol=tcp \
dst-address=192.168.1.11 \
dst-port=80,443 \
in-interface=sstp-out1 \
action=accept \
comment="ALLOW WEB SERVER"

Allow SSH (jika perlu):

/ip firewall filter add \
chain=forward \
protocol=tcp \
dst-address=192.168.1.11 \
dst-port=22 \
in-interface=sstp-out1 \
action=accept \
comment="ALLOW SSH"

Step 4 – Drop Semua Akses Lain dari Tunnel

Rule ini PALING PENTING dan harus berada di bawah.

/ip firewall filter add \
chain=forward \
in-interface=sstp-out1 \
action=drop \
comment="DROP ALL OTHER FROM TUNNEL"

Urutan Rule (SANGAT PENTING)

  1. Allow established, related
  2. Drop invalid
  3. Allow port yang dibutuhkan
  4. Drop lainnya

Cek urutan:

/ip firewall filter print

Proteksi Tambahan (Opsional tapi Disarankan)

Limit Akses SSH (Hanya IP Tertentu)

/ip firewall filter add \
chain=forward \
protocol=tcp \
dst-address=192.168.1.11 \
dst-port=22 \
src-address=YOUR-IP-PUBLIC \
action=accept \
comment="SSH FROM ADMIN IP"

Blok Port Scan Sederhana

/ip firewall filter add \
chain=forward \
protocol=tcp \
psd=21,3s,3,1 \
action=drop \
comment="DROP PORT SCAN"

Testing Firewall

  • Cek web → harus bisa
  • Scan port → harus tertutup
  • SSH dari IP lain → harus gagal

Gunakan:

nmap IP-PUBLIC

Kesalahan Umum

  • Drop rule dipasang di atas
  • Lupa allow established
  • Salah interface (bukan tunnel)

Cocok untuk Server via Tunnel

Firewall ini sangat cocok untuk:

  • Server Docker
  • WordPress
  • WhatsApp Gateway
  • Colocation Mini

Penutup

Dengan firewall ini, server lokal via tunnel menjadi
jauh lebih aman
tanpa mengorbankan akses yang diperlukan.

Tutorial lanjutan MikroTik:

  • NAT 1:1 IP Public via tunnel
  • Anti brute force SSH
  • Notifikasi firewall ke WhatsApp

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *