Artykuł omawia tworzenie rozległej sieci WiFi z roamingiem z wykorzystaniem sterownika Wave2 na Mikrotikach cAP ac. To specyficzny przypadek ponieważ cAP mają problem z przydzielaniem VLANów przez provisioning z kontrolera. Trzeb przypisać je ręcznie po stronie cAP. Na cAPach trzeba będzie utworzyć osobny bridge dla każdego VLAN i przypisać do takiego bridge właściwy interfejs radiowy.
Tworzymy VLANy
/interface/vlan/add name=vlan10-norm vlan-id=10 interface=bridge
/interface/vlan/add name=vlan20-mgmt vlan-id=20 interface=bridge
/interface/vlan/add name=vlan30-iots vlan-id=30 interface=bridge
/interface/vlan/add name=vlan40-tele vlan-id=40 interface=bridge
/interface/vlan/add name=vlan50-cctv vlan-id=50 interface=bridge
/interface/vlan/add name=vlan60-gues vlan-id=60 interface=bridge
Dodajemy interfejsy VLAN do listy sieci lokalnych co ułatwi tworzenie ewentualnych reguł firewalla
/interface/list/member add list="LAN" interface="vlan10-norm"
/interface/list/member add list="LAN" interface="vlan20-mgmt"
/interface/list/member add list="LAN" interface="vlan30-iots"
/interface/list/member add list="LAN" interface="vlan40-tele"
/interface/list/member add list="LAN" interface="vlan50-cctv"
/interface/list/member add list="LAN" interface="vlan60-gues"
Należy ustalić jakie porty porty jak mają być tagowane i ewentualnie nietagowane.
/interface/bridge/print detail
Przypisujemy adresy IP:
/ip/address/add address=192.168.218.254/24 interface=vlan10-norm
/ip/address/add address=10.20.0.254/24 interface=vlan20-mgmt
/ip/address/add address=10.30.0.254/24 interface=vlan30-iots
/ip/address/add address=10.40.0.254/24 interface=vlan40-tele
/ip/address/add address=10.50.0.254/24 interface=vlan50-cctv
/ip/address/add address=10.60.0.254/24 interface=vlan60-gues
Tworzymy pule adresów pod serwery DHCP...
/ip/pool/add name=pool10 ranges=192.168.218.10-192.168.218.150
/ip/pool/add name=pool20 ranges=10.20.0.10-10.20.0.150
/ip/pool/add name=pool30 ranges=10.30.0.10-10.30.0.150
/ip/pool/add name=pool40 ranges=10.40.0.10-10.40.0.150
/ip/pool/add name=pool50 ranges=10.50.0.10-10.50.0.150
/ip/pool/add name=pool60 ranges=10.60.0.10-10.60.0.150
... i serwery DHCP:
/ip/dhcp-server/add name=dhcp-vlan10 interface=vlan10-norm lease-time=30m address-pool=pool10
/ip/dhcp-server/add name=dhcp-vlan20 interface=vlan20-mgmt lease-time=30m address-pool=pool20
/ip/dhcp-server/add name=dhcp-vlan30 interface=vlan30-iots lease-time=30m address-pool=pool30
/ip/dhcp-server/add name=dhcp-vlan40 interface=vlan40-tele lease-time=30m address-pool=pool40
/ip/dhcp-server/add name=dhcp-vlan50 interface=vlan50-cctv lease-time=30m address-pool=pool50
/ip/dhcp-server/add name=dhcp-vlan60 interface=vlan60-gues lease-time=30m address-pool=pool60
Tworzymy kanały:
/interface wifi channel
add name=5GHz-80MHz band=5ghz-ac disabled=no frequency=5180,5260,5500,5580,5745 width=20/40/80mhz
add name=5GHz-40MHz band=5ghz-ac disabled=no frequency=5500,5540,5580,5620,5745,5785,5825 width=20/40mhz
add name=2GHz-20MHz band=2ghz-g disabled=no frequency=2412,2437,2462 width=20mhz
add name=2GHz-40MHz band=2ghz-n disabled=no frequency=2402,2442 width=20/40mhz
Tworzymy profile z hasłami sieci WiFi:
/interface/wifi/security/add name=sec-norm authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
/interface/wifi/security/add name=sec-mgmt authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
/interface/wifi/security/add name=sec-iots authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
/interface/wifi/security/add name=sec-tele authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
/interface/wifi/security/add name=sec-cctv authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
/interface/wifi/security/add name=sec-gues authentication-types=wpa2-psk encryption=ccmp,gcmp passphrase="REDACTED"
Datapath - w przypadku cAP nie przypisujemy PVID przez datapath - wszystko odbywać się będzie bezpośrednio na cAP
/interface/wifi/datapath/add name=datapath-oncap traffic-processing=on-cap
Tworzymy profil konfiguracyjny WiFi:
/interface/wifi/configuration/
add name=cfg-norm5 mode=ap ssid=norm5 country=Poland security=sec-norm datapath=datapath-oncap channel=5GHz-80MHz
add name=cfg-norm2 mode=ap ssid=norm2 country=Poland security=sec-norm datapath=datapath-oncap channel=2GHz-40MHz
add name=cfg-mgmt2 mode=ap ssid=mgmt2 country=Poland security=sec-mgmt datapath=datapath-oncap channel=2GHz-40MHz
add name=cfg-iots2 mode=ap ssid=iots2 country=Poland security=sec-iots datapath=datapath-oncap channel=2GHz-40MHz
add name=cfg-tele2 mode=ap ssid=tele2 country=Poland security=sec-iots datapath=datapath-oncap channel=2GHz-40MHz
add name=cfg-gues2 mode=ap ssid=goscie5 country=Poland security=sec-iots datapath=datapath-oncap channel=5GHz-80MHz
add name=cfg-gues5 mode=ap ssid=goscie2 country=Poland security=sec-iots datapath=datapath-oncap channel=2GHz-40MHz
Provisioning:
Dodajemy główną konfigurację dla danego pasma jako master a pozostałe jako slave, jako Action dajemy create enabled.
Pierwsza sprawa - aktualne oprogramowanie, najlepiej ta samam wersja co na kontrolerze.
Koniecznie checemy by interfejsy były pod naszą kontrolą:
/interface/wifi/cap
set caps-man-addresses=10.20.0.254 discovery-interfaces=vlan20-mgmt enabled=yes slaves-static=yes
With wifi-qcom-ac, VLANs can only be configured manually per-interface in bridge settings. It’s worth to check whether the CAP configuration is VLAN-aware. VLAN filtering should be enabled on the bridge, but ingress filtering must be disabled. Similarly, ingress filtering must be disabled on ether1. I suggest using the fallback VLAN mode for ether1 and switch1 cpu switch ports. Finally, the Slaves Static option in CAP settings should be turned on. You can use the CLI commands below to quickly adjust the settings.
/interface bridge port set ingress-filtering=no [find where interface=ether1]
/interface bridge set bridgeLocal vlan-filtering=yes ingress-filtering=no
/interface ethernet switch port set ether1 vlan-mode=fallback
/interface ethernet switch port set "switch1 cpu" vlan-mode=fallback
/interface wifi cap set slaves-static=yes
Then, you can assign VLANs to your wireless interfaces (one VLAN per SSID). First, add a new port in Bridge » Ports. Choose the wireless interface you want to assign the VLAN to, and under VLAN set PVID to the VLAN number you want. Ingress filtering should be turned on this time.
Next, in Bridge » VLANs, add the VLAN to the bridge. Type the VLAN ID, put the ether1 interface as tagged and the wireless interface as untagged. Finally, add a switch record for the VLAN as well. In Switch » VLAN, add the VLAN ID with switch1-cpu and ether1 ports.
Now all traffic on the wireless interface should flow through the VLAN. For example to assign VLAN 100 to wifi1, you can use the following CLI commands:
/interface bridge port add bridge=bridgeLocal interface=wifi1 pvid=100
/interface bridge vlan add bridge=bridgeLocal tagged=ether1 untagged=wifi1 vlan-ids=100
/interface ethernet switch vlan add ports=switch1-cpu,ether1 switch=switch1 vlan-id=100
WARINING must keep the VLAN configuration in sync with your SSIDs manually. For example, if you change the SSID that broadcasts on an existing interface, the VLAN assignment will stay the same. If you remove a slave configuration, re-provision, then add it back, a new wireless interface will be created without any VLAN assigned to it.
=======================================================================
Zakładamy, że potrzebne będą następujące VLANy
//Na tą chwilę zalecaną opcją tworzenia VLANów w Mikrotikach jest stworzenie nowego interfejsu VLAN i w jego właściwościach wskazania interfejsu fizycznego którego on dotyczy a następnie zebranie wszystkich interfejsów VLAN i dodanie ich do bridge.
Tworzymy most do którego dodajemy interfejsy które mają pracować z VLANami. Następnie do mostu dodajemy VLANy w zakładce VLANs okna Bridge. Trzeba pamiętać, że VLANy mają być tagowane na intefejsach przypisanych do bridge jak i dodany do tagowanych musi być też bridge. W zakładce Ports okna Bridge w każdym intefejsie w jego zakładce VLAN zaznaczamy dla pola Frame Types wartość admin only VLAN tagged. Spowodoje to, że na tym porcie możliwy będzie tylko ruch tagowany. Dla portów które mają być untagged należy podać właściwy PVID dla VLANu.
Tworzymy interfejsy VLAN z oknie Interfaces dodając VLAN. Dodając taki interfejs w polu VLAN ID wskazujemy PVID danego VLANu i przypisujemy go do konkretnego interfejsu - w tym przypadku do tworzonego wcześniej brige. Dodajemy w oknie IP/Addresses adres IP dla danego VLANu i stawiamy ewentualny serwer DHCP na odpowiednim VLANie.
Do utworzonych intefejsów VLAN przypisujemy adresy IP i w razie potrzeby dodajemy serwery DHCP.
Zaczynamy od utworzenia profili security, wybieramy WPA2 PSK i CCMP, podajemy hasło i tak samo dla każdego SSID.
/interface wifi channel
add band=5ghz-ac disabled=no frequency=5180,5260,5500,5580,5745 name=5GHz-80MHz width=20/40/80mhz
add band=5ghz-ac disabled=no frequency=5500,5540,5580,5620,5745,5785,5825 name=5GHz-40MHz width=20/40mhz
add band=2ghz-g disabled=no frequency=2412,2437,2462 name=2GHz-20MHz width=20mhz
add band=2ghz-n disabled=no frequency=2402,2442 name=2GHz-40MHz width=20/40mhz
Datapath wskazuje co ma się dziać z ruchem z interfejsów WiFi zarządzanych przez CAPSMANa. Tworzymy osobne datapath dla każdego VLANu który ma być dostępny przez WiFi wskazując bridge pod które wpięte są VLANy i podając właściwy VLAN ID.
channel ma być czy nie?
/interface wifi configuration
add name=XYZ-5G ssid="XYZ-5G" mode=ap security=XYZ-SEC datapath=XYZ channel=5GHz-80MHz
add name=XYZ-2G ssid="XYZ-2G" mode=ap security=XYZ-SEC datapath=XYZ channel=2GHz-20MHz
add name=GOSCIE ssid="Goscie" mode=ap security=GUEST-SEC datapath=GOSCIE channel=2GHz-20MHz
Jeżeli możemy się połączyć przez sieć WiFi i uzyskać adres IP z puli przewidzianej dla VLANu przypisanego do wybranego SSID to znaczy, że konfiguracja VLANów działa prawidłowo.
Tworzymy w tym przypadku dwa profile wypełniając pola: Supported Bands: 5GHz AC Action: create enabled Master Configuration: XYZ-5G
Drugi profil: Supported Bands: 5GHz N Action: create enabled Master Configuration: XYZ-2G
Na zakładce WiFi klikamy w CAPsMAN i zaznaczamy Enabled, jako Interfaces wybieramy VLAN do zarządzania, CA Certificate dajemy auto i tak samo Certificate, zatwierdzamy.
Tworzymy bridge, wyłączamy STP, dodajemy do niego jako porty interfejsy robiące za uplink.
Następnie do mostu dodajemy VLANy w zakładce VLANs okna Bridge. Trzeba pamiętać, że VLANy mają być tagowane na intefejsach przypisanych do bridge jak i interfejsach będących uplinkami.
/interface/bridge/vlan/add vlan-id=40 bridge=bridge_vlan tagged=ether1,ether2,bridge_vlan
W zakładce Ports ustawiamy Frame Types jako admin only VLAN tagged dla uplinków.
Tworzymy interfejsy VLAN z oknie Interfaces dodając VLAN. Dodając taki interfejs w polu VLAN ID wskazujemy PVID danego VLANu i przypisujemy go do utworzonego wcześniej brige. Dodajemy klienta DHCP na utworzonym interfejsie VLAN dla zarządzania siecią.
/interface/vlan/add name=vlan10-normal vlan-id=10 interface=bridge_vlan
/interface/vlan/add name=vlan20-mgmt vlan-id=20 interface=bridge_vlan
/interface/vlan/add name=vlan30-iot vlan-id=30 interface=bridge_vlan
/interface/vlan/add name=vlan40-telefony vlan-id=40 interface=bridge_vlan
/interface/vlan/add name=vlan50-monitoring vlan-id=50 interface=bridge_vlan
/interface/vlan/add name=vlan60-goscie vlan-id=60 interface=bridge_vlan
Na interfejsie VLAN odpowiedzialny za sieć do zarządzania uruchamiamy klienta DHCP.
/ip/dhcp-client/add interface=vlan20-mgmt
Teraz możemy uruchomić VLAN Filtering w zakładce VLAN interfejsu bridge.
W zakłace WiFi wybieramy CAP i klikamy Enabled, jako Discovery Interfaces dajemy VLAN do zarządzania a w polu Certyficate ustawiamy request. Po zatwierdzeniu w polu Current CAPsMAN Identify powinna pojawić się nazwa kontrolera CAP.