Let only trusted devices onto your Wi-Fi. Each device signs in with its own certificate (802.1X, EAP-TLS), and Korthveil itself is the RADIUS server that checks it.

You need:

You don't need: a separate RADIUS server, a domain, or any software on the devices. Windows, macOS, iOS, Android and Linux all have the 802.1X client built in.

How it works

 laptop / phone                     Korthveil firewall
 ┌──────────────┐  802.1X (EAP-TLS)  ┌──────────────────────────────┐
 │ device cert  │ ─────────────────▶ │ Wi-Fi access point           │
 │ (laptop-1)   │                    │        │ RADIUS              │
 │ trusts       │                    │        ▼                     │
 │ nac-ca       │ ◀── server cert ── │ NAC add-in (RADIUS server)   │
 └──────────────┘    (nac-radius)    │  admits devices whose        │
                                     │  certificate nac-ca signed   │
                                     │  and is still in the store   │
                                     └──────────────────────────────┘

Three certificates do the work, all made on the firewall:

A device gets on only with a certificate from nac-ca that is still in the firewall's certificate store (System › Certificates). The store is the list of allowed devices: delete a device's certificate there and it is locked out at once and disconnected from the firewall's Wi-Fi. A certificate copied from elsewhere, or one you deleted, never gets on. There's no shared Wi-Fi password to leak.

How a device is checked, step by step:

  1. The device joins korthveil and starts 802.1X. The access point passes the exchange to the NAC add-in (RADIUS).
  2. The device checks the firewall: the server certificate nac-radius must be signed by nac-ca, which the device trusts (Step 9).
  3. The firewall checks the device: - its certificate is signed by nac-ca; - it is within its validity dates; - it proves it holds the private key; - its serial number belongs to a certificate still in the store.
  4. All checks pass: the device is admitted and the session is logged with the certificate's name. Any check fails: rejected, and the log says why (for example not in the store).

Quicker: System › Wizards › Enterprise Wi-Fi with NAC does steps 1 to 8 for the firewall's own Wi-Fi: it creates the CA, the RADIUS server certificate, and the first devices' certificates, makes the access point a RADIUS client with a random shared secret, and switches the Wi-Fi to Enterprise. Then continue with step 9. The steps below do the same by hand and explain each part.

Step 1: Turn on the NAC add-in

Go to System › Add-ins, find Network access control, and switch it On. Then open its page with Settings, or through Identity › Network access control.

The NAC add-in switched on in System › Add-ins
The NAC add-in switched on in System › Add-ins

Step 2: Create your certificate authority

Go to System › Certificates, and under Add a certificate choose Create a local CA:

Click Create. The CA's private key is made on the firewall and never leaves it.

Create a local CA
Create a local CA

Step 3: Issue the RADIUS server certificate

Still under Add a certificate, choose Issue from a local CA:

Keep Renew automatically on. Click Create.

Issue the RADIUS server certificate
Issue the RADIUS server certificate

Step 4: Issue a certificate for each device

Again Issue from a local CA, once per laptop or phone:

Click Create.

Issue a device certificate (use: Client)
Issue a device certificate (use: Client)

The Store now lists the three certificates. Device certificates have a .p12 button.

The store with the CA, the server certificate, and a device certificate
The store with the CA, the server certificate, and a device certificate

Step 5: Download the device certificate

Click .p12 on the device's row:

Also download the CA certificate (the download icon on the nac-ca row, nac-ca.pem). Devices use it to check that they are talking to your server.

The .p12 file downloaded and its one-time password
The .p12 file downloaded and its one-time password

Only device (Client) certificates can be downloaded with their key. Server certificates, CAs, and the web console's certificate cannot.

Step 6: Add the access point as a RADIUS client

Open the Network access control page. Under RADIUS clients:

RADIUS clients
RADIUS clients

Step 7: Choose EAP-TLS and the certificates

Under Authentication methods:

Click Save to pending changes.

EAP-TLS with the certificates from the store
EAP-TLS with the certificates from the store

These certificates now show "the nac add-in" under Used by, and can't be deleted while NAC uses them.

Step 8: Switch the Wi-Fi to Enterprise

Go to Network › Interfaces, zones & routes, and edit the Wi-Fi interface with the pencil (or use Add Wi-Fi access point):

The interface also needs:

The Wi-Fi interface with WPA2/WPA3-Enterprise and the RADIUS server
The Wi-Fi interface with WPA2/WPA3-Enterprise and the RADIUS server

Save, then Commit the pending changes (the bar at the top).

Step 9: Set up a device

On each device, install the two files, then join the Wi-Fi.

Device Install nac-ca.pem Install laptop-1.p12 Join
Windows 11 Double-click › Install › Local machine › Trusted Root Certification Authorities Double-click › Current user › enter the password Wi-Fi name › sign in with a certificate
macOS Double-click › Keychain › Always trust Double-click › enter the password Wi-Fi name › choose the certificate
iPhone / iPad AirDrop or mail the file › Settings › Profile Downloaded › Install; then Settings › General › About › Certificate Trust Settings › enable Same way, enter the password Wi-Fi name › Mode EAP-TLS › Identity: the certificate
Android Settings › Security › Encryption & credentials › Install a certificate › CA certificate Same place › Wi-Fi certificate › enter the password Wi-Fi name › EAP method TLS › CA certificate nac-ca › Domain radius.korthveil.lan › User certificate laptop-1 › Identity laptop-1
Linux — — NetworkManager › WPA & WPA2 Enterprise › TLS › Identity laptop-1 › CA certificate nac-ca.pem › User certificate and key laptop-1.p12 › password

Always choose the CA certificate, never "Do not validate". Otherwise the device would trust any access point with the same name. Delete the .p12 file once it is installed.

Step 10: Check it works

On the NAC page, Recent authentications lists every sign-in:

Accepted and rejected sign-ins
Accepted and rejected sign-ins

Using your directory: Active Directory, Samba AD, FreeIPA, or LDAP

NAC can check users and computers against your directory instead of local users only.

Know this before you deploy

Steps

  1. Open System › Directories. Press Find directories: enter your domain, or a subnet to scan. Press Use on your domain controller or directory server.
  2. Fill in Service account (bind DN) and Service account password. Use a read-only account. If TLS shows "CA to import", import that CA and choose it under Server CA.
  3. Under Test, enter a real user name and password, and a computer name. Press Test: every step should show OK. Note the group names it lists.
  4. Press Save to pending changes and commit.
  5. Open Identity › NAC. Under Users and directory, choose the directory under Directory.
  6. For laptops with domain certificates (AD Certificate Services, FreeIPA certmonger), tick EAP-TLS devices need an enabled computer account. A device whose computer account is disabled is then refused at its next sign-in.
  7. Under VLAN assignment › By group, add the groups with the exact names from step 3.
  8. Tick EAP-TTLS under Authentication methods if users sign in with directory passwords. Save and commit.

Managing devices: Identity › NAC devices

Identity › NAC devices is the list of machines allowed on the network and the Wi-Fi. Each device signs in with its certificate (Wi-Fi korthveil, 802.1X switch ports), with its MAC address (printers and TVs on switch ports, with MAC Authentication Bypass on), or both.

NAC devices: status, rules, and the Allow/Block switch
NAC devices: status, rules, and the Allow/Block switch
Column Meaning
Status Online (signed in now), Allowed, Blocked, Expired, or Outside its hours
Last seen The last accepted sign-in, and the MAC address it came from
Rules until a date, and the allowed days and hours
Allowed The switch: off blocks the device, on lets it back. Expiry and hours apply on top: a device whose switch is on can still show Expired or Outside its hours

Add a device: click Add device:

Field Set to
Name The device, for example Alex phone (letters, digits, spaces, . _ -)
Owner (optional) The person, for example alex
Signs in with A new certificate: Korthveil issues it from the NAC CA (nac-ca) at once. Or A certificate already in the store, or Its MAC address only
MAC address (optional) Also blocks the device by its MAC address, whatever certificate it shows
Allowed until (optional) The last day the device may join; the whole day is included
Only at certain times Days and hours, for example Monday to Friday 07:00–21:00. To before From spans midnight
Add a device with a new certificate and allowed hours
Add a device with a new certificate and allowed hours

Click Add device. With a new certificate, click .p12 in its row to download it, and set up the device as in Step 9.

When changes take effect:

Seen on the network, not on the list shows recent sign-ins of devices you haven't listed; Add puts one on the list.

To Do
Block a lost phone now Turn its Allowed switch off. Later, to re-use the phone, turn it on; to replace it, remove the device and delete its certificate in System › Certificates
Give a guest a week Add device with Allowed until a week from today
Limit a child's tablet to the daytime Only at certain times, for example 07:00–21:00 every day
Kick a device off once Disconnect in its row (it may sign in again unless blocked)
Remove a device for good Remove it from the list (the bin in its row), then delete its certificate in System › Certificates: it is locked out at once. While a device on the list uses a certificate, the store refuses to delete it
See who is on NAC devices (status Online), or the NAC page › Active sessions
Tie a laptop to its user NAC page › Device owners: certificate name → user

Troubleshooting

Symptom Check
The Wi-Fi isn't visible Network page › Wi-Fi status: the access point should be ENABLED. Choose a fixed channel if Automatic doesn't start.
Every device is rejected The RADIUS client's address and secret match the Wi-Fi's (Steps 6 and 8); NAC's client CA is nac-ca
The device says the server can't be verified nac-ca.pem is installed and chosen; the domain is the server certificate's DNS name
One device is rejected Its certificate was issued by nac-ca and is still in System › Certificates (the log says not in the store otherwise); its clock is right
"certificate … is not chosen in the enabled nac add-in's settings" Choose the certificates in Step 7 and commit
A directory user gets the default VLAN, not their group's The group name in VLAN assignment differs in upper/lower case from the directory's: copy it from System › Directories › Test
Windows users with a directory password are rejected Windows tries PEAP-MSCHAPv2, which needs a domain join (not built yet): set the Wi-Fi profile to EAP-TTLS with PAP, or use certificates
A domain laptop is rejected with "no enabled computer account" Its certificate's common name must be the computer's DNS name (or host/name), and the computer account must be enabled

More: