Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/KevinCruz-cell/Redes-de-comunicaciones-/llms.txt

Use this file to discover all available pages before exploring further.

These endpoints are served under the /router4 prefix and interact with the router via SSH and SCP. All endpoints require an active session (see Authentication). Three of the four operations cause the router to reboot — plan accordingly before calling them.

GET /router4/backup/descargar

Creates a configuration backup on the router using sysupgrade -b, then streams the resulting archive to the browser as a file download.

How it works

  1. Runs sysupgrade -b /tmp/backup.tar.gz on the router via SSH.
  2. Reads /tmp/backup.tar.gz over SSH and streams the bytes directly to the HTTP response.
  3. Deletes the temporary file from the router after streaming.

Response

On success, returns a binary file download with the following headers:
HeaderValue
Content-Typeapplication/gzip
Content-Dispositionattachment; filename="backup_router_{YYYY-MM-DD_H-i-s}.tar.gz"
Cache-Controlprivate
Content-LengthSize of the backup archive in bytes
On failure, redirects to /router4/copia with an error flash message.
# Download backup to current directory
curl -O -J http://your-app.local/router4/backup/descargar
The backup contains only the router’s configuration overlay (files in /etc/config and other overlays tracked by OpenWrt). It does not include the full firmware image.

POST /router4/backup/restaurar

Transfers a backup archive to the router via SCP and runs sysupgrade -r to restore the configuration.

Request

Send as multipart/form-data.
backup
file
required
Backup archive to restore. Must be a .gz or .tar.gz file. Maximum size: 10 MB.

Response

On success, redirects to /router4/copia with a success flash message. The router will reboot to apply the restored configuration.
curl -X POST http://your-app.local/router4/backup/restaurar \
  -F "backup=@backup_router_2025-05-19_10-00-00.tar.gz"
The router reboots after the configuration is restored. You will lose connectivity for 30–60 seconds. Make sure you are restoring a backup that was created from this same router model and firmware version.

POST /router4/reset

Performs a factory reset by running firstboot -y && reboot on the router. All configuration is erased and the router returns to its default firmware state.

Request

confirm
string
required
Must be the string "true" to confirm the reset. Any other value cancels the operation and redirects with an error.

Response

On success (when confirm is "true"), redirects to /router4/copia with a warning flash message. On cancellation, redirects with an error flash message.
curl -X POST http://your-app.local/router4/reset \
  -H "Content-Type: application/json" \
  -d '{"confirm": "true"}'
This operation is irreversible. All custom configuration — including WiFi settings, firewall rules, DHCP leases, network interfaces, and static routes — will be permanently erased. The router will reboot with factory defaults. Download a backup first using GET /router4/backup/descargar.

POST /router4/firmware/grabar

Transfers a firmware image to the router via SCP and runs sysupgrade to flash it. The router will reboot into the new firmware.

Request

Send as multipart/form-data.
firmware
file
required
Firmware image to flash. Must be a .bin file. Maximum size: 20 MB.

Response

Redirects to /router4/copia with a warning flash message indicating the flash is in progress.
curl -X POST http://your-app.local/router4/firmware/grabar \
  -F "firmware=@openwrt-22.03-mt7620-sysupgrade.bin"
Flashing incorrect firmware can permanently brick your router. Always verify that the firmware file matches your exact router model and hardware revision before uploading. Do not interrupt power to the router during the flash process. The router will be unreachable for several minutes while it reboots into the new firmware.
For a guided walkthrough of the backup and restore process, see Backup and restore.

Build docs developers (and LLMs) love