# Set up Juniper EX switches for Trustaige RADIUS

> Configure a Juniper EX switch for 802.1X with MAC RADIUS fallback over PAP against Trustaige RADIUS, with dynamic VLANs, accounting and disconnects.

Source: https://docs.trustaige.com/manage/switch-juniper-ex

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.

Junos tries 802.1X on each port and, after three unanswered EAPOL requests,
falls back to MAC RADIUS. By default MAC RADIUS sends EAP-MD5, which Trustaige
refuses, so this guide sets it to PAP: the MAC, in lowercase without
separators, as both user name and password.

Read [Run a wired office on Trustaige RADIUS](/manage/wired-8021x) first for
the hub's side. Register the switch with the make **Other**: Trustaige then
sends Disconnect-Requests on UDP 3799, where Junos listens.

## Before you start

| You need | Why |
|---|---|
| Junos 15.1R3 or later, with the Enhanced Layer 2 Software (ELS) syntax | `mac-radius authentication-protocol` arrived in 15.1R3. |
| The VLANs Trustaige will name, on the switch | `set vlans headless vlan-id <your-restricted-vlan>`, and the wired network's **VLAN** if you set one. |

## RADIUS server and access profile

```txt title="Junos"
set access radius-server <your-radius-server> port 1812
set access radius-server <your-radius-server> secret "<your-radius-secret>"
set access radius-server <your-radius-server> message-authenticator
set access radius-server <your-radius-server> source-address 10.0.0.2
set access profile trustaige authentication-order radius
set access profile trustaige radius authentication-server <your-radius-server>
set access profile trustaige radius accounting-server <your-radius-server>
set access profile trustaige accounting order radius
set protocols dot1x authenticator authentication-profile-name trustaige
```

- Set `port` to the hub's **Port**. Add the secondary server the same way and
  list it after the first.
- **`message-authenticator`** has Junos require Message-Authenticator in
  replies, as the first attribute; Trustaige puts it first in every reply.
  Junos switches already send it in every Access-Request.
- `source-address` is the switch address Trustaige hears from: the address
  you registered.

## Access ports

```txt title="Junos"
set protocols dot1x authenticator interface ge-0/0/10 supplicant multiple
set protocols dot1x authenticator interface ge-0/0/10 mac-radius
set protocols dot1x authenticator interface ge-0/0/10 mac-radius authentication-protocol pap
```

- **`authentication-protocol pap`** replaces the default, EAP-MD5. Without
  it, every printer is refused.
- **`supplicant multiple`** decides each device on the port separately, such
  as a PC behind an IP phone.
- Don't set `protocols dot1x authenticator mac-radius password`. It replaces
  every device's MAC with one shared password, which Trustaige refuses.
- With the default timers, the switch falls back to MAC RADIUS after three
  EAPOL requests. `transmit-period` shortens the wait.

Junos applies the VLAN Trustaige names in `Tunnel-Private-Group-ID`, and the
`Session-Timeout` Trustaige sends takes the place of the port's own
`reauthentication` interval.

## Disconnects

Junos takes Disconnect-Requests on UDP 3799 from the addresses configured
under `access radius-server`, with that server's secret. If the hub lists a
disconnect address, under **Disconnects on UDP 3799**, that isn't one of your
servers, add it as an `access radius-server` with the same secret. Trustaige's
requests identify the session (`Acct-Session-Id`, `Calling-Station-Id`,
`User-Name`, `NAS-Identifier`) and carry an `Event-Timestamp`.

## Check it works

1. Plug a managed PC into the port, then a printer.
2. On the switch:

   ```txt title="Junos"
   show dot1x interface ge-0/0/10 detail
   ```

   Each device shows how it authenticated, its VLAN and the session timeout.
3. In the hub, **Recent joins** shows each decision, and the activity names
   the port.
4. Block the PC in the hub; its session ends within seconds.

## Troubleshooting

**Activity says “The device asked for a sign-in method other than a certificate.” for every printer**

MAC RADIUS is sending EAP-MD5. Set `mac-radius authentication-protocol pap` on
the port, and remove any `mac-radius password`.

**Requests reach Trustaige, but the switch ignores every reply**

With `message-authenticator` set, Junos discards a reply whose
Message-Authenticator isn't valid. Check the shared secret on both sides.

**The hub shows a Disconnect-Request as not acknowledged**

The request came from an address Junos doesn't know as a RADIUS server. Add
each address the hub lists under `access radius-server`, with the secret.

## What hasn't been confirmed yet

- The Junos release from which every Access-Request carries
  Message-Authenticator isn't stated in Juniper's public documentation.
- Whether Junos acts on `Termination-Action` `RADIUS-Request` isn't
  documented; it does take the `Session-Timeout`.
- How long the fallback takes with the default timers isn't stated as a
  figure.
- Junos refuses a Disconnect-Request that carries more than session
  identification. Whether it counts `Event-Timestamp`, which RFC 5176 allows,
  as such hasn't been recorded in Trustaige's lab.

## Juniper documentation

- [802.1X authentication on switches](https://networkingdocs.hpe.com/documentation/us/en/software/junos/user-access/topics/topic-map/802-1x-authentication-switching-devices.html)
- [MAC RADIUS authentication](https://networkingdocs.hpe.com/documentation/us/en/software/junos/user-access/topics/topic-map/mac-radius-authentication-switching-devices.html)
- [`authentication-protocol` (MAC RADIUS)](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/authentication-protocol-edit-mac-radius.html)
- [`password` (MAC RADIUS)](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/password-mac-radius-authentication.html)
- [`radius-server`: `message-authenticator`](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/radius-server-edit-access-subscriber-management.html)
- [Blast-RADIUS on Juniper switches](https://mist.com/documentation/radius-protocol-vulnerability-blast-radius)
