NUXS ENVIRONMENT

Implementasi VLAN dengan Dua MikroTik (Router dan Switch)

Implementasi VLAN dengan Dua MikroTik (Router dan Switch)

Praktik VLAN dengan dua MikroTik: MikroTik 1 sebagai router utama (VLAN, DHCP, Wi-Fi, hotspot, NAT) dan MikroTik 2 sebagai switch VLAN.

A. Topologi jaringan

Praktik ini memakai dua perangkat MikroTik. MikroTik 1 bertugas sebagai router utama (VLAN, DHCP, Wi-Fi, hotspot, NAT), sedangkan MikroTik 2 dipakai sebagai switch yang meneruskan VLAN ke PC client.

Perangkat / PortTerhubung keKeterangan
ISPether1 MikroTik 1Sumber internet
ether4 MikroTik 1PC AdminUntuk konfigurasi via Winbox
ether2 MikroTik 1ether1 MikroTik 2Jalur trunk (membawa VLAN 10 dan 20)
ether2 MikroTik 2PC ClientVLAN 10 (siswa)
ether3 MikroTik 2PC ClientVLAN 20 (guru)
SegmenVLAN IDJaringan
wlan1 (hotspot)-192.168.20.1/24
vlan1-siswa10192.168.40.1/24
vlan2-guru20192.168.60.1/24
Topologi jaringan

B. Konfigurasi MikroTik 1 (Router utama dan wireless)

1. Bersihkan semua konfigurasi

  1. Klik System → Reset Configuration.
  2. Centang No Default Configuration.
  3. Klik Apply → OK.
Reset configuration

2. Berikan identitas pada MikroTik 1

  1. Klik System → Identity.
  2. Masukkan nama Wifi Routerboard.
  3. Klik Apply → OK.
Identity MikroTik 1

3. Nyalakan wireless

  1. Masuk ke menu Wireless.
  2. Klik wlan1 satu kali.
  3. Klik ikon centang biru (✓) untuk mengaktifkannya.
Mengaktifkan wlan1

4. Membuat VLAN 10 dan 20

Buat dua interface VLAN di atas ether2 (jalur menuju MikroTik 2).

  1. VLAN siswa: klik Interface → tab VLAN → klik +.
    • Name: vlan1-siswa
    • VLAN ID: 10
    • Interface: ether2
    • Klik Apply → OK.
  2. VLAN guru: klik + lagi.
    • Name: vlan2-guru
    • VLAN ID: 20
    • Interface: ether2
    • Klik Apply → OK.
Membuat interface VLAN siswa
Membuat interface VLAN guru

5. Memberi MikroTik internet dari ISP

  1. Klik IP → DHCP Client → klik +.
  2. Interface: ether1.
  3. Klik Apply → OK.
DHCP Client

6. Memberi IP address pada WLAN dan VLAN

Klik IP → Addresses → klik +, lalu buat tiga alamat berikut satu per satu:

InterfaceAddress
wlan1192.168.20.1/24
vlan1-siswa192.168.40.1/24
vlan2-guru192.168.60.1/24

Setiap alamat diakhiri dengan klik Apply → OK.

IP address wlan1
IP address vlan1-siswa
IP address vlan2-guru

7. Memberi DHCP Server pada WLAN dan VLAN

Klik IP → DHCP Server → DHCP Setup, lalu ulangi untuk tiga interface berikut:

InterfaceAddress to Give Out
wlan1192.168.20.10-192.168.20.50
vlan1-siswa192.168.40.10-192.168.40.50
vlan2-guru192.168.60.10-192.168.60.50

Pada setiap wizard, klik Next sampai selesai.

DHCP setup wlan1
DHCP setup wlan1 lanjutan
DHCP setup wlan1 selesai
DHCP setup vlan1-siswa
DHCP setup vlan2-guru
Daftar DHCP server

8. Konfigurasi WLAN

  1. Membuat Security Profile (password): klik Wireless → tab Security Profiles → klik +.
    • Name: profile1 (contoh)
    • Mode: dynamic keys
    • Authentication Types: WPA PSK
    • WPA PSK (Pre-Shared Key): 12345678 (password Wi-Fi)
    • Klik Apply → OK.
  2. Mengatur wlan1: klik Wireless → tab WiFi Interfaces → klik dua kali wlan1.
    • Mode: ap bridge
    • Band: 2GHz-B/G/N
    • SSID: UKK_7 (format UKK_NoAbsen)
    • Security Profile: profile1 (yang tadi dibuat)
    • Klik Apply → OK.
Security profile
Pengaturan wlan1

9. Konfigurasi Hotspot

  1. Membuat server hotspot: klik IP → Hotspot → tab Servers → Hotspot Setup.
    • Interface: wlan1
    • DNS Name: portalsmk.sch.id
    • Username: admin
    • Password: admin
    • Klik Next sampai selesai.
  2. Membuat User Profiles (tab User Profiles → +), tiga profil berikut:
    NameAddress PoolRate Limit (rx/tx)
    kepalasekolahdhcp_pool0512k/512k
    gurudhcp_pool0256k/256k
    siswadhcp_pool0128k/128k
    Sesuaikan Address Pool dengan pool DHCP wlan1 milik Anda (lihat di IP → Pool). Klik Apply → OK.
  3. Membuat Users / voucher (tab Users → +), tiga akun berikut dengan Server hotspot1:
    NamePasswordProfile
    kepalasekolah123kepalasekolah
    guru123guru
    siswa123siswa
Hotspot setup
Hotspot setup lanjutan
Hotspot setup selesai
User profile kepalasekolah
User profile guru
User profile siswa
User kepalasekolah
User guru
User siswa
Password 123 dan admin hanya contoh latihan. Untuk pemakaian nyata gunakan password yang kuat dan unik.

10. Konfigurasi NAT

  1. Klik IP → Firewall → tab NAT → klik +.
  2. Tab General: Out. Interface = ether1.
  3. Tab Action: Action = masquerade.
  4. Klik Apply → OK.
NAT tab General
NAT tab Action

C. Konfigurasi MikroTik 2 (Router sebagai switch)

MikroTik 2 tidak mengatur IP; perangkat ini hanya menjadi switch yang meneruskan VLAN 10 dan 20 dari MikroTik 1 ke port client.

1. Bersihkan semua konfigurasi

  1. Klik System → Reset Configuration.
  2. Centang No Default Configuration.
  3. Klik Apply → OK.
Reset configuration

2. Berikan identitas pada MikroTik 2

  1. Klik System → Identity.
  2. Masukkan nama Routerboard.
  3. Klik Apply → OK.
Identity MikroTik 2

3. Tambahkan bridge

  1. Klik Bridge → tab Bridge → klik +.
  2. Klik Apply → OK.
Menambah bridge

4. Tambahkan port bridge

Klik Bridge → tab Ports → klik +, lalu tambahkan ether1, ether2, dan ether3 satu per satu (masing-masing diakhiri Apply → OK).

Port ether1
Port ether2
Port ether3

5. Menambahkan Switch VLAN

Klik Switch → tab VLAN → klik +, lalu buat dua entri:

SwitchVLAN IDPorts
switch110ether1, ether2
switch120ether1, ether3
Switch VLAN 10
Switch VLAN 20

6. Atur port switch

Klik Switch → tab Ports, lalu klik dua kali tiap port:

PortPeranVLAN ModeVLAN HeaderDefault VLAN ID
ether1Trunksecureadd if missing-
ether2Access VLAN 10securealways strip10
ether3Access VLAN 20securealways strip20

Setiap port diakhiri dengan klik Apply → OK.

Port ether1 trunk
Port ether2 access
Port ether3 access
Menu Switch hanya tersedia pada perangkat MikroTik yang memiliki chip switch (misalnya seri hAP/RB951). Pada perangkat lain gunakan bridge VLAN filtering.

Hasil pengujian dan verifikasi

  1. Hubungkan PC client ke ether2 MikroTik 2, lalu pastikan mendapat IP dari 192.168.40.10-50 (VLAN siswa).
  2. Pindahkan kabel ke ether3 MikroTik 2, lalu pastikan mendapat IP dari 192.168.60.10-50 (VLAN guru).
  3. Hubungkan HP ke SSID UKK_7, buka browser, lalu login portal hotspot dengan salah satu akun voucher.
  4. Uji ping google.com dari tiap client untuk memastikan NAT berjalan.