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 /api/router3 prefix and interact with the router’s UCI network configuration over SSH. All endpoints require an active session (see Authentication). Responses are JSON.

GET /api/router3/rutas

Returns all configured static IPv4 and IPv6 routes from the router’s UCI network configuration.

Response

status
string
"success" or "error".
ipv4
object[]
Array of IPv4 static route objects (network.@route[N]).
ipv6
object[]
Array of IPv6 static route objects (network.@route6[N]). Same fields as IPv4 routes except netmask is not present.
{
  "status": "success",
  "ipv4": [
    {
      "id": "0",
      "interface": "wan",
      "target": "10.0.0.0",
      "netmask": "255.255.0.0",
      "gateway": "192.168.10.254",
      "metric": "10",
      "mtu": "1500",
      "table": "main",
      "type": "unicast",
      "source": "",
      "onlink": "0"
    }
  ],
  "ipv6": []
}

POST /api/router3/ruta/agregar

Adds a new static route to the router’s UCI network configuration and commits the change.

Request

tipo
string
required
IP version: "ipv4" or "ipv6".
interfaz
string
required
UCI interface name to bind the route to (e.g., "wan", "lan").
destino
string
required
Destination network address (e.g., "10.0.0.0" for IPv4, "2001:db8::/32" for IPv6).
gateway
string
required
Next-hop gateway IP address.
mascara
string
Subnet mask — IPv4 only (e.g., "255.255.255.0"). Ignored for IPv6 routes.
metrica
string
Route metric value. Optional.
mtu
string
Maximum Transmission Unit for this route. Optional.
tabla
string
Routing table name or number. Optional.
tipo_ruta
string
Route type ("unicast", "blackhole", "unreachable", etc.). Optional.
origen
string
Source address for policy-based routing. Optional.
Set to "1" to enable the on-link flag, "0" or omit to leave it unset.

Response

status
string
"success" or "error".
message
string
Result description.
curl -X POST http://your-app.local/api/router3/ruta/agregar \
  -H "Content-Type: application/json" \
  -d '{
    "tipo": "ipv4",
    "interfaz": "wan",
    "destino": "10.10.0.0",
    "mascara": "255.255.0.0",
    "gateway": "192.168.10.254",
    "metrica": "20"
  }'
{
  "status": "success",
  "message": "Ruta agregada correctamente"
}

POST /api/router3/ruta/actualizar

Updates an existing static route in place, identified by its UCI index. Changes are committed immediately.

Request

tipo
string
required
IP version: "ipv4" or "ipv6".
id
string
required
UCI index of the route to update. Obtain this from the id field returned by GET /api/router3/rutas.
interfaz
string
required
Updated interface name.
destino
string
required
Updated destination address.
gateway
string
required
Updated gateway address.
mascara
string
Updated subnet mask (IPv4 only).
metrica
string
Updated route metric.
mtu
string
Updated MTU.
tabla
string
Updated routing table.
tipo_ruta
string
Updated route type.
origen
string
Updated source address. Omit or leave empty to remove the field.
"1" to set on-link, anything else to remove the flag.

Response

status
string
"success" or "error".
message
string
Result description.
curl -X POST http://your-app.local/api/router3/ruta/actualizar \
  -H "Content-Type: application/json" \
  -d '{
    "tipo": "ipv4",
    "id": "0",
    "interfaz": "wan",
    "destino": "10.10.0.0",
    "mascara": "255.255.0.0",
    "gateway": "192.168.10.1",
    "metrica": "5"
  }'
{
  "status": "success",
  "message": "Ruta actualizada correctamente"
}

POST /api/router3/ruta/eliminar

Deletes a static route identified by its target and gateway combination. The endpoint first fetches all routes to locate the correct UCI index, then deletes that entry and commits.

Request

tipo
string
required
IP version of the route to delete: "ipv4" or "ipv6".
target
string
required
Destination address of the route to delete (e.g., "10.10.0.0").
gateway
string
required
Gateway address of the route to delete. Combined with target to uniquely identify the route.

Response

status
string
"success" or "error".
message
string
Result description. Returns "Ruta no encontrada" with HTTP 404 if no matching route exists.
curl -X POST http://your-app.local/api/router3/ruta/eliminar \
  -H "Content-Type: application/json" \
  -d '{
    "tipo": "ipv4",
    "target": "10.10.0.0",
    "gateway": "192.168.10.1"
  }'
{
  "status": "success",
  "message": "Ruta eliminada correctamente"
}

POST /api/router3/diagnostico

Runs a network diagnostic command (ping, traceroute, or nslookup) on the router and returns the raw output.

Request

accion
string
required
Diagnostic tool to run. Must be one of: "ping", "traceroute", "nslookup".
destino
string
required
Target hostname or IP address to probe (e.g., "8.8.8.8", "google.com").

Response

status
string
"success" or "error".
output
string
Raw text output from the diagnostic command. Includes all lines printed to stdout and stderr. Returns "No se obtuvo respuesta del comando" if the command produces no output.
curl -X POST http://your-app.local/api/router3/diagnostico \
  -H "Content-Type: application/json" \
  -d '{"accion": "ping", "destino": "8.8.8.8"}'
{
  "status": "success",
  "output": "PING 8.8.8.8 (8.8.8.8): 56 data bytes\n64 bytes from 8.8.8.8: seq=0 ttl=118 time=12.4 ms\n...\n5 packets transmitted, 5 packets received, 0% packet loss\n"
}
The ping command sends 5 packets with a 2-second timeout per packet. traceroute uses numeric output (-n) to avoid DNS lookups that could time out on the router.
For a visual interface to these diagnostics, see the Diagnostics feature page.

Build docs developers (and LLMs) love