Key takeaways
- At fleet scale, every device needs a stable identity, an owner, a group and a known firmware and configuration version.
- Configuration should come from templates plus per-device variables, never from hand edits on individual routers.
- Roll out firmware and configuration in stages with automatic stop conditions; a canary group is mandatory, not optional.
- Agents must connect outbound, back off politely, and queue data while offline, or the fleet will overload your backend after every outage.
Ten OpenWrt routers can be run from a text file of IP addresses and an SSH key. A thousand cannot. At that size, the hard problems are no longer about OpenWrt itself but about identity, consistency, change control and attention. This guide covers what has to be in place before a fleet of that size becomes manageable.
Inventory and device identity
Everything else depends on knowing exactly which device you are talking to. IP addresses change, hostnames get copied, and labels on boxes fade. Pick an immutable identifier and use it everywhere.
The usual candidates are the base MAC address and the manufacturer's serial number. On many boards the MAC lives in a factory or calibration partition and is exposed by the kernel; the serial may be in the same partition, in U-Boot environment, or only on the label. Decide which one is canonical during hardware bring-up, not after you have shipped five hundred units.
# Useful identity facts on a running device
ubus call system board # model, board_name, release
cat /sys/class/net/eth0/address # interface MAC (name varies by board)
cat /tmp/sysinfo/board_name
jsonfilter -i /etc/board.json -e '@.model.id'
Your inventory record for each device should hold at least: identifier, hardware model and revision, current firmware build, configuration template and version, group and tags, site and customer, last-seen time and the credential (key or certificate) the device uses to authenticate. If any of these lives only in someone's head, it will be wrong during an incident.
Grouping and tagging
Groups are how you act on many devices at once. Use a small number of hierarchical groups for things that determine configuration and ownership, such as customer, site and role, and free-form tags for everything else, such as hardware revision, pilot participation or ISP.
A practical rule: a device should be in exactly one place in the hierarchy but can carry any number of tags. That way, "which template applies" has a single answer, while "every device on hardware rev B in the Pune region" is still one query away.
Templates instead of hand edits
A thousand routers with a thousand hand-maintained configurations is a thousand subtly different routers. The fix is to express configuration as templates of UCI sections with variables for the things that genuinely differ per site or device: SSIDs, VLAN IDs, WAN type, static addresses, WireGuard keys.
Keep templates layered: a base layer for security and system settings, a role layer (gateway, access point, mesh node), and a site layer. Per-device variables should be the smallest set possible. If you find yourself adding a variable for one device, ask whether that device belongs in a different group instead. Our guide to OpenWrt configuration management covers UCI templating and drift detection in depth.
Staged rollouts and canaries
The fastest way to break a thousand devices is to change all of them at once. Every change, firmware or configuration, should go through stages with an explicit gate between each.
Choose canary devices deliberately. They should cover every hardware model and revision, every WAN type you support and a few of your most demanding sites, and they should belong to customers who have agreed to be early. Random sampling alone tends to miss the one hardware revision with a different flash chip.
| Stage | Gate to proceed | Typical soak |
|---|---|---|
| Lab | Every hardware model upgrades and reconnects; config applies cleanly | Until tests pass |
| Canary | All devices report the new version; no rise in reboots or disconnects | 24–72 hours |
| Wave 1 | Failure rate below an agreed threshold; no new support tickets pattern | 24 hours |
| Wave 2 and remainder | Same metrics hold at larger scale | Hours to a day each |
Automate the stop condition. If more than a small number of devices in a wave fail to report back within the expected window, the rollout pauses itself and pages someone. Humans are bad at noticing that 3% of a wave went quiet at 2 a.m.
Monitoring and alert fatigue
A thousand devices generate a lot of noise. Consumer broadband drops, power cuts and rebooting customers will produce a constant trickle of "device offline" events. If every one of them pages an engineer, within a week nobody reads the alerts.
- Alert on patterns, not individuals. One router offline is a ticket. Fifty routers on the same ISP offline in five minutes is an incident.
- Use duration thresholds. Alert when a device has been offline for longer than a normal reboot or brief outage, not on the first missed heartbeat.
- Separate severities. Paging alerts should be rare and actionable. Everything else goes to a dashboard or daily report.
- Track fleet-level metrics. Percentage online, version distribution, reboot rate and configuration drift count tell you more than individual graphs.
Firmware lifecycle
At fleet scale you are effectively a distribution maintainer. Build images reproducibly from a pinned OpenWrt release and feed revisions, using the SDK or Image Builder, and record exactly which build each device runs. Aim to keep the fleet on no more than two or three builds at once: the current release, the previous one during rollout, and perhaps a long-term build for hardware you can no longer update.
Plan for security updates within OpenWrt's maintenance windows, and for the moment a hardware model reaches end of life because a new release no longer fits its flash or RAM. Hardware with 8 MB of flash or 64 MB of RAM becomes difficult to keep current; factor that into procurement decisions.
Agent design for a large fleet
If you write or choose a management agent, its behaviour under failure matters more than its features. The properties that keep a large fleet stable:
- Outbound only. The agent connects to the controller over TLS, so NAT and CGNAT are irrelevant and nothing listens on WAN.
- Exponential backoff with jitter. After a controller outage, a thousand devices reconnecting at the same second is a self-inflicted denial of service. Randomise retry timing.
- Offline queueing. Buffer telemetry and events locally (in RAM or tmpfs, bounded in size) and send them on reconnect. Avoid writing frequently to flash.
- Small footprint. Low-end MIPS devices have little RAM. A compiled C or Lua agent using ubus and UCI directly is lighter than a heavy runtime.
- Safe apply. Apply configuration, verify connectivity to the controller, and revert automatically if the device cannot reach it within a timeout.
- Supervised. Run under procd with respawn so a crash does not take the device off your map.
# Sketch of reconnect backoff with jitter in a shell-based agent
delay=5
while ! connect_to_controller; do
jitter=$(( $(hexdump -n 2 -e '/2 "%u"' /dev/urandom) % delay ))
sleep $(( delay + jitter ))
[ "$delay" -lt 600 ] && delay=$(( delay * 2 ))
done
API automation
A web console is fine for looking at things. Changes at scale should be scripted against an API so they are repeatable, reviewable and logged. Typical automations include enrolling devices from a manufacturing manifest, creating sites from a CRM or ticketing system, generating weekly reports on version distribution and offline devices, and opening tickets automatically when a device has been offline for a day.
Treat the scripts like code: keep them in version control, have changes reviewed, and run destructive operations against a test group first. An API makes it just as easy to break a thousand devices as to fix them.
Staffing and process
Tools do not replace process. A thousand-device fleet needs a few written agreements:
- Who can approve a fleet-wide change, and who can execute it.
- A change calendar, so firmware rollouts do not collide with customer events.
- Runbooks for the common failures: device offline, upgrade stuck, configuration rejected, hardware replacement.
- An on-call rotation with sensible paging rules, and a clear escalation path to someone who knows the firmware internals.
- Role-based access, so support staff can view and reboot devices without being able to push firmware.
How many people you need depends far more on automation and hardware diversity than on device count, with firmware engineering effort peaking around releases.
How CloudWRT helps
The CloudWRT Platform is built for this kind of fleet: centralised dashboard with device grouping and bulk operations, configuration templates with variable substitution, scheduled firmware and configuration rollouts with rollback, real-time monitoring, analytics and reporting, and REST APIs for automation. It works with OpenWrt hardware from many ODMs.
If you would rather not staff the operation yourselves, our managed services team provides 24/7 monitoring and configuration and firmware management. For custom builds, agent integration or end-of-life planning, talk to our R&D team, or start a free trial.
Frequently asked questions
What is the best unique identifier for an OpenWrt device?
Use whatever is immutable and readable by software on every unit, usually the base MAC from the factory partition or a serial number programmed at manufacture. Decide during hardware bring-up and make sure the agent reports it.
How large should a canary group be?
Large enough to include every hardware model, revision and WAN type you run, which in practice is often around 1% of the fleet or a few dozen devices, whichever is larger.
Can Ansible manage 1,000 OpenWrt routers?
It can push configuration over SSH, but it needs every device reachable at run time, which is hard behind NAT. Many teams use an agent and controller for reachability and monitoring, and keep Ansible for lab and infrastructure tasks.
How many firmware versions should a fleet run at once?
As few as possible, ideally two during a rollout: the current release and the one being replaced. Every additional build multiplies testing and support effort.