These endpoints are served under theDocumentation 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.
/api/router prefix and communicate with the router over an SSH connection established at login. All endpoints require an active session (see Authentication). Responses are JSON unless noted otherwise.
GET /api/router/wifi-info
Returns current WiFi configuration and status read from the router viaiwinfo and UCI.
Response
"success" on success, "error" on failure.Raw output of
iwinfo wlan0 info (or iw dev wlan0 info as fallback). Contains signal level, channel, bitrate and mode details.SSID of the primary wireless interface (
wireless.@wifi-iface[0]). Returns "Desconocido" if not set.Encryption mode of the primary wireless interface (e.g.,
"psk2", "none"). Returns "none" if not set.Number of
wifi-iface sections configured in UCI.POST /api/router/restart-wifi
Restarts the wireless subsystem by runningwifi down && sleep 3 && wifi up on the router. The WiFi LED will turn off briefly and come back on.
Response
"success" or "error".Human-readable result message.
Clients connected to the WiFi network will be briefly disconnected during the restart sequence. The restart takes approximately 3–5 seconds.
GET /api/router/scan
Scans for nearby WiFi networks usingiw dev wlan0 scan. Falls back to iwinfo wlan0 scan if the primary scan returns no results.
Response
Returns a JSON array. Each element represents a detected network.Network name.
"Oculto" if the SSID is hidden.MAC address of the access point in uppercase colon-separated format.
WiFi channel number.
Signal strength in dBm (e.g.,
"-65").Encryption type detected.
"WPA2 PSK" when RSN/WPA IE is present, "Abierta" otherwise.GET /api/router/devices
Returns the raw contents of/tmp/dhcp.leases from the router, which lists all active DHCP leases.
Response
Raw text content of the DHCP leases file. Each line contains: expiry timestamp, MAC address, IP address, hostname, and client ID, space-separated.
POST /api/router/switch
Executes aswconfig command on the router’s switch0 device. Used for reading switch configuration such as VLAN tables and port info.
Request
The swconfig command to execute. Must begin with
swconfig dev switch0 — any other prefix is rejected with HTTP 403.Response
Raw output returned by the command.
POST /api/router/apply-uci
Applies one or more UCI commands on the router in sequence, then commits the wireless configuration. If any command referenceswifi or hostapd, the endpoint also runs wifi down; sleep 2; wifi up to apply changes live.
Request
Array of UCI command strings to execute. Empty strings are ignored. The commit (
uci commit wireless) is added automatically if not included in the list.Response
"success" or "error"."OK" on success, or an error message.Combined output from all executed commands.
POST /api/router/save-switch
Rebuilds theswitch_vlan UCI sections for switch0 based on a VLAN port matrix, commits the network configuration, and restarts the network subsystem.
Request
Array of VLAN configuration objects. Each object describes one VLAN and the role of each port within it.
Response
"success" or "error".Description of the result.
GET /api/router/port-status
Returns the link status, speed, and duplex mode for each of the seven ports (0–6) onswitch0.
Response
"success" or "error".Array of port status objects, one per port.
POST /api/router/set-port-state
Enables or disables a specific switch port using theswconfig disable attribute.
Request
Port number to control. Must be one of:
0, 1, 2, 3, 4, 5, 6.Desired port state.
"up" to enable the port, "down" to disable it.Response
"success" or "error".The port number that was modified.
The state that was applied (
"up" or "down").Human-readable confirmation message.
Raw output of the link verification command run after the state change.