Skrip Dasar Hotspot MikroTik RouterOS v7

Kategori: Artikel Mikrotik, Skrip Mikrotik , 42 Views

Berikut skrip dasar untuk DHCP-Client (WAN) + LAN Biasa + Hotspot (LAN) pada MikroTik RouterOS v7.
Struktur jaringan sama seperti sebelumnya:

  • ether1 = WAN (DHCP Client)
  • ether2 = LAN Biasa (192.168.20.0/24)
  • ether3 = LAN Hotspot (192.168.10.0/24)

Jika interface Anda berbeda → tinggal ganti namanya.


Skrip Dasar RouterOS v7 — DHCP-Client + LAN + Hotspot

# ==========================================================
# 1. WAN (DHCP-CLIENT)
# ==========================================================
/ip dhcp-client add interface=ether1 use-peer-dns=no add-default-route=yes disabled=no


# ==========================================================
# 2. LAN BIASA (ether2)
# ==========================================================
/ip address add address=192.168.20.1/24 interface=ether2 comment="LAN Biasa"

/ip pool add name=pool-lan ranges=192.168.20.10-192.168.20.254

/ip dhcp-server add name=dhcp-lan interface=ether2 address-pool=pool-lan lease-time=1h disabled=no

/ip dhcp-server network add address=192.168.20.0/24 gateway=192.168.20.1 dns-server=192.168.20.1


# ==========================================================
# 3. LAN HOTSPOT (ether3)
# ==========================================================
/ip address add address=192.168.10.1/24 interface=ether3 comment="LAN Hotspot"

/ip pool add name=pool-hs ranges=192.168.10.10-192.168.10.254

/ip dhcp-server add name=dhcp-hs interface=ether3 address-pool=pool-hs lease-time=1h disabled=no

/ip dhcp-server network add address=192.168.10.0/24 gateway=192.168.10.1 dns-server=192.168.10.1


# ==========================================================
# 4. DNS SERVER
# ==========================================================
/ip dns set allow-remote-requests=yes servers=8.8.8.8,1.1.1.1


# ==========================================================
# 5. HOTSPOT SETUP (ether3)
# ==========================================================
/ip hotspot profile add name=hsprof hotspot-address=192.168.10.1 dns-name=hotspot.local use-radius=no

/ip hotspot add name=hotspot-lan interface=ether3 address-pool=pool-hs profile=hsprof idle-timeout=5m


# ==========================================================
# 6. HOTSPOT USER DEFAULT
# ==========================================================
/ip hotspot user add name=admin password=admin123 profile=default
/ip hotspot user profile set default shared-users=1 rate-limit=5M/5M


# ==========================================================
# 7. NAT INTERNET (ROS v7 — FIREWALL/NAT)
# ==========================================================
/ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade comment="NAT Internet"

📝 Perbedaan Penting RouterOS v7

  • Struktur firewall tidak berubah signifikan, tapi Backend NAT/Fasttrack lebih modern.
  • Routing engine baru (v7) → tapi DHCP-Client + NAT tetap sama seperti contoh.
  • Hotspot di v7 masih memakai command v6 (backward compatible).

 Cara Pakai

  1. Copy–paste seluruh skrip ke New Terminal di MikroTik.
  2. Pastikan interface WAN = ether1, LAN = ether2.
  3. Setelah selesai, perangkat klien akan diarahkan ke halaman login hotspot.