FaizBlog LogoFaizBlog
Back to all articles
mikrotikfirewallblokir-websitednstutorial

Cara Memblokir Website di MikroTik (DNS, Layer 7, Web Proxy)

3 cara memblokir website di MikroTik: metode DNS static, Layer 7 protocol regex, dan Web Proxy — lengkap dengan kelebihan-kekurangannya.

AI Insights

Generate a summary and suggested tags for this post.

Butuh blokir situs judi, medsos jam kerja, atau konten dewasa? MikroTik punya 3 metode utama untuk blokir website — masing-masing punya kelebihan dan trade-off tersendiri.

Metode Blokir Website di MikroTik

Perbandingan 3 Metode

MetodeHTTPS?Beban CPUAkurasiKesulitan
DNS Static✅ YaRinganSedangMudah
Layer 7❌ TerbatasBeratTinggiSulit
Web Proxy❌ HTTP sajaSedangTinggiSedang

Metode 1: DNS Static (Paling Simpel)

Redirect domain ke IP lokal:

/ip dns static
add name=facebook.com address=127.0.0.1
add name=www.facebook.com address=127.0.0.1
add name=m.facebook.com address=127.0.0.1

Syarat: client harus pakai DNS MikroTik (set via DHCP).

Metode 2: Layer 7 Protocol

Blokir berbasis regex di paket:

Layer 7 Regex Blokir

/ip firewall layer7-protocol
add name=medsos regexp="^.+(facebook|instagram|tiktok).+\$"

/ip firewall filter
add chain=forward layer7-protocol=medsos action=drop

⚠️ Layer 7 boros CPU. Untuk trafik HTTPS, hanya bisa deteksi handshake awal.

Metode 3: Web Proxy

Aktifkan Web Proxy → set redirect:

/ip proxy set enabled=yes port=8080
/ip proxy access add dst-host=*facebook* action=deny
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 \
    action=redirect to-ports=8080

⚠️ Web Proxy hanya untuk HTTP, HTTPS harus SSL bump (kompleks).

Kombinasi = Paling Efektif

Best practice:

  1. DNS Static → blokir domain populer
  2. Address List → blokir IP CDN
  3. Layer 7 → catch fallback

Contoh: Blokir Judi Online

/ip dns static
add name=domain-judi.com address=127.0.0.1

/ip firewall address-list
add address=judi-cdn-ip list=blacklist

/ip firewall filter
add chain=forward dst-address-list=blacklist action=drop

Kesimpulan

Untuk pemula → DNS Static paling worth-it (mudah + ringan). Untuk kontrol ketat → gabung dengan Address List. Layer 7 dan Web Proxy hanya dipakai kalau memang butuh regex/HTTP filtering spesifik karena beban CPU besar.