4 December 2026

MikroTik 2FA without a separate server: the Auth Proxy as a RouterOS container

Phone approval for MikroTik router logins without a separate server: User Manager and the Notakey Auth Proxy both run on one of the routers.

Two-step login for MikroTik routers goes through RADIUS: the router sends the login to the Notakey Auth Proxy, which has a RADIUS server check the password and then asks the administrator’s phone to approve. Our router login guide assumes you already have a RADIUS server and somewhere to run the proxy.

Many networks have neither: a set of MikroTik routers, each with its own local users, and no Linux or Windows server next to them. For that case the routers themselves are enough. RouterOS 7 can run containers, and the Auth Proxy 2.0 image is about 10 MB. One router runs MikroTik User Manager, which checks the passwords, and the Auth Proxy as a container. Every other router sends its logins there. The phone approval comes from Notakey Cloud or from your own Notakey server.

Router login ──RADIUS──▶ proxy router: Auth Proxy (container) ──RADIUS──▶ User Manager (same router)
                                         │
                                         └──HTTPS──▶ Notakey Cloud ──▶ push to the admin's phone

We set this up in our lab on 4 December 2026 with two MikroTik Cloud Hosted Routers (CHR 7.25.1, x86_64): one ran User Manager and the proxy, and the other sent its logins to it. Every command below was run in that lab, with our addresses replaced by placeholders.

What you need

  • The proxy router: RouterOS 7 on ARM64 (for example RB5009, CCR2004, hAP ax) or x86/CHR, with about 50 MB of free storage. The proxy image is built for amd64 and arm64, so 32-bit ARM routers cannot run it. We tested on CHR; ARM64 hardware runs the arm64 image, which we have not tried on a router.
  • A Notakey service in Notakey Cloud or on your own server, with the administrators added and the Notakey Authenticator app on their phones. The usernames must be the same as in User Manager.
  • API credentials for the proxy: in the Notakey dashboard open Access credentials and create a credential with the scopes urn:notakey:auth and urn:notakey:user. Note the client ID, the client secret and the service ID.
  • Physical access to the proxy router once, to confirm the container feature (step 2).

Step 1: Install the packages

From mikrotik.com/download, take the Extra packages for your RouterOS version and architecture. Upload container-*.npk and user-manager-*.npk to Files and reboot. After the reboot both are listed:

/system/package print

Step 2: Turn on container support

/system/device-mode/update container=yes

RouterOS then waits for proof that someone is at the router: within 5 minutes, press the reset button briefly or switch the power off and on. On CHR a hard reset of the virtual machine does the same. Without it the setting is not changed. /system/device-mode print shows container: yes afterwards.

Step 3: Give the container a network

/interface/veth add name=veth-notakey address=172.17.0.2/24 gateway=172.17.0.1
/interface/bridge add name=containers
/ip/address add address=172.17.0.1/24 interface=containers
/interface/bridge/port add bridge=containers interface=veth-notakey
/ip/firewall/nat add chain=srcnat action=masquerade src-address=172.17.0.0/24
/ip/firewall/address-list add list=notakey-routers address=203.0.113.21
/ip/firewall/nat add chain=dstnat protocol=udp dst-port=18120 src-address-list=notakey-routers action=dst-nat to-addresses=172.17.0.2 to-ports=1812

The container gets its own address, 172.17.0.2, behind the router. The masquerade rule lets it reach Notakey over HTTPS. The other routers reach it on UDP port 18120 of the proxy router, because User Manager already uses 1812 there. Add the address of every router to the list notakey-routers: only those addresses are forwarded to the proxy. If your forward chain drops traffic by default, add an accept rule for UDP to 172.17.0.2 port 1812 from the same list, above the drop rule (we did not test this rule).

Step 4: Set up User Manager

/user-manager set enabled=yes
/user-manager router add name=notakey-proxy address=172.17.0.2 shared-secret="<secret B>"
/user-manager user add name=anna password="<password>"

The only RADIUS client User Manager knows is the proxy. User Manager accepts requests only from the routers listed under /user-manager router, so a router cannot skip the phone approval by asking User Manager directly. Add a User Manager user for every administrator.

Step 5: Write the proxy configuration

Create a folder for it:

/file add name=notakey type=directory

On your computer, write a file named authproxy.json and upload it into that folder (WinBox → Files, drag and drop):

{
  "clients": [
    {
      "name": "proxy-router",
      "address": "172.17.0.1",
      "secret": "<secret A1>"
    },
    {
      "name": "branch-router-1",
      "address": "203.0.113.21",
      "secret": "<secret A2>"
    }
  ],
  "passwordCheck": {
    "servers": [
      {
        "name": "user-manager",
        "address": "172.17.0.1",
        "secret": "<secret B>"
      }
    ]
  },
  "notakey": {
    "url": "https://yourcompany.notakey.cloud/api",
    "serviceId": "<service ID>",
    "clientId": "<client ID>",
    "clientSecret": "<client secret>",
    "messageTitle": "Router login",
    "messageDescription": "Allow {user} to log in to {gateway}? From: {address}."
  },
  "logins": { "timeoutSeconds": 30 }
}
  • clients are the routers that may send logins. Give each router its own entry with its own name and secret: the phone shows that name in place of {gateway}, so the administrator sees which router the login is for. The first entry is the proxy router itself, whose logins arrive from 172.17.0.1.
  • passwordCheck is User Manager, on the same router, with the secret from step 4.
  • notakey is your Notakey Cloud address (or your own server’s) with the credentials from the dashboard. The two message lines are what the phone shows.

Every setting is described in the Auth Proxy manual.

Step 6: Start the proxy

/container/config set registry-url=https://registry-1.docker.io tmpdir=container-tmp
/container/mounts add list=notakey src=/notakey dst=/etc/notakey mode=ro
/container add remote-image=notakey/authproxy:2.0.1 interface=veth-notakey mountlists=notakey root-dir=container-notakey logging=yes start-on-boot=yes

The router downloads the image from Docker Hub. When the log shows download/extract done, start it:

/container start [find]

The proxy writes its log to the router log (/log print where topics~"container"). In our lab the start looked like this:

authproxy:2.0.1: {"level":"info","event":"started","version":"2.0.1+5ccf3710...","listen":"0.0.0.0:1812","clients":2, ...}
authproxy:2.0.1: {"level":"info","event":"client","name":"gw-chr2","address":"192.168.66.177/32", ...}
authproxy:2.0.1: {"level":"info","event":"server","name":"user-manager","address":"172.17.0.1:1812"}
authproxy:2.0.1: {"level":"info","event":"api_ready","service":"bf6d9289-..."}

api_ready means the proxy reached Notakey with its credentials. If the proxy does not start, look in the same log. With start-on-boot=yes the container starts again after a reboot; in our lab it was ready about 14 seconds after the router came back.

If your RouterOS version rejects list= and mountlists=, try name= and mounts=, which we believe older RouterOS 7 releases use; we did not test them. On a router with little internal storage, put root-dir on a USB or NVMe disk, for example usb1/container-notakey.

Step 7: Send the logins to the proxy

On every other router:

/radius add service=login address=<public address of the proxy router> authentication-port=18120 secret="<that router's secret>" timeout=30s
/user aaa set use-radius=yes default-group=full

On the proxy router itself:

/radius add service=login address=172.17.0.2 src-address=172.17.0.1 secret="<secret A1>" timeout=30s
/user aaa set use-radius=yes default-group=full

Set timeout=30s. The MikroTik default is 300 milliseconds, too short for a phone approval, so the login fails before the phone shows the request. default-group is the permission level that RADIUS users get, so choose it deliberately; the router login guide explains how to give some users less.

Step 8: Test with a second session

Keep your current WinBox session open and log in from a second session with a User Manager username. The phone shows the request:

The Notakey app showing a request titled Router login: “Allow anna to log in to gw-chr2? From: 192.168.66.68.” with the seconds left and Deny and Approve buttons.

Approve lets you in, with the permissions of default-group. Deny or no answer refuses the login.

What we tested

Test Result
SSH login to the other router, approved on the phone logged in after 12 s, the router shows the user as a RADIUS login
SSH login to the proxy router itself, approved logged in after 11 s
Wrong password refused in 1.3 s, no request sent to the phone
Denied on the phone refused
No answer refused after 30 s
Reboot of the proxy router the proxy starts by itself and is ready about 14 s later
Memory of the container about 6 MB

We did not try WinBox from a Windows computer in this lab, so WinBox and WebFig logins are untested. They use the same /user aaa RADIUS setting as SSH.

Good to know

  • Keep a local administrator on every router. RouterOS checks local users first and asks RADIUS only for names it does not know. If the proxy router, its internet connection or Notakey cannot be reached, only local users can log in, so give that account a strong password and limit it to a management network with /user set <name> address=<subnet>.
  • One proxy router serves all of them. If it is down, the other routers fall back to their local administrators, so plan its maintenance like that of any central login server.
  • The RADIUS traffic crosses your network or the internet. Every packet is signed with the shared secret, and the address list lets only your routers in. If the routers already have a VPN or IPsec tunnel to the proxy router, send the RADIUS traffic through it instead.
  • authproxy.json holds the secrets. Every administrator with full rights on the proxy router can read the router’s files.
  • REST API logins ask twice. RouterOS checks the password twice for one REST API call, so a REST login needs two approvals. WinBox, WebFig and SSH ask once.

If you would rather use a server

The same configuration format works for the proxy on a Linux server with Docker or as a service on Windows, and step 7 stays the same (with port 1812). The VPN 2FA with RADIUS guide covers both. For MikroTik VPN users without any RADIUS server there is also a script-based setup, which covers PPP VPN logins but not WinBox, WebFig or SSH.

← All posts

Get started

Run it on your own server today

One command installs the appliance on a Debian or Ubuntu server, or in a new Proxmox container. The first 10 users are free.

sudo bash -c "$(curl -fsSL https://www.notakey.com/install/appliance.sh)"

You also need a public host name with HTTPS. Allow about 35 minutes. The setup, step by step →

Nothing to install: a cloud instance, first 6 users free.

Start free in the cloud

Prefer a walkthrough with an engineer? Request a demo →