Skip to content

NAS Device States

Reference for the NAS state machine in ISP-OS. A NAS represents a MikroTik router managed through the ISP-OS control plane.

Status vs health

Persisted NAS status is stored in nas_devices.status. Heartbeat freshness is a separate UI concern.

SurfaceValuesNotes
Persisted statuspending, online, offline, disabled, removing, removedCanonical database state
UI health labelConnected, Degraded, OfflineDegraded is not its own database enum

Heartbeat windows

  • Connected: router is online and the latest WireGuard handshake is 120 seconds old or newer
  • Degraded: router is still online, but the UI turns amber once the handshake is older than 120 seconds
  • Offline: the heartbeat job flips the NAS to offline only after the handshake is older than 300 seconds for 3 consecutive 10-second checks

In practice, a router turns Offline after about 5.5 minutes of sustained misses.

Important

NAS going Offline does not suspend subscribers. The management plane can fail while PPPoE sessions on the router continue normally.

Persisted statuses

StatusMeaningWireGuardRADIUSSubscriber impact
PendingRouter onboarding is in progressPeer not yet fully active for steady-state managementNot available for normal authNo live subscriber services should depend on it
OnlineRouter is connected and manageablePeer active, handshake healthy enough for serviceRegisteredFull provisioning and reconciliation work
OfflineRouter heartbeat is stale long enough to fail livenessPeer exists but handshake is staleStill registeredExisting sessions continue; new management actions may pause or fail
DisabledAdmin intentionally took the router out of active managementPeer removedExcludedExisting sessions may continue until re-auth; new auth is rejected
RemovingRouter deletion cascade is runningPeer removed during teardownBlockedSubscriber services are being deprovisioned or reassigned
RemovedTerminal soft-deleted statePeer removedNot registeredNone

Pending phase summary

Pending routers also carry nas_devices.onboarding_phase.

PhaseUI meaningCanonical routeNotes
preflight_pendingInspect waiting or inspect attention/routers/onboarding/{router}?phase=inspectRuns the read-only inspect script and records network claims
install_ready_bridgeBridge/routers/onboarding/{router}?phase=bridgeInspection completed; operator reviews the chosen /29 before installation
install_pendingInstall awaiting or install registering/routers/onboarding/{router}?phase=installInstall token issued; setup_script_fetched_at marks the first successful fetch

For the full onboarding surface, routes, and action semantics, see Router Onboarding Reference.

Allowed actions

StatusAllowed actions
PendingResume onboarding, regenerate token, restart preflight, cancel onboarding
OnlineReview snapshot, capture a fresh snapshot, disable, delete, open reconciliation surfaces
OfflineReview snapshot, capture a fresh snapshot, delete
DisabledEnable, delete
RemovingNone
RemovedNone

Transition table

FromToTriggerAutomated actions
PendingOnlineRouter finishes install and claims successfullyAdd WireGuard peer, clear claim token, stamp claimed_at, capture a router snapshot
PendingPendingOperator regenerates token or restarts preflightPreserve or reset phase depending on action
OnlineOfflineHeartbeat stale for the Offline thresholdPause management-plane work that depends on router reachability
OfflineOnlineWireGuard handshake resumesReconciliation can resume
OnlineDisabledAdmin disables the routerRemove peer and exclude from active RADIUS use
DisabledOnline or OfflineAdmin enables the routerRe-add peer and evaluate current reachability
OnlineRemovingAdmin deletes the routerBegin async teardown cascade
OfflineRemovingAdmin deletes the routerBegin teardown without relying on live router calls
DisabledRemovingAdmin deletes the routerSame DB-side teardown path as Offline
RemovingRemovedTeardown completesSoft-delete the router record

Invalid transitions

FromToReason
PendingDisabledThere is nothing steady-state to disable yet
PendingOfflineRouter has not reached a managed online state yet
RemovedAnyTerminal state
RemovingOnlineTeardown is in progress and cannot be cancelled back to service

See also

NAS state management page

Was this helpful?

Built for Philippine ISP resellers.