# Set up UniFi switches for Trustaige RADIUS

> Point UniFi switches at Trustaige RADIUS with a RADIUS profile and MAC-based 802.1X control on access ports, and check what the switch sends.

Source: https://docs.trustaige.com/manage/switch-unifi

Replace these placeholders with your organization's own values:

- `<your-radius-server>`: Trustaige RADIUS server, for example `203.0.113.10`. The Server, or Primary server, the hub shows when you register your RADIUS server at a site.
- `<your-restricted-vlan>`: Restricted VLAN, for example `30`. The Restricted VLAN for headless devices on the wired network’s settings in the hub.
- `<your-radius-secret>`: RADIUS shared secret, a secret. The hub shows it once, when you register your RADIUS server at a site.

UniFi Network sends a switch port's 802.1X to an external RADIUS server
through a RADIUS profile. A port set to **MAC-Based** decides each device on
it separately and admits a device that sends no EAPOL by its MAC. Ubiquiti
doesn't document how a UniFi switch formats that MAC request, so this guide
ends with what to check before you rely on it.

Read [Run a wired office on Trustaige RADIUS](/manage/wired-8021x) first for
the hub's side. Register each switch with the make **UniFi**, at the address
its RADIUS requests come from.

## Before you start

| You need | Why |
|---|---|
| UniFi switches adopted in UniFi Network | The settings below are UniFi Network's. Menu names differ slightly between Network 9 and 10. |
| The VLANs Trustaige will name, as networks in UniFi Network | `<your-restricted-vlan>`, and the wired network's **VLAN** if you set one. |

## In UniFi Network

1. **Add a RADIUS profile.** Open **Settings › Profiles › RADIUS** (in
   Network 10, the profiles are under **Networks**) and create a profile
   named `Trustaige`:
   - Under **RADIUS Assigned VLAN Support**, enable it for **Wired
     Networks**.
   - **Authentication Servers:** **IP Address** `<your-radius-server>`, the
     hub's **Port**, and the shared secret (`<your-radius-secret>`). Add the
     secondary server if the hub showed one.
   - **Accounting Servers:** enabled, with the port after the hub's **Port**.

2. **Turn on 802.1X for switches.** In the switches' global settings, turn on
   **802.1X Control**, choose the external RADIUS server and the `Trustaige`
   profile. Leave **Fallback VLAN** empty: it would place a device Trustaige
   refused on a network anyway.

3. **Set the access ports.** In each switch's **Port Manager**, or a port
   profile, set **802.1X Control** to **MAC-Based**. **Auto** asks for 802.1X
   only, so it leaves printers and phones without a network.

UniFi applies the VLAN Trustaige names (`Tunnel-Type` 13,
`Tunnel-Medium-Type` 6, `Tunnel-Private-Group-ID`) when **RADIUS Assigned
VLAN Support** is on for wired networks.

## Check what the switch sends

Before registering printers and phones, plug one into a **MAC-Based** port
and watch **Live test** in the hub:

- **The MAC appears** under **Seen but not registered** on **Headless
  devices**: the switch's MAC requests reach Trustaige in a form it accepts.
- **The activity says “The access point does not sign its requests”**: the
  switch sends MAC requests without Message-Authenticator, and Trustaige can't
  admit devices by MAC through it.
- **The activity says “The device asked for a sign-in method other than a
  certificate”**: the switch sends a password that isn't the MAC, or EAP-MD5.

Then plug in a managed PC: its join appears with its certificate.

## Disconnects

Ubiquiti doesn't document change of authorization or Disconnect-Requests on
UniFi switches. Until a switch is confirmed to take them, a device that loses
its standing keeps its port until its `Session-Timeout`: four hours for a
device admitted by MAC.

## What hasn't been confirmed yet

- How a UniFi switch formats a MAC request (PAP, CHAP or EAP-MD5; the user
  name; the password) isn't documented. Trustaige accepts PAP or CHAP with the
  MAC as the password, or the MAC as the user name alone.
- Whether UniFi switches add Message-Authenticator to MAC requests isn't
  documented, and Ubiquiti has published no Blast-RADIUS notice for switches.
- Whether UniFi switches take Disconnect-Requests, and on which port, isn't
  documented. The hub uses UDP 3799 for the make **UniFi**.
- Whether UniFi switches act on `Session-Timeout` with `Termination-Action`
  `RADIUS-Request` isn't documented.
- That **MAC-Based** falls back to the MAC when a device sends no EAPOL comes
  from third-party guides, not from Ubiquiti.
- Trustaige's lab hasn't yet recorded a UniFi switch, and the menu names
  above haven't been checked against a running controller.

## Ubiquiti documentation

- [MAC-based VLAN assignment using 802.1X in UniFi Network](https://help.ui.com/hc/en-us/articles/115004589707)
- [RADIUS-assigned VLANs](https://help.ui.com/hc/en-us/articles/360015268353)
