Berikut skrip dasar lengkap untuk DHCP-Client (WAN) + LAN biasa + Hotspot (LAN) pada RouterOS v6.
Struktur jaringan yang dipakai:
Jika interface berbeda β tinggal ganti namanya.
# ================================
# 1. WAN: DHCP CLIENT (ISP)
# ================================
/ip dhcp-client add interface=ether1 use-peer-dns=no use-peer-ntp=yes 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 (MASQUERADE)
# ================================
/ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade comment="NAT Internet"
ether1, LAN = ether2.