---
title: "Instalar en OpenWrt | Wantastic Docs"
description: "Instala wantasticd en un router OpenWrt en 2 minutos por SSH: añade el controlador TUN, ejecuta un comando wget, escanea un código QR y haz clic en Claim Device."
url: "https://wantastic.app/es/docs/install-openwrt"
category: "Install wantasticd"
reading_time: "4 min"
---

# Instalar en OpenWrt

Instala wantasticd en un router OpenWrt en 2 minutos por SSH: añade el controlador TUN, ejecuta un comando wget, escanea un código QR y haz clic en Claim Device.

> **Outcome:** wantasticd se ejecuta como servicio procd en el router, se reinicia solo, arranca con el sistema y el router aparece como Online en la consola.

## Before you start

- OpenWrt 19.07 o posterior, con acceso SSH como root.
- Unos 6 MB de flash libres.
- Hora del router correcta (NTP está activado por defecto).
- Un teléfono o un navegador para iniciar sesión en la consola de Wantastic.

## Instalación rápida (2 minutos)

Conéctate al router por SSH como root. Dos comandos instalan el controlador TUN y wantasticd y luego muestran un código QR. No necesitas token.

1. Inicia sesión en el router por SSH como root (ssh root@192.168.1.1). Instala el controlador TUN con el primer comando de abajo.
2. Pega el comando de instalación. Instala wantasticd y luego muestra el código QR.
3. El dispositivo muestra una Claim URL y un código QR. Escanea el código QR con tu teléfono o abre la Claim URL en un navegador.
4. Inicia sesión en la consola de Wantastic. Se abre la ventana Claim Wantastic Device con la clave ya rellenada. Haz clic en Claim Device.
5. La terminal muestra "Device claimed". Pulsa Ctrl+C y ejecuta el comando de reinicio de abajo.
6. Abre Devices en la consola. El dispositivo aparece como Online.

Instalar el controlador TUN:

```sh
opkg update && opkg install kmod-tun ca-bundle
```

Instalar y reclamar:

```sh
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
```

Tras "Device claimed": pulsa Ctrl+C y reinicia el servicio:

```sh
/etc/init.d/wantasticd restart
```

*Instalar y reclamar: genkey muestra una Claim URL y un código QR, y luego espera. Cuando haces clic en Claim Device en la consola, muestra "Device claimed". Entonces pulsa Ctrl+C y reinicia el servicio.*

```
$ root@OpenWrt:~# wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
…
Skipping login. Run 'wantasticd login' to authenticate.
Service registered with procd and started.
…
Generated device claim key: /etc/wantastic/device-claim-key.json
Public key: Vd3hK1oQ7mR2sT9uW4xY6zA8bC0dE2fG4hJ6kL8mN0P=
Server URL: https://console.wantastic.app
Claim URL: https://console.wantastic.app/#desktop?claim_public_key=Vd3hK1oQ…%3D&wantastic_server=https%3A%2F%2Fconsole.wantastic.app

█▀▀▀▀▀█ ▄▀▄ ▀█▄ █▀▀▀▀▀█
█ ███ █ ▀█▄▀▄█ █ ███ █
█ ▀▀▀ █ ▄▀█ ▀▄ █ ▀▀▀ █
▀▀▀▀▀▀▀ ▀ ▀ █ ▀ ▀▀▀▀▀▀▀
▀█▄▀▄▀▀█▀▄█▀▄▀▀▄█▀▄▀█▄
█▀▀▀▀▀█ █▄▀▄▀█ ▀▄█ ▄▀
▀▀▀▀▀▀▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀

2026/10/29 09:14:03 Waiting for claim. Press Ctrl+C to stop.
2026/10/29 09:15:12 Device claimed. Configuration saved to /etc/wantastic/config.conf
^C
$ root@OpenWrt:~# /etc/init.d/wantasticd restart
```

*Console: Claim Wantastic Device. La Claim URL y el código QR rellenan la clave por ti. Solo tienes que hacer clic en Claim Device.*

1. Claim public key ya está rellenado
2. Deja Wantastic server como aparece
3. Haz clic en Claim Device

> **Warning:** La mayoría de los routers MIPS (MT7621, MT7628) necesitan una compilación distinta de la que elige el instalador. Si el instalador se detiene con "downloaded binary does not report target version", sigue la guía de routers MIPS.

> **Tip:** ¿No tienes el teléfono a mano? Copia la Claim URL de la terminal y ábrela en cualquier ordenador.

> **Operational note:** Antes de la reclamación, el instalador puede mostrar "Error: procd service did not become healthy". Es normal en un router nuevo. OpenWrt 24.10 y posteriores usan apk en lugar de opkg: apk update && apk add kmod-tun ca-bundle

## Comprueba que funciona

1. Ejecuta wantasticd status. Muestra Status: Connected y una VPN IP.
2. Abre Devices en la consola. El dispositivo aparece como Online.

Comprobación:

```sh
wantasticd status
```

*wantasticd status: Status: Connected y una VPN IP indican que el túnel está activo.*

```
$ root@OpenWrt:~# wantasticd status
Status:        Connected
Version:       v1.0.54+377f3c0
Mode:          TUN (wantastic0)
VPN IPs:       10.200.0.14/32
Public key:    q7ZkV3m1yH0dTn8pXo2bLwR4sE6uJ9cA1fG5hK8iN0M=
Server:        wg.wantastic.app:51820
Exit node:     false
Local access:  false
Auto update:   true
Traffic:       ↓ 18.4 KiB  ↑ 9.2 KiB
Peers:         2 (direct 1, relay 1)
Uptime:        4m12s
```

*Console: Ventana Devices: el nuevo dispositivo aparece con su nombre y pasa a Online en pocos segundos.*

1. Buscar por nombre
2. Status muestra Online
3. La IP de Overlay coincide con wantasticd status
4. Last seen se sigue actualizando

## Gestionar el servicio

procd y logread:

```sh
/etc/init.d/wantasticd restart
/etc/init.d/wantasticd stop
/etc/init.d/wantasticd start
logread -e wantasticd          # log lines
```

> **Operational note:** Las líneas de registro normales aparecen como daemon.err. Lee el texto, no el nivel.

## Opcional: acceder a la LAN del router

Esto permite que tus otros dispositivos accedan a la LAN del router (por ejemplo, 192.168.1.0/24) a través de Wantastic.

Activar el acceso local:

```sh
/etc/init.d/wantasticd stop
wantasticd connect --config /etc/wantastic/config.conf --allow-local-access
# wait a few seconds, press Ctrl+C, then:
/etc/init.d/wantasticd start
```

> **Operational note:** El ajuste se guarda en la configuración, así que el servicio lo conserva.

## Otras formas de instalar

Solo lo necesitas para automatización o casos especiales. La instalación rápida de arriba es la forma más sencilla.

### Con un token (muchos dispositivos)

Usa un token cuando instales muchos dispositivos con un script o cuando nadie pueda escanear un código QR. Crea el token una vez en la consola: Account → Secrets → + New Secret → Generate. Sustituye <TOKEN> por él.

Instalación con token:

```sh
wget -qO- https://get.wantastic.app/install.sh | sh -s -- --token <TOKEN>
```

> Trata el token como una contraseña. Quien lo tenga puede añadir dispositivos a tu cuenta hasta que caduque.

### Script de la consola

En la consola, abre Show Config de cualquier dispositivo → pestaña UNIX y haz clic en Copy. Pega el script en la terminal del dispositivo. El script ya incluye un token.

### Instalación manual

Para CPU poco comunes, equipos sin conexión o tus propios archivos de servicio, sigue la guía Instalación manual con tarball.

*Console: Account → Secrets → + New Secret. El valor del secreto es el token.*

1. Abre la pestaña Secrets
2. Haz clic en + New Secret
3. Ponle un nombre
4. Haz clic en Generate
5. Copia el nuevo secreto

## Verify the result

- wantasticd status muestra Status: Connected.
- logread -e wantasticd muestra "Wantastic agent started successfully".
- El router aparece como Online en Devices, también tras un reinicio.

## Common issues

### El servicio arranca y se detiene de inmediato.

```
Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist
```

- **Where:** registro del servicio
- **Likely cause:** El controlador TUN del kernel no está cargado.
- **Fix:** Carga el controlador TUN y luego reinicia el servicio.

Solución:

```sh
opkg update && opkg install kmod-tun
/etc/init.d/wantasticd restart
```

- **Verify:** ls -l /dev/net/tun muestra el dispositivo.

### El instalador termina con un error de procd.

```
Error: procd service did not become healthy
```

- **Where:** install.sh
- **Likely cause:** El router aún no se ha reclamado o falta kmod-tun.
- **Fix:** Instala kmod-tun, reclama el router y luego reinicia el servicio.

Solución:

```sh
opkg update && opkg install kmod-tun
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

### El instalador se detiene justo después de la descarga.

```
Error: downloaded binary does not report target version v1.0.54+377f3c0
```

- **Where:** install.sh
- **Likely cause:** El router tiene una CPU MIPS little-endian y el instalador eligió la compilación big-endian.
- **Fix:** Instala a mano la compilación mipsle. La guía de routers MIPS tiene los comandos listos para copiar y pegar.

### La descarga falla.

```
wget failed: https://get.wantastic.app/…
```

- **Where:** install.sh
- **Likely cause:** Falta el paquete de CA, la hora del router no es correcta o el router no tiene DNS.
- **Fix:** Instala el paquete de CA y ajusta la hora, y luego vuelve a ejecutar la instalación rápida.

Solución:

```sh
opkg update && opkg install ca-bundle
ntpd -q -p pool.ntp.org
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
```

### El instalador no puede escribir el binario.

```
Error: /usr/bin is still not writable after remounting /
```

- **Where:** install.sh
- **Likely cause:** La flash está llena.
- **Fix:** Comprueba el espacio libre y elimina los paquetes que no uses; luego vuelve a intentarlo.

Comprobar espacio:

```sh
df -h /overlay
```

### El instalador no puede volver a montar el sistema de archivos.

```
Error: could not remount / read-write. Run as root or unlock the filesystem.
```

- **Where:** install.sh
- **Likely cause:** El firmware bloquea el sistema de archivos (firmware del fabricante).
- **Fix:** Instala OpenWrt original o instala en una ubicación con escritura (USB) con la guía Instalación manual con tarball.

### El servicio no arranca o se reinicia una y otra vez.

```
Failed to load configuration: validate config: private key required
```

- **Where:** logread
- **Likely cause:** wantasticd está instalado pero el dispositivo aún no se ha reclamado, así que su archivo de configuración está vacío.
- **Fix:** Reclama el dispositivo y luego reinicia el servicio.

Reclamar y reiniciar:

```sh
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

- **Verify:** wantasticd status muestra Status: Connected.

### Hiciste clic en Claim Device, pero la terminal nunca muestra "Device claimed".

```
Claim polling not ready: claim config rejected (401): invalid signature or timestamp out of window
```

- **Where:** wantasticd genkey
- **Likely cause:** El reloj del dispositivo no está en hora. La reclamación solo funciona si el reloj tiene un desfase inferior a 30 segundos respecto a la hora real.
- **Fix:** Corrige el reloj. genkey sigue esperando y termina por sí solo.

Ajustar la hora una vez:

```sh
ntpd -q -p pool.ntp.org
date
```

### Aparece una segunda interfaz (wantastic1) o el registro muestra un conflicto de puertos.

```
Port 51820 in use, using random port
```

- **Where:** registro del servicio
- **Likely cause:** genkey sigue ejecutándose en la terminal mientras el servicio también se ejecuta. Ahora compiten dos copias.
- **Fix:** Pulsa Ctrl+C en la terminal de genkey y luego reinicia el servicio.

Reiniciar:

```sh
/etc/init.d/wantasticd restart
```

### wantasticd status muestra Offline.

```
Status: Offline — daemon not running (start: sudo systemctl start wantasticd (OpenWrt: /etc/init.d/wantasticd start))
```

- **Where:** wantasticd status
- **Likely cause:** El servicio en segundo plano está detenido, ha fallado o todavía está arrancando. El comando status no lo inicia.
- **Fix:** Inicia el servicio.

Iniciar el servicio:

```sh
/etc/init.d/wantasticd start
```

### status indica Running (tunnel down), o peers muestra HANDSHAKE never para (server).

```
Device health check failed: …
```

- **Where:** registro del servicio
- **Likely cause:** La red bloquea el puerto UDP 51820 saliente hacia el hub (wg.wantastic.app), o el DNS no funciona.
- **Fix:** Permite UDP 51820 saliente en tu firewall y luego reinicia el servicio.

Probar DNS y reiniciar:

```sh
nslookup wg.wantastic.app
/etc/init.d/wantasticd restart
```

- **Verify:** wantasticd peers muestra un handshake reciente (por ejemplo "8s ago") para (server).

### Quieres mover el dispositivo a otra cuenta o empezar de cero con una nueva reclamación.

```
Config already exists at /etc/wantastic/config.conf — skipping login.
```

- **Where:** install.sh
- **Likely cause:** El dispositivo conserva su configuración, incluso si vuelves a ejecutar el instalador. Primero debes quitar la configuración anterior.
- **Fix:** Aparta la configuración anterior y luego reclama el dispositivo de nuevo con una clave nueva.

Empezar de cero:

```sh
mv "/etc/wantastic/config.conf" "/etc/wantastic/config.conf.bak"
wantasticd genkey --force
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

- **Verify:** El dispositivo aparece en la nueva cuenta y wantasticd status muestra Connected.

### Una instalación con token falla justo después de la descarga.

```
Login failed: registration rejected (401): invalid or expired login token
```

- **Where:** install.sh / wantasticd login
- **Likely cause:** El token es incorrecto, ha caducado, se ha agotado (se alcanzó Max Uses) o se ha eliminado.
- **Fix:** Prescinde del token. Reclama el dispositivo en su lugar.

Reclamar en su lugar:

```sh
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

- **Verify:** El dispositivo aparece en Devices y se muestra Online.

### Se rechaza la reclamación o el inicio de sesión.

```
Login failed: account has reached its device limit — upgrade your plan or remove an existing device
```

- **Where:** wantasticd login / Consola
- **Likely cause:** Tu plan ha alcanzado el número máximo de dispositivos. La consola muestra "You have reached the maximum number of devices for your plan."
- **Fix:** Elimina un dispositivo que no uses en Devices (fila → Delete) o mejora tu plan. Luego reclama de nuevo.

## Continue with

- [Choose your install method](https://wantastic.app/es/docs/install-overview): Find your device in one table and copy one command. Most devices install in 2 minutes: install, scan a QR code, click Claim Device.
- [Install on MIPS routers](https://wantastic.app/es/docs/install-mips-routers): Install wantasticd on MIPS routers and boards: one command tells you the CPU type, then copy the matching install block and claim the router with a QR code.
- [Install on BusyBox / embedded Linux](https://wantastic.app/es/docs/install-embedded-busybox): Install wantasticd on minimal BusyBox devices without systemd, procd or OpenRC: one wget command, scan a QR code, click Claim Device.
- [wantasticd CLI reference and operations](https://wantastic.app/es/docs/wantasticd): The most used wantasticd commands first, then every command and flag, environment variables, config and state paths per OS, log lines, local access, exit node, and the claim flow (genkey / --wait-claim).
- [Update, roll back and uninstall](https://wantastic.app/es/docs/update-and-uninstall): Update or uninstall wantasticd with one line per OS. Also: how auto-update works, turning it off, rolling back to the previous binary, and purging all data.
- [OpenWrt and embedded device errors](https://wantastic.app/es/docs/errors-openwrt-embedded): kmod-tun, read-only flash, procd, full flash, wrong clocks and BusyBox issues on routers and modules.
- [Installer errors (install.sh and install.ps1)](https://wantastic.app/es/docs/errors-installer): Every message the Wantastic installers print when they stop, what it means and the easiest fix.
- [WebProxy for device web UIs](https://wantastic.app/es/docs/webproxy): Open a router, NAS or camera web page in the console. No port forward needed.
