Skip to content

Run Command

Run is the operator’s tool for issuing pre-defined commands directly to firewall devices, from the Run page in the web console or with ndcli run. Where sync is about propagating configuration changes, run is about operational actions — pinging a host, restarting an agent, rebooting a device, installing the plugin, backing up a configuration.

A run command can target one device, a group of devices (an Organizational Unit), or every device in your organization. It can fire immediately, or be scheduled for a future time — useful for coordinated maintenance windows.

CommandWhat it doesWhen to use it
ndcli run pingPings a target IP/hostname from the deviceValidate network reachability from the device’s perspective
ndcli run poweroffPowers off the deviceDecommissioning, deep maintenance
ndcli run restartReboots the deviceRecover from an unhealthy state, finalize a kernel/OPNsense update
ndcli run plugin-install(Re)installs the NetDefense agent plugin on the device’s firewallUpgrade an agent, recover from a corrupted install
ndcli run plugin-reloadRestarts the NetDefense agent service on the devicePick up a config tweak without a full reboot
ndcli run firmware-upgradeUpgrades OPNsense firmware — minor point release or major series jumpKeep managed firewalls current; supports no-downtime split-apply for minor upgrades. A device in a firmware track is refused: its track moves it
ndcli run backupBacks up the device’s configuration now, to your organization’s backup storage. Only devices with backup enabled are backed upTake a backup before a risky change, without waiting for the schedule

Every command produces one task per resolved device (run backup produces one per device it backs up). Use ndcli task list and ndcli task describe to inspect them afterwards. From ndcli 1.42.0, every command except run backup also prints its run code and the ndcli task list --run <code> command that lists the run’s tasks.

In the Target box on Run, choose Devices and OUs to combine OUs and single devices, or Entire organization for every enabled device, including devices that join before the run is dispatched. See Target.

If any named device or OU can’t be resolved, the whole batch is rejected with a clear error — there’s no partial application. Offline devices are still valid targets; their tasks sit PENDING until they reconnect (or expire). A backup is the exception: its task expires about a minute after it is created.

ndcli run backup backs up only devices that have backup enabled. With --all it means every device with backup enabled, not every device in the organization. A device you name, or a member of an OU you name, that has backup off is listed as skipped, with the reason.

Choose Later in the Schedule box on Run and type the time: an offset such as 30m or 2h, a date and time in your display timezone, or a timestamp with its own zone (RFC3339). Backup can’t be deferred. See Schedule.

The bare-timestamp form uses your NDCLI display timezone, which you can inspect and set:

Terminal window
ndcli config show
ndcli config set timezone America/Sao_Paulo

If unset, NDCLI uses your system’s local timezone. The CLI always converts to UTC before sending to the server — the timezone setting is purely for input parsing and output display.

A one-time scheduled task is created with status SCHEDULED. NetDefense polls every 10 seconds for scheduled tasks whose time has arrived and flips them to PENDING, at which point the normal dispatch path kicks in. You can ndcli task cancel <code> at any time before activation.

Choose On schedule in the Schedule box on Run, pick a schedule, and click Register. The recurring spec shows on the Scheduled specs tab of Tasks.

Validate connectivity before a config push

Section titled “Validate connectivity before a config push”
Terminal window
ndcli run ping --host 8.8.8.8 --count 5 --ou edge-routers
ndcli task list --type PING --status COMPLETED

Run ping first to confirm every device in the OU is reachable, then sync apply knowing the network path is healthy.

Terminal window
ndcli run restart --ou edge-routers --at "2030-05-13 03:00"

Reboots every device in edge-routers at 3 AM on 13 May 2030, in your configured timezone. Operators can sleep; the broker takes care of it.

Terminal window
# Wave 1 — canary on a single device, now
ndcli run plugin-install --version 1.5.2 --device fw-canary-01
# Wave 2 — staging OU, in 1 hour
ndcli run plugin-install --version 1.5.2 --ou staging --at 1h
# Wave 3 — production, in 1 day
ndcli run plugin-install --version 1.5.2 --ou production --at 1d

Each wave produces its own batch of tasks you can monitor independently.

Terminal window
# Find the scheduled tasks
ndcli task list --status SCHEDULED
# Cancel one
ndcli task cancel <task-code>

Cancelling individual tasks is per-task today; bulk cancel is on the roadmap.

The line is intentional and worth internalizing:

  • ndcli run is the operator’s verb. You’re choosing to do something to a device.
  • ndcli task is the inspection surface. Tasks come from many places — sync apply, scheduled backups, VPN config changes, and run itself. task list/describe/cancel lets you see what’s queued and what happened.

If you were previously using ndcli task create to ping devices or reboot them — that command has been removed. Use ndcli run instead.

The full per-command flag list and JSON output examples live in the run reference page.