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 manage network interfaces configured in the router’s UCI network section. They are served under /router2 and /interfaz2 and interact with the router over SSH. All endpoints require an active session (see Authentication). Most actions return HTTP redirects with flash messages; GET /interfaz2/{iface}/editar returns JSON.

GET /router2/interfaces

Lists all configured network interfaces and returns the management view. Interface data is read from the PHP session (session('interfaces')). The session is pre-populated with default LAN and WAN entries and updated as you create or delete interfaces. Additionally, the view receives the list of physical devices available on the router (fetched live via SSH from /sys/class/net). Returns the Interfaces.interfaces Blade view.

POST /router2-reboot

Reboots the router by running the reinicio command over SSH.

Response

Redirects back to the previous page with a flash message:
  • Success: "El router se está reiniciando. Espera 1 minuto."
  • Auth error: "Contraseña de SSH incorrecta."
  • Connection error: "Error de conexión (10060): El router no responde."
Rebooting the router will drop all active SSH connections and disconnect all clients from the network for 30–60 seconds. The application will also lose its SSH connection during this time.

POST /router2/interfaces/create

Creates a new UCI network interface on the router.

Request

nombre
string
required
Interface name. Converted to lowercase before use (e.g., "myvlan" → UCI section network.myvlan).
proto
string
required
Protocol for the interface. Common values: "dhcp" (DHCP client), "static" (static IP).
ifname
string
required
Physical device or VLAN interface to assign (e.g., "eth0", "eth0.3", "br-lan").
bridge
boolean
If present, sets network.{nombre}.type='bridge' to create a bridge interface.
ipaddr
string
Static IP address. Only applied when proto is "static".
netmask
string
Subnet mask. Only applied when proto is "static".
gateway
string
Default gateway. Only applied when proto is "static".
dns
string
DNS server address. Only applied when proto is "static".

Response

Redirects back with a success flash message on creation, or an error flash message on failure. The new interface is also added to the session cache with "Pendiente..." as the IP address until the network subsystem reloads.

GET /router2/refresh

Clears the cached interface list from the session and redirects to /router2/interfaces. Use this endpoint when the session’s interface list has drifted out of sync with the actual router configuration. After clearing, the next page load re-fetches data from the session defaults.

POST /interfaz2//reiniciar

Restarts a specific network interface by running ifdown {iface}; sleep 1; ifup {iface} on the router.

Path parameters

iface
string
required
Interface name as defined in UCI (e.g., "lan", "wan", "myvlan").

Response

Redirects back with a success or error flash message.

POST /interfaz2//detener

Stops a specific network interface by running ifdown {iface} on the router. The interface is brought down but its UCI configuration is not modified.

Path parameters

iface
string
required
Interface name to stop.

Response

Redirects back with a success or error flash message.
Stopping the interface your workstation is connected through (typically lan) will immediately drop your HTTP session. Ensure you have an alternative path to the router before stopping an interface.

DELETE /interfaz2/

Deletes a network interface from the router’s UCI configuration and commits the change. The interface is also removed from the session cache.

Path parameters

iface
string
required
Interface name to delete. The name is lowercased before being passed to uci delete network.{iface}.

Response

Redirects back with a success or error flash message.
Deleting a required system interface (such as lan or wan) can make the router unreachable. This action commits to UCI and reloads the network subsystem immediately.

GET /interfaz2//editar

Fetches the current UCI configuration of a specific interface and returns it as JSON. Used by the edit form to pre-populate fields.

Path parameters

iface
string
required
Interface name to read.

Response

proto
string
Current protocol (e.g., "static", "dhcp").
ifname
string
Assigned physical device.
ipaddr
string
Static IP address, or empty string if not set.
netmask
string
Subnet mask, or empty string if not set.
gateway
string
Default gateway, or empty string if not set.
dns
string
DNS server, or empty string if not set.
{
  "proto": "static",
  "ifname": "br-lan",
  "ipaddr": "192.168.10.1",
  "netmask": "255.255.255.0",
  "gateway": "",
  "dns": ""
}
Returns HTTP 401 if the SSH login fails, or HTTP 500 with an error key on other failures.

PUT /interfaz2/

Updates the protocol and static IP settings of an existing interface. If switching to a non-static protocol, all static fields (ipaddr, netmask, gateway, dns) are deleted from UCI. Changes are committed and the network subsystem is reloaded.

Path parameters

iface
string
required
Interface name to update.

Request body

proto
string
required
New protocol: "static" or "dhcp".
ipaddr
string
New static IP address. Only applied when proto is "static".
netmask
string
New subnet mask. Only applied when proto is "static".
gateway
string
New gateway. Only applied when proto is "static".
dns
string
New DNS server. Only applied when proto is "static".

Response

Redirects back with a success or error flash message. For a visual overview of the interface management screen, see Network interfaces.

Build docs developers (and LLMs) love