Your values Fill in your own to see them in every example
The Gateway identity on the VPN network’s page in the hub, or its Gateway when no identity is set.
That doesn’t look right yet. For example: vpn.example.com
One of the Office networks on the VPN network’s page in the hub.
That doesn’t look right yet. For example: 10.20.0.0/16
The Server, or Primary server, the hub shows when you register your RADIUS server at a site.
That doesn’t look right yet. For example: 203.0.113.10
RADIUS shared secret stays a marked placeholder here, never filled in: the hub gives you secrets, and only your server should hold them.
Saved in this browser only, for every page of these docs. Nothing you type leaves this page.
RouterOS’s IPsec identities can pass a connection’s EAP conversation through
to a RADIUS server (auth-method=eap-radius, RFC 3579). With Trustaige RADIUS
as that server, managed devices connect with their Trustaige certificate, and
Trustaige decides every connection by the device, its owner, its posture and
your policies. RouterOS also takes Disconnect-Requests from RADIUS, so a device
that loses its standing can be taken off the VPN in seconds.
Read Connect managed devices to your VPN gateway first for the hub’s side: the VPN network, the one proposal and the gateway’s certificate.
Before you start
| You need | Why |
|---|---|
| RouterOS 7 | The commands below are RouterOS 7’s. |
| A certificate for the router, with its private key | Devices check it before they sign in (see the gateway’s certificate). RouterOS also requires a Subject Key Identifier in it. |
| A VPN network in the hub, served at a site, with the router registered there | The hub gives you the RADIUS servers, the port and the shared secret. |
| UDP 500 and 4500 open to the router; UDP 1812 and 1813 out to Trustaige | IKE and NAT traversal in; RADIUS and accounting out. |
In Trustaige
-
Add the VPN network with Server set to Trustaige RADIUS, and serve it at the site, as the overview describes.
-
On the site’s page, under Access points, choose Add access point, then A VPN gateway and MikroTik. Enter the Public address the router’s RADIUS requests come from.
-
Turn on Takes disconnects. The router takes Disconnect-Requests once incoming RADIUS is on, below.
-
Choose Register gateway, and copy the Server (or Primary server and Secondary server), the Port and the shared secret.
On the router
-
Import the router’s certificate with its key. Upload the PKCS #12 file under Files, then:
/certificate import file-name=vpn-gateway.p12 passphrase="…" name=trustaige-vpn-gatewayImport any intermediate that issued it the same way, so the router sends it with its own.
-
Add Trustaige RADIUS for IPsec, with accounting:
/radius add service=ipsec address=<your-radius-server> secret="<your-radius-secret>" \ authentication-port=1812 accounting-port=1813 comment=trustaige /ip ipsec settings set interim-update=5m- Set
authentication-portto the hub’s Port, andaccounting-portto the port after it. If the hub showed a secondary server, add a second entry with that address. - RouterOS sends accounting for IPsec by default, and returns Trustaige’s
Classin it unchanged. Trustaige shows each session under Connected now, and can disconnect only a session it saw in accounting.interim-updatekeeps the session’s figures current. require-message-authstays at its default, which Trustaige meets: it signs every reply.
- Set
-
Take Disconnect-Requests on the port the hub shows beside the gateway (Disconnects on UDP 3799). RouterOS listens on 1700 unless told otherwise:
/radius incoming set accept=yes port=3799Allow UDP 3799 in from the addresses the hub lists when you choose Disconnects on UDP 3799, and from nowhere else.
-
The proposal. The IKE half goes in a profile, the tunnel half in a proposal. These are the one proposal and nothing else:
/ip ipsec profile add name=trustaige-vpn hash-algorithm=sha256 enc-algorithm=aes-256 \ dh-group=ecp256 lifetime=8h /ip ipsec proposal add name=trustaige-vpn auth-algorithms=sha256 enc-algorithms=aes-256-gcm \ pfs-group=ecp256 lifetime=1hWith AES-GCM the tunnel needs no separate integrity algorithm;
auth-algorithmsis kept to one value so nothing else is offered. -
Addresses, DNS and routes for devices:
/ip pool add name=trustaige-vpn ranges=10.99.0.10-10.99.0.250 /ip ipsec mode-config add name=trustaige-vpn address-pool=trustaige-vpn \ split-include=<your-office-network> system-dns=no static-dns=10.20.0.53 /ip ipsec policy group add name=trustaige-vpn /ip ipsec policy add group=trustaige-vpn template=yes src-address=<your-office-network> \ dst-address=10.99.0.0/24 proposal=trustaige-vpn- The pool and DNS server are your own. Choose a range the office routes back to the router.
- Add one policy template, and one
split-includeentry, for each of the VPN’s Office networks. The template’ssrc-addressis what the router offers devices as its side of the tunnel, and Apple devices route only that. On a VPN that carries All traffic, use0.0.0.0/0and leavesplit-includeout.
-
The peer and the identity:
/ip ipsec peer add name=trustaige-vpn exchange-mode=ike2 passive=yes profile=trustaige-vpn /ip ipsec identity add peer=trustaige-vpn auth-method=eap-radius \ certificate=trustaige-vpn-gateway generate-policy=port-strict \ mode-config=trustaige-vpn policy-template-group=trustaige-vpnauth-method=eap-radiusauthenticates the router by its certificate and passes the device’s EAP-TLS through to Trustaige. Devices expect the router to identify itself as<your-vpn-gateway>, the Gateway identity on the VPN network’s page, which must be a subject alternative name of its certificate.
Check it works
-
Turn on logging for IPsec and RADIUS:
/system logging add topics=ipsec,!packet /system logging add topics=radius,debug -
Connect from a managed device that has received the VPN. The log shows the proposal chosen, the RADIUS exchange with Trustaige and the identity matched.
-
/ip ipsec active-peers printlists the device. In the hub, the site’s Recent joins and the network’s Recent connections show the decision, and Connected now shows the session. -
Block the device in the hub. With Takes disconnects on, its peer leaves
/ip ipsec active-peerswithin seconds.
If the device stays connected, RouterOS didn’t act on the Disconnect-Request.
Turn Takes disconnects off in the hub and choose an interval under
Connections sign in again every, so Trustaige caps each connection’s
Session-Timeout at that interval.
The gateway checks the certificate
For a VPN whose Server is The gateway checks the certificate, the router authenticates the device certificate itself. Nothing is registered at a site. See A gateway that checks the certificate for what changes for devices.
-
Import your authorities as trusted, and nothing above them. On the network’s page, open Your VPN gateway, download the trust bundle, upload it under Files, then:
/certificate import file-name=acme-network-intermediates.pem trusted=yesDon’t import the platform root as trusted: it signs every organization’s authority, so the router would admit other organizations’ devices.
-
Change the identity to authenticate the device by its certificate:
/ip ipsec identity set [find peer=trustaige-vpn] auth-method=digital-signature \ remote-id=ignoreThe router still checks that the device certificate chains to a trusted authority.
remote-id=ignorestops it comparing the device’s IKE identity with the certificate: Apple devices sendtq-followed by the device ID, which the certificate carries as its common name, not as an alternative name. Keep no other authorities trusted on this router, since any of them would be accepted. -
Turn on CRL checking, and look for your authority’s CRL:
/certificate settings set crl-use=yes crl-download=yes /certificate crl printIf the list doesn’t show a CRL from
id.trustaige.comafter a few minutes, the router can’t fetch it, and can’t see revocations.
Troubleshooting
The log shows “no suitable proposal found”
The profile or proposal differs from the device’s suite. Check
enc-algorithm=aes-256, hash-algorithm=sha256 and dh-group=ecp256 on the
profile, and enc-algorithms=aes-256-gcm with pfs-group=ecp256 on the
proposal.
The device refuses the router before any RADIUS request
The device didn’t accept the router’s certificate. Check its subject
alternative names against the Gateway identity, serverAuth, the Subject
Key Identifier, and that its intermediate is imported.
The RADIUS log shows a timeout
Nothing came back from Trustaige. Check that outbound UDP to the hub’s port is allowed, that the router is registered at the address its requests come from, and the shared secret.
The hub shows a Disconnect-Request as not acknowledged
The router didn’t take it. Check /radius incoming (accept=yes, port 3799),
the firewall, and that accounting is reaching Trustaige: Connected now
lists the session only then.
The tunnel comes up, but some office networks are unreachable
A policy template or split-include entry is missing for one of the VPN’s
Office networks. Add one for each.
What hasn’t been confirmed yet
- Trustaige’s lab hasn’t yet recorded RouterOS ending an IPsec tunnel on a
Disconnect-Request, nor acting on
Session-Timeoutfor one. The live test above shows which your router does. - Whether a policy template narrower than
0.0.0.0/0makes RouterOS offer only the office networks to Apple devices hasn’t been recorded in the lab. MikroTik notes that a narrowed template can trouble some clients. - Whether RouterOS accepts an authority below a root as its trust anchor, without the root itself, hasn’t been recorded in the lab.
MikroTik documentation
- IPsec: profiles, proposals, identities and the IKEv2 EAP RADIUS road warrior
- Certificates: import and CRL settings
- RADIUS: services and incoming requests