Skip to main content
Version: 7.26

Wi-Fi for an office with CAPsMAN

Package: wifi-qcom, wifi-qcom-ac

This guide builds the Wi-Fi of an office with several access points that one router manages with CAPsMAN:

  • Office is the staff SSID. Staff devices get addresses in VLAN 10, 192.168.10.0/24.
  • Office-Guest is the guest SSID. Guests get addresses in VLAN 20, 192.168.20.0/24, cannot reach each other on the same access point, and cannot reach the office LAN or the staff VLAN.
  • Every access point sends both SSIDs on 5 GHz and 2.4 GHz. The access points connect only to the office router.

The router keeps all Wi-Fi settings. An access point gets its settings when it connects, and a change on the router reaches all access points at once. For how CAPsMAN works, see WiFi CAPsMAN.

Before you begin​

  • The office router has the default configuration: the LAN bridge bridge, the LAN interface list and the default firewall. The router does not need a Wi-Fi radio. In this guide, the office LAN is 192.168.99.0/24 and the router is 192.168.99.1; with the default 192.168.88.0/24, use 192.168.88.1 in caps-man-addresses.
  • The access points use the wifi-qcom package (802.11ax access points, such as the cAP ax). Access points with the wifi-qcom-ac package need the extra steps in the section for them later in this guide; an 802.11ac access point that still runs the wireless package needs the wifi-qcom-ac package first, see Replacing the wireless package.
  • Each access point is in CAP mode with its own identity, and has an address in 192.168.99.0/24 (from the router's DHCP server or set by hand). To put an access point in CAP mode, reset it with /system/reset-configuration caps-mode=yes. In CAP mode, the access point bridges all its ports in bridgeLocal, runs a DHCP client on it, and leaves its radios to CAPsMAN. Find its address in the router's DHCP leases or in the neighbor list (/ip/neighbor).
  • The switches between the router and the access points pass VLAN 10 and VLAN 20 tagged on the ports to the router and to the access points; the management traffic of the access points and the office PCs stay untagged. See VLAN example: trunk and access ports. If the switches cannot carry VLANs, or you are not sure, process the client traffic on CAPsMAN instead, as described later in this guide.

Create the VLANs on the router​

Create the staff and guest VLANs on the LAN bridge, with addresses and DHCP servers. The router is the DNS server of both VLANs:

/interface/vlan
add name=vlan10-staff vlan-id=10 interface=bridge
add name=vlan20-guest vlan-id=20 interface=bridge
/ip/address
add address=192.168.10.1/24 interface=vlan10-staff
add address=192.168.20.1/24 interface=vlan20-guest
/ip/pool
add name=pool-staff ranges=192.168.10.100-192.168.10.250
add name=pool-guest ranges=192.168.20.100-192.168.20.250
/ip/dhcp-server
add name=dhcp-staff interface=vlan10-staff address-pool=pool-staff
add name=dhcp-guest interface=vlan20-guest address-pool=pool-guest
/ip/dhcp-server/network
add address=192.168.10.0/24 gateway=192.168.10.1 dns-server=192.168.10.1
add address=192.168.20.0/24 gateway=192.168.20.1 dns-server=192.168.20.1
/ip/dns
set allow-remote-requests=yes

With VLAN filtering off in the LAN bridge (the default), the router takes VLAN 10 and VLAN 20 frames from every LAN port: a device on any LAN port that tags its traffic with VLAN 10 gets a staff address. Turn on VLAN filtering, and let the two VLANs through only on the bridge itself and on every port that leads to an access point or to a switch with access points, here ether2. Untagged LAN traffic is not affected. Turn on Safe Mode first, so that a mistake that cuts your connection is undone:

/interface/bridge/vlan
add bridge=bridge tagged=bridge,ether2 vlan-ids=10,20
/interface/bridge
set bridge vlan-filtering=yes

The ports of the access points themselves pass tagged frames too: in CAP mode, all ports of an access point are in its bridge without VLAN filtering. Use the other ports of an access point only for devices you trust, or turn on VLAN filtering on the access point as in the section for wifi-qcom-ac access points.

Let the VLANs through the default firewall​

The default firewall drops traffic to the router from interfaces that are not in the LAN list. The new VLAN interfaces are not in it: the DHCP servers still give out addresses, but DNS queries from the VLANs to the router are dropped.

Add the staff VLAN to the LAN list, so staff devices reach the router like devices in the office LAN. Let guests use the router's DNS server (UDP and TCP port 53), and drop traffic from guests to the LAN list, which now holds the office LAN bridge (with all its devices, such as a file server) and the staff VLAN:

/interface/list/member
add list=LAN interface=vlan10-staff
/ip/firewall/filter
add chain=input action=accept in-interface=vlan20-guest \
protocol=udp dst-port=53 comment="guests: DNS" \
place-before=[find comment="defconf: drop all not coming from LAN"]
add chain=input action=accept in-interface=vlan20-guest \
protocol=tcp dst-port=53 comment="guests: DNS over TCP" \
place-before=[find comment="defconf: drop all not coming from LAN"]
add chain=forward action=drop in-interface=vlan20-guest \
out-interface-list=LAN comment="guests: no access to the LAN"

The forward rule can go at the end of the forward chain: none of the default rules before it accepts new connections from the guest VLAN. Connections from the LAN and staff VLAN to guests still work.

Create the Wi-Fi profiles​

On the router, create a channel profile for each band, a security profile for each SSID, a datapath for each VLAN, and the configuration profiles that combine them:

/interface/wifi/channel
add name=ch-5ghz band=5ghz-ax width=20/40/80mhz \
skip-dfs-channels=10min-cac
add name=ch-2ghz band=2ghz-ax width=20mhz frequency=2412,2437,2462
/interface/wifi/security
add name=sec-staff authentication-types=wpa2-psk,wpa3-psk \
passphrase="change-this-staff-passphrase" ft=yes ft-over-ds=yes
add name=sec-guest authentication-types=wpa2-psk,wpa3-psk \
passphrase="change-this-guest-passphrase"
/interface/wifi/datapath
add name=dp-staff vlan-id=10
add name=dp-guest vlan-id=20 client-isolation=yes
/interface/wifi/configuration
add name=cfg-staff-5g ssid=Office country=Latvia channel=ch-5ghz \
security=sec-staff datapath=dp-staff
add name=cfg-staff-2g ssid=Office country=Latvia channel=ch-2ghz \
security=sec-staff datapath=dp-staff
add name=cfg-guest ssid=Office-Guest security=sec-guest \
datapath=dp-guest

Set country to the country where the access points are. In this example:

  • Channels: 5 GHz radios choose a channel and a width of up to 80 MHz themselves. skip-dfs-channels=10min-cac keeps them off the channels that need a 10-minute radar check before use. 2.4 GHz radios choose from channels 1, 6 and 11, which do not overlap.
  • Roaming: ft=yes turns on fast roaming (802.11r) between the access points for staff devices.
  • VLANs: the datapaths put each SSID in its VLAN. client-isolation=yes keeps guests on the same access point apart; guests on different access points are in the same VLAN and can still reach each other.
  • Guest SSID: cfg-guest has no channel or country of its own. It runs as a second SSID on the radios of the staff configuration.

A later change to these profiles reaches all access points at once. Their clients reconnect, and radios on a DFS channel stay off for the new radar check, about a minute. Make changes outside office hours; with skip-dfs-channels=all, the radios do not use DFS channels at all.

Provision the access points​

Provisioning rules decide which configuration each radio of an access point gets. Add one rule for each band, with the staff configuration as the master and the guest configuration as the slave, and turn on CAPsMAN on the LAN bridge:

/interface/wifi/provisioning
add action=create-dynamic-enabled supported-bands=5ghz-ax \
master-configuration=cfg-staff-5g slave-configurations=cfg-guest \
name-format=%I-5g
add action=create-dynamic-enabled supported-bands=2ghz-ax \
master-configuration=cfg-staff-2g slave-configurations=cfg-guest \
name-format=%I-2g
/interface/wifi/capsman
set enabled=yes interfaces=bridge

name-format=%I-5g names each interface after the identity of its access point, for example ap-meeting-5g. The guest interface on the same radio gets the same name with 2 added.

Connect the access points​

On each access point, set its identity and connect it to the router's address:

/system/identity
set name=ap-meeting
/interface/wifi/cap
set caps-man-addresses=192.168.99.1 discovery-interfaces=""

CAP mode looks for CAPsMAN on its LAN bridge (discovery-interfaces=bridgeLocal), and connects to any CAPsMAN it finds there, also to one on another router in the same LAN. With caps-man-addresses and no discovery interfaces, the access point connects to the office router. When it cannot reach the router, it can also try another CAPsMAN in its neighbor list; the certificates in the last section of this guide prevent that. CAP mode already puts the guest interfaces in bridgeLocal with the datapath capdp (slaves-datapath=capdp).

Check the access points and the clients​

On the router, the access point is connected, and its radios have the staff and guest interfaces:

/interface/wifi/capsman/remote-cap/print \
proplist=address,identity,state,board-name
/interface/wifi/print
Columns: ADDRESS, IDENTITY, STATE, BOARD-NAME
# ADDRESS IDENTITY STATE BOARD-NAME
0 192.168.99.7 ap-meeting Ok cAPGi-5HaxD2HaxD

Flags: M - MASTER; D - DYNAMIC; B - BOUND; I - INACTIVE
Columns: NAME, MASTER-INTERFACE, CONFIGURATION.SSID, CHANNEL.FREQUENCY,
CHANNEL.WIDTH
# NAME MASTER-INTERFACE CONFIGURATIO CHAN CHANNEL.WIDTH
;;; operated by CAP 192.168.99.7, traffic processing on CAP
0 MDB ap-meeting-2g Office 2412 20mhz
2437
2462
;;; operated by CAP 192.168.99.7
1 DBI ap-meeting-2g2 ap-meeting-2g Office-Guest
;;; operated by CAP 192.168.99.7, traffic processing on CAP
2 MDBI ap-meeting-5g Office 20/40/80mhz
;;; operated by CAP 192.168.99.7
3 DBI ap-meeting-5g2 ap-meeting-5g Office-Guest

CHANNEL.FREQUENCY shows the frequencies a radio may use; on the access point, the comment of each interface in /interface/wifi/print shows the channel in use. I (inactive) marks interfaces that do not run yet, for example the interfaces of a 5 GHz radio during the radar check of a DFS channel; they do not accept clients until then.

When clients connect, the registration table shows which access point, radio and SSID each client uses, and the DHCP leases show the VLAN:

/interface/wifi/registration-table/print
/ip/dhcp-server/lease/print
Flags: A - AUTHORIZED
Columns: INTERFACE, SSID, MAC-ADDRESS, DHCP-ADDRESS
# INTERFACE SSID MAC-ADDRESS DHCP-ADDRESS
0 A ap-meeting-2g2 Office-Guest 02:00:00:00:20:01 192.168.20.248
1 A ap-meeting-5g Office 02:00:00:00:30:01 192.168.10.250

Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN
# ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS LAS
0 D 192.168.20.248 02:00:00:00:20:01 guest-phone dhcp-guest bound 11s
1 D 192.168.10.250 02:00:00:00:30:01 mario-laptop dhcp-staff bound 11s

To check the firewall, let a guest device try to reach a device in the office LAN, for example the access point at 192.168.99.7. The attempt fails, and the guest rule counts the dropped packets:

/ip/firewall/filter/print stats where comment~"guests"
Columns: CHAIN, ACTION, BYTES, PACKETS
# CHAIN ACTION BYTES PACKETS
;;; guests: DNS
5 input accept 0 0
;;; guests: DNS over TCP
6 input accept 0 0
;;; guests: no access to the LAN
8 forward drop 112 2

Give one access point its own settings​

A rule with radio-mac matches one radio. Put it before the band rules (place-before=0 puts it before rule 0, the first one), because CAPsMAN uses the first rule that matches. Find the radio's MAC address in the radio list:

/interface/wifi/radio/print
Columns: CAP, RADIO-MAC, INTERFACE
# CAP RADIO-MAC INTERFACE
0 ap-meeting@192.168.99.7 48:A9:8A:E0:2C:00 ap-meeting-5g
1 ap-meeting@192.168.99.7 48:A9:8A:E0:2C:01 ap-meeting-2g

The following block keeps the 2.4 GHz radio of ap-meeting on channel 11, for example to keep it away from a neighbor's network. A new rule does not change radios that are already provisioned, so the last command provisions the access point again:

/interface/wifi/channel
add name=ch-2ghz-meeting band=2ghz-ax width=20mhz frequency=2462
/interface/wifi/configuration
add name=cfg-staff-2g-meeting ssid=Office country=Latvia \
channel=ch-2ghz-meeting security=sec-staff datapath=dp-staff
/interface/wifi/provisioning
add action=create-dynamic-enabled radio-mac=48:A9:8A:E0:2C:01 \
master-configuration=cfg-staff-2g-meeting \
slave-configurations=cfg-guest name-format=%I-2g place-before=0
/interface/wifi/capsman/remote-cap
provision [find identity=ap-meeting]

Provisioning creates the interfaces of all radios of the access point again, so its clients reconnect. The radio now uses only 2462 MHz:

/interface/wifi/print where name~"ap-meeting-2g"
Flags: M - MASTER; D - DYNAMIC; B - BOUND
Columns: NAME, MASTER-INTERFACE, CONFIGURATION.SSID, CHANNEL.FREQUENCY,
CHANNEL.WIDTH
# NAME MASTER-INTERFACE CONFIGURATION.SSID CHAN CHANN
;;; operated by CAP 192.168.99.7, traffic processing on CAP
4 MDB ap-meeting-2g Office 2462 20mhz
;;; operated by CAP 192.168.99.7, traffic processing on CAP
5 DB ap-meeting-2g2 ap-meeting-2g Office-Guest

A change to a profile, on the other hand, reaches all access points that use it without provisioning.

Add access points with the wifi-qcom-ac package​

Access points with the wifi-qcom-ac package (802.11ac access points, such as the hAP ac³) need their own profiles:

  • Their radios support the 5ghz-ac and 2ghz-n bands, so a channel profile with 5ghz-ax gives them no channels.
  • They cannot take a VLAN from CAPsMAN: with vlan-id in the datapath, the interface shows vlan-id configured, but interface does not support assigning vlans. The access point puts its interfaces in the VLANs on its own bridge instead.

On the router, add profiles without VLANs and rules for these bands. Add the rules after the ax rules: an ax radio also supports the ac and n bands, and the first matching rule wins:

/interface/wifi/channel
add name=ch-5ghz-ac band=5ghz-ac width=20/40/80mhz \
skip-dfs-channels=10min-cac
add name=ch-2ghz-n band=2ghz-n width=20mhz frequency=2412,2437,2462
/interface/wifi/datapath
add name=dp-guest-ac client-isolation=yes
/interface/wifi/configuration
add name=cfg-staff-5g-ac ssid=Office country=Latvia \
channel=ch-5ghz-ac security=sec-staff
add name=cfg-staff-2g-ac ssid=Office country=Latvia \
channel=ch-2ghz-n security=sec-staff
add name=cfg-guest-ac ssid=Office-Guest security=sec-guest \
datapath=dp-guest-ac
/interface/wifi/provisioning
add action=create-dynamic-enabled supported-bands=5ghz-ac \
master-configuration=cfg-staff-5g-ac \
slave-configurations=cfg-guest-ac name-format=%I-5g
add action=create-dynamic-enabled supported-bands=2ghz-n \
master-configuration=cfg-staff-2g-ac \
slave-configurations=cfg-guest-ac name-format=%I-2g

On the access point, connect it to the router without the CAP-mode datapath (!datapath and !slaves-datapath remove the setting), and let CAPsMAN create static guest interfaces, which can be bridge ports with a VLAN (pvid):

/system/identity
set name=ap-reception
/interface/wifi
set [find default-name=wifi1] configuration.manager=capsman !datapath
set [find default-name=wifi2] configuration.manager=capsman !datapath
/interface/wifi/cap
set enabled=yes caps-man-addresses=192.168.99.1 \
discovery-interfaces="" slaves-static=yes !slaves-datapath

When the access point is provisioned, look up the names of the guest interfaces on it:

/interface/wifi/print
Flags: M - MASTER; B - BOUND; R - RUNNING
Columns: NAME, MASTER-INTERFACE
# NAME MASTER-INTERFACE
;;; managed by CAPsMAN 192.168.99.1, traffic processing on CAP
;;; mode: AP, SSID: Office, channel: 2437/n
0 MBR wifi1
;;; managed by CAPsMAN 192.168.99.1, traffic processing on CAP
;;; mode: AP, SSID: Office, channel: 5540/ac/eeCe/D
1 MBR wifi2
;;; managed by CAPsMAN 192.168.99.1, traffic processing on CAP
;;; mode: AP, SSID: Office-Guest
2 BR wifi9 wifi1
;;; managed by CAPsMAN 192.168.99.1, traffic processing on CAP
;;; mode: AP, SSID: Office-Guest
3 BR wifi10 wifi2

The guest interfaces are wifi9 and wifi10 here; the numbers can differ on your access point. CAP mode adds each Ethernet port as its own bridge port; add the Wi-Fi interfaces as separate ports too, because an entry with interface=all cannot give them their own PVID. ether1 is the port to the switch; use Safe Mode on the access point too. Put the staff interfaces in VLAN 10 and the guest interfaces in VLAN 20, send both VLANs tagged on ether1, and turn on VLAN filtering last. The management address stays untagged:

/interface/bridge/port
add bridge=bridgeLocal interface=wifi1 pvid=10
add bridge=bridgeLocal interface=wifi2 pvid=10
add bridge=bridgeLocal interface=wifi9 pvid=20
add bridge=bridgeLocal interface=wifi10 pvid=20
/interface/bridge/vlan
add bridge=bridgeLocal tagged=ether1 untagged=wifi1,wifi2 vlan-ids=10
add bridge=bridgeLocal tagged=ether1 untagged=wifi9,wifi10 vlan-ids=20
/interface/bridge
set bridgeLocal vlan-filtering=yes

On the router, the clients of this access point get addresses in the same VLANs:

/interface/wifi/registration-table/print
/ip/dhcp-server/lease/print
Flags: A - AUTHORIZED
Columns: INTERFACE, SSID, MAC-ADDRESS, DHCP-ADDRESS
# INTERFACE SSID MAC-ADDRESS DHCP-ADDRESS
0 A ap-reception-2g2 Office-Guest 02:00:00:00:20:01 192.168.20.248
1 A ap-reception-5g Office 02:00:00:00:30:01 192.168.10.250

Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN
# ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS LAS
0 D 192.168.10.250 02:00:00:00:30:01 mario-laptop dhcp-staff bound 11s
1 D 192.168.20.248 02:00:00:00:20:01 guest-phone dhcp-guest bound 11s

Process the client traffic on CAPsMAN​

If the switches between the router and the access points cannot carry VLANs, let the access points send the client traffic to the router. The router then puts it in the VLANs on its own bridge, and the switches see only the traffic between the access points and the router:

/interface/wifi/datapath
set dp-staff traffic-processing=on-capsman-secure bridge=bridge
set dp-guest traffic-processing=on-capsman-secure bridge=bridge

on-capsman-secure encrypts the client traffic between the access point and the router; on-capsman sends it unencrypted. The router then carries the client traffic of all access points, which adds to its load. The access points reconnect their clients after the change. Their interfaces are now dynamic ports of the router's bridge, and the clients get the same addresses as before:

/interface/wifi/print where name~"meeting"
/interface/bridge/port/print where dynamic
/ip/dhcp-server/lease/print
Flags: M - MASTER; D - DYNAMIC; B - BOUND; R - RUNNING
Columns: NAME, MASTER-INTERFACE, CONFIGURATION.SSID, CHANNEL.FREQUENCY,
CHANNEL.WIDTH
# NAME MASTER-INTERFACE CONFIGURATIO CHAN CHANNEL.WIDTH
;;; operated by CAP 192.168.99.7, traffic processing on CAPsMAN
6 MDB ap-meeting-2g Office 2462 20mhz
;;; operated by CAP 192.168.99.7, traffic processing on CAPsMAN
7 DBR ap-meeting-2g2 ap-meeting-2g Office-Guest
;;; operated by CAP 192.168.99.7, traffic processing on CAPsMAN
8 MDBR ap-meeting-5g Office 20/40/80mhz
;;; operated by CAP 192.168.99.7, traffic processing on CAPsMAN
9 DB ap-meeting-5g2 ap-meeting-5g Office-Guest

Flags: I - INACTIVE; D - DYNAMIC
Columns: INTERFACE, BRIDGE, HORIZON, TRUSTED, TRUSTED-RA, TRUSTED-DHCPV6,
TRUSTED-ARP, TRUSTED-IPSG, FAST-LEAVE, BPDU-GUARD, EDGE,
POINT-TO-POINT
# INTERFACE BRIDGE HORI TR TR TR TR TR FA BP EDGE PO
0 D ap-meeting-5g bridge none no no no no no no no auto no
1 ID ap-meeting-2g bridge none no no no no no no no auto no
2 D ap-meeting-2g2 bridge none no no no no no no no auto no
3 ID ap-meeting-5g2 bridge none no no no no no no no auto no

Flags: D - DYNAMIC
Columns: ADDRESS, MAC-ADDRESS, HOST-NAME, SERVER, STATUS, LAST-SEEN
# ADDRESS MAC-ADDRESS HOST-NAME SERVER STATUS LAS
0 D 192.168.20.248 02:00:00:00:20:01 guest-phone dhcp-guest bound 12s
1 D 192.168.10.250 02:00:00:00:30:01 mario-laptop dhcp-staff bound 11s

The router's VLAN settings stay as they are.

Access points with the wifi-qcom-ac package cannot send client traffic to CAPsMAN: their interface shows data channel not supported. Keep their profiles without traffic-processing, as in the previous section; their VLANs then need switches that carry them.

Secure the connections of the access points​

By default, CAPsMAN accepts any access point that connects. With certificates, CAPsMAN accepts only access points with a certificate from its own certificate authority, and each access point connects only to the router it connected to first.

On the router, let CAPsMAN create its certificate authority and its own certificate:

/interface/wifi/capsman
set ca-certificate=auto certificate=auto

On each access point, request a certificate and lock the access point to this CAPsMAN:

/interface/wifi/cap
set certificate=request lock-to-caps-man=yes

Check on the router that every access point has a certificate:

/certificate/print
/interface/wifi/capsman/remote-cap/print \
proplist=address,identity,state,common-name
Flags: K - PRIVATE-KEY; A - AUTHORITY; I - ISSUED; T - TRUSTED
Columns: NAME, TRUST-STORE, COMMON-NAME
# NAME TRUST-S COMMON-NAME
0 KA T WiFi-CAPsMAN-CA-48A98AA4345A capsman WiFi-CAPsMAN-CA-48A98AA4345A
1 K I WiFi-CAPsMAN-48A98AA4345A capsman WiFi-CAPsMAN-48A98AA4345A
2 I CAP-48A98AE02BFE capsman CAP-48A98AE02BFE
3 I CAP-488F5AA465EF capsman CAP-488F5AA465EF

Columns: ADDRESS, IDENTITY, STATE, COMMON-NAME
# ADDRESS IDENTITY STATE COMMON-NAME
0 192.168.99.7 ap-meeting Ok CAP-48A98AE02BFE
1 192.168.99.8 ap-reception Ok CAP-488F5AA465EF

When every access point has a certificate, check that /interface/wifi/capsman/remote-cap/print lists only your access points, then require certificates:

/interface/wifi/capsman
set require-peer-certificate=yes

All access points reconnect, so their clients reconnect too; do it outside office hours. Turn this on only after the last access point has its certificate: while it is on, an access point without a certificate cannot get one, and the router logs ssl: empty certificate chain received for it. To add an access point later, turn require-peer-certificate off until the new access point has its certificate.

If the router loses the certificate authority of CAPsMAN, for example after a reset, CAPsMAN creates a new one and refuses the access points with ssl: unknown CA certificate. Keep a backup of the router's configuration with its certificates. To connect an access point again, turn require-peer-certificate off, and on the access point remove its certificates and request a new one:

/certificate
remove [find]
/interface/wifi/cap
set certificate=request

The same steps connect an access point that lost its certificate, for example after a reset. If the router still has a certificate with the access point's name, it does not issue a new one and logs certificate issue failed - a valid certificate with the same common name already exists; remove that certificate on the router, here for CAP-488F5AA465EF:

/certificate/remove [find common-name=CAP-488F5AA465EF]