How change device-mode ? or give access for tool cmd

Hi all,

I want to use a script with /tool fetch to get a blacklist from my webserver.

The problem is returned : "failure: not allowed by device-mode"

What can i do ?

Change device-mode home to basic ?

I try some command and reset or power-off and power-on the power supply with no effect.

Thanks a lot

/system license print
software-id: 9UR2-SZWX
nlevel: 5
features:

system/device-mode/print
mode: home
allowed-versions: 7.13+,6.49.8+
flagged: no
flagging-enabled: yes
scheduler: no
socks: no
fetch: no
pptp: yes
l2tp: yes
bandwidth-test: no
traffic-gen: no
sniffer: no
ipsec: yes
romon: no
proxy: no
hotspot: no
smb: yes
email: no
zerotier: no
container: yes
install-any-version: no
partitions: no
routerboard: no
attempt-count: 0

Paste this on terminal, and plug of the power within 1 day or press any button (literally, also reset) the device have.

/system device-mode update activation-timeout=1d mode=advanced partitions=yes routerboard=yes

Hi,

Change "device-mode"

Use search forum funcionality or search the MT's help page for information. It's well explained.

:open_book: RouterOS Device-Mode: Complete Operational Guide

Device-mode is a hardware-enforced security feature in MikroTik RouterOS. It restricts or protects sensitive system features (like containers, traffic sniffing, scripts, or downgrades). This minimizes the attack surface if a router is compromised remotely.

To prevent unauthorized changes, any modification to the device-mode requires physical access to the router.


:magnifying_glass_tilted_left: 1. Understanding Device-Mode States

Device-mode functions through specific features that can be individually enabled or disabled, or grouped into pre-defined profiles.

Protected Features

  • container: Controls the deployment of Docker/App containers.
  • downgrade: Controls whether RouterOS can be downgraded to an older version.
  • fetch: Controls the /tool/fetch command (often used by malware to download payloads).
  • ramdisk: Controls booting or installing RouterOS from RAM.
  • scheduler: Controls automated task execution via /system/scheduler.
  • socks: Controls the SOCKS proxy server.
  • traffic-sniffer: Controls packet capture capabilities.

Mode Profiles

  • advanced: All features are enabled by default (standard full-access router behavior).
  • home: Disables high-risk network enterprise features like traffic-sniffer and socks to protect home environments.
  • basic: Highly restrictive mode for simple deployment scenarios.

:gear: 2. Step-by-Step Configuration via CLI

Device-mode configuration cannot be modified via WebFig or WinBox GUI for security reasons. You must use the Command Line Interface (CLI).

Step 1: Check Current Device-Mode Status

Run this command to see your current mode and which features are enabled or disabled:

routeros

/system/device-mode/print

Usa il codice con cautela.

Step 2: Initiate the Update Command

You can change the overall mode or toggle specific features.

  • Example A: Switch to Advanced Mode (Enables all features)

    routeros

    /system/device-mode/update mode=advanced
    
    

    Usa il codice con cautela.

  • Example B: Enable Containers while keeping other restrictions

    routeros

    /system/device-mode/update container=yes
    
    

    Usa il codice con cautela.

  • Example C: Block RouterOS Downgrades for strict security

    routeros

    /system/device-mode/update downgrade=no
    
    

    Usa il codice con cautela.

Step 3: Physical Verification (Mandatory)

After executing an update command, RouterOS enters a pending state and outputs a message on the terminal. You have a 5-minute window to prove physical ownership of the hardware.

To confirm the changes, you must do one of the following:

  1. Cold Reboot: Physically unplug the power cable from the router and plug it back in. (Note: A software reboot via /system/reboot will NOT work).
  2. Button Press: Press the physical RESET button (or Mode button on supported models) on the router chassis when prompted by the CLI.

:warning: Warning: If you do not perform the physical action within 5 minutes, the task times out, and the configuration reverts to its previous state.


:hammer_and_wrench: 3. Troubleshooting & Notes

  • "Action failed: device-mode does not allow...": If you see this error while running scripts, fetch tools, or starting containers, it means the current device-mode profile is blocking that feature. You must follow the steps above to unlock it.
  • Resetting Device-Mode: If you lock yourself out of a feature and cannot access the physical button easily, a full Netinstall (reflashing the router firmware via network) is required to reset the security boundaries.

/system/device-mode/update/mode=

Followed by a hard reboot via either the button, or a power pull/restore (a software induced reboot will do nothing).

(Myself, I set everything to "Advanced" . . . )

@rextended
Please do not be an AI frontend :slight_smile:

The answer is in the first reply, and I wrote it my way, everything else is useless... (with respect for the other users who posted),
and since the non-admin-dictator appreciates AI-generated posts, why not fill the forum with them,
always and everywhere, since they are completely on-topic and explain perfectly what is requested? (joke!)

It works, thanks a lot !

Is this for those who are not in a hurry? :joy:

... or device is in the middle of nowhere...

It's a copy-and-paste of what I use for bulk provisioning when I get new peripherals and need to connect them to the PoE switch.
When the script is finished, it pings the PoE IP, which then takes over and power off and on that port after some seconds,
the time to apply device mode...

Then netinstall arrived with the unlock...