Sunday, 12 October 2025

Panduan Setting VLAN, VPN, dan Hotspot di MikroTik

Panduan Setting VLAN, VPN, dan Hotspot di MikroTik

Tutorial konfigurasi fitur lanjutan MikroTik RouterOS: VLAN untuk segmentasi jaringan, VPN untuk akses remote aman, dan Hotspot untuk autentikasi user.

1. Setting VLAN di MikroTik

VLAN digunakan untuk memisahkan segmen jaringan (misal: kantor, tamu, CCTV) dalam satu switch/port.

Contoh Topologi

  • ether2 → VLAN 10 (Staff)
  • ether3 → VLAN 20 (Tamu)

Langkah Konfigurasi

# Tambahkan VLAN interface
/interface vlan add name=vlan10 vlan-id=10 interface=ether2
/interface vlan add name=vlan20 vlan-id=20 interface=ether3

# IP address untuk masing-masing VLAN
/ip address add address=192.168.10.1/24 interface=vlan10
/ip address add address=192.168.20.1/24 interface=vlan20

# DHCP server untuk VLAN 10
/ip pool add name=pool10 ranges=192.168.10.10-192.168.10.200
/ip dhcp-server add name=dhcp10 interface=vlan10 address-pool=pool10 disabled=no
/ip dhcp-server network add address=192.168.10.0/24 gateway=192.168.10.1 dns-server=192.168.10.1

# DHCP server untuk VLAN 20
/ip pool add name=pool20 ranges=192.168.20.10-192.168.20.200
/ip dhcp-server add name=dhcp20 interface=vlan20 address-pool=pool20 disabled=no
/ip dhcp-server network add address=192.168.20.0/24 gateway=192.168.20.1 dns-server=192.168.20.1
    

Catatan: Pastikan switch mendukung VLAN (802.1Q) dan port sudah diatur sebagai trunk/access sesuai kebutuhan.

2. Setting VPN di MikroTik (PPTP/L2TP)

VPN memungkinkan user terhubung ke jaringan kantor dari luar dengan aman.

Contoh Konfigurasi L2TP dengan Secret

# Aktifkan L2TP server
/interface l2tp-server server set enabled=yes default-profile=default

# Tambah user VPN
/ppp secret add name=vpnuser password=StrongPass123 service=l2tp profile=default

# Tambah IP pool VPN
/ip pool add name=vpn-pool ranges=192.168.50.10-192.168.50.50
/ppp profile set default local-address=192.168.50.1 remote-address=vpn-pool

# Atur firewall NAT untuk VPN
/ip firewall nat add chain=srcnat src-address=192.168.50.0/24 out-interface=ether1 action=masquerade
    

Koneksi dari Client

  • Server: Public IP atau DDNS MikroTik
  • Protocol: L2TP
  • User: vpnuser
  • Password: StrongPass123

Disarankan gunakan L2TP + IPsec untuk keamanan lebih baik.

3. Setting Hotspot di MikroTik

Hotspot dipakai untuk autentikasi pengguna via halaman login (cocok untuk cafe, sekolah, hotel).

Langkah Konfigurasi

# Tambah IP LAN (contoh ether4 untuk Hotspot)
/ip address add address=192.168.100.1/24 interface=ether4

# Setup Hotspot (pakai wizard di Winbox)
/ip hotspot setup
- interface = ether4
- local address = 192.168.100.1/24
- pool = 192.168.100.2-192.168.100.254
- DNS name = hotspot.local
- user admin hotspot = admin-hotspot
    

Tambah User Hotspot

/ip hotspot user add name=user1 password=12345 profile=default
    

Akses Client

User akan diarahkan otomatis ke halaman login http://hotspot.local/login saat browsing.

Tips Keamanan

  • Gunakan password kuat untuk VPN & Hotspot admin.
  • Update RouterOS ke versi terbaru.
  • Batasi akses manajemen hanya dari IP tertentu.
  • Untuk Hotspot, pertimbangkan HTTPS login & radius server untuk skala besar.

Anda bisa mengkombinasikan VLAN, VPN, dan Hotspot dalam satu router sesuai kebutuhan jaringan. Jika mau, saya bisa buatkan script otomatis (tinggal paste di Terminal MikroTik) untuk konfigurasi full: 1 WAN, 2 VLAN, VPN remote, dan Hotspot.

No comments:

Post a Comment