---
title: "在 MIPS 路由器上安装 | Wantastic Docs"
description: "在 MIPS 路由器和开发板上安装 wantasticd：一条命令告诉你 CPU 类型，然后复制对应的安装代码块，并用二维码认领路由器。"
url: "https://wantastic.app/zh/docs/install-mips-routers"
category: "Install wantasticd"
reading_time: "5 分钟"
---

# 在 MIPS 路由器上安装

在 MIPS 路由器和开发板上安装 wantasticd：一条命令告诉你 CPU 类型，然后复制对应的安装代码块，并用二维码认领路由器。

> **Outcome:** 正确的 MIPS 版本作为服务在你的路由器上运行，路由器在控制台中显示为 Online。

## Before you start

- 路由器上的 root shell（SSH）。
- TUN 驱动（OpenWrt：opkg install kmod-tun）。
- 约 6 MB 可用闪存空间。
- 一部手机或一个浏览器，用于登录 Wantastic 控制台。

## 快速安装（5 分钟）

MIPS 路由器分为两种：小端（大多数路由器）和大端。安装程序可能选错类型，因此请先检查。无需令牌。

1. 以 root 身份登录路由器，运行下方的检查命令。
2. 如果输出 mipsel 或 01，请使用“小端”选项卡；否则使用“大端”选项卡。
3. 粘贴该选项卡中的命令。路由器会打印 Claim URL 和二维码。
4. 扫描二维码或打开 Claim URL，登录后点击 Claim Device。
5. 终端打印 "Device claimed" 后，按 Ctrl+C。然后用该选项卡中的最后一条命令启动服务。

检查 CPU 类型:

```sh
grep DISTRIB_ARCH /etc/openwrt_release 2>/dev/null || hexdump -s 5 -n 1 -C /bin/busybox
```

### 小端（mipsel，大多数路由器）

MediaTek MT7621、MT7628、MT7620 以及大多数家用路由器。此操作会手动安装 mipsle 版本、认领路由器并添加 OpenWrt 服务。

安装、认领并添加服务:

```sh
cd /tmp
TAG=$(wget -qO- https://get.wantastic.app/latest | cut -d+ -f1)
wget -O w.tgz https://get.wantastic.app/$TAG/wantasticd-linux-mipsle.tar.gz
tar -xzf w.tgz && ./wantasticd version
cp wantasticd /usr/bin/wantasticd && chmod 755 /usr/bin/wantasticd
cat > /etc/init.d/wantasticd <<'EOF'
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
start_service() {
  procd_open_instance
  procd_set_param command /usr/bin/wantasticd connect --config /etc/wantastic/config.conf
  procd_set_param respawn 3600 5 0
  procd_set_param term_timeout 15
  procd_set_param file /etc/wantastic/config.conf
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}
EOF
chmod +x /etc/init.d/wantasticd
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd enable && /etc/init.d/wantasticd start
```

> ./wantasticd version 必须输出版本号。如果输出错误，则该路由器无法运行 wantasticd。

### 大端或 MIPS64

Atheros/QCA ath79、Lantiq 和 Cavium Octeon（EdgeRouter）。普通安装程序会选择正确的版本。

安装并认领:

```sh
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

*检查 CPU 类型: DISTRIB_ARCH 中的 mipsel 表示小端：请使用“小端”选项卡。*

```
$ root@router:~# grep DISTRIB_ARCH /etc/openwrt_release 2>/dev/null || hexdump -s 5 -n 1 -C /bin/busybox
DISTRIB_ARCH='mipsel_24kc'
```

*安装并认领: genkey 打印 Claim URL 和二维码后进入等待。你在控制台中点击 Claim Device 后，它会打印 "Device claimed"。然后按 Ctrl+C 并重启服务。*

```
$ root@router:/tmp# wantasticd genkey
…
…
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@router:/tmp# /etc/init.d/wantasticd enable && /etc/init.d/wantasticd start
```

*Console: Claim Wantastic Device。Claim URL 和二维码会自动填入密钥，你只需点击 Claim Device。*

1. Claim public key 已自动填写
2. Wantastic server 保持默认即可
3. 点击 Claim Device

> **Tip:** 手边没有手机？从终端复制 Claim URL，在任意电脑上打开即可。

## 检查是否正常工作

1. 运行 wantasticd status。它会显示 Status: Connected 和一个 VPN IP。
2. 在控制台中打开 Devices。设备显示为 Online。

检查:

```sh
wantasticd status
```

*wantasticd status: Status: Connected 加上 VPN IP 表示隧道已建立。*

```
$ root@router:~# 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: Devices 窗口：新设备以其名称出现，并在几秒钟内变为 Online。*

1. 按名称搜索
2. 状态显示 Online
3. 覆盖网络 IP 与 wantasticd status 一致
4. Last seen 持续更新

## 管理服务

OpenWrt:

```sh
/etc/init.d/wantasticd restart
/etc/init.d/wantasticd stop
logread -e wantasticd
```

> **Operational note:** 其他固件：参见《BusyBox / 嵌入式 Linux》指南。更新时会保持相同的版本类型，因此 mipsle 路由器会一直使用 mipsle。

## 其他安装方式

仅在自动化或特殊情况下才需要这些方式。上面的快速安装是最简单的方法。

### 使用令牌（多台设备）

当你用脚本安装大量设备，或无人能扫描二维码时，请使用令牌。在控制台中创建一次令牌即可：Account → Secrets → + New Secret → Generate。用它替换 <TOKEN>。

令牌安装:

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

> 像对待密码一样对待令牌。在其过期之前，任何持有它的人都能向你的账户添加设备。

### 手动安装

对于少见的 CPU、离线机器或自定义服务文件，请按照《手动安装 tarball》指南操作。

*Console: Account → Secrets → + New Secret。密钥的值就是令牌。*

1. 打开 Secrets 选项卡
2. 点击 + New Secret
3. 为其命名
4. 点击 Generate
5. 复制新密钥

## Verify the result

- ./wantasticd version 输出版本号（版本与 CPU 匹配）。
- wantasticd status 显示 Status: Connected。
- 路由器在 Devices 中显示为 Online，重启后依然如此。

## Common issues

### 安装程序在下载后立即停止。

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

- **Where:** install.sh
- **Likely cause:** 路由器是小端的，而安装程序下载了大端版本。
- **Fix:** 使用快速安装中的“小端”选项卡。

### 运行二进制文件时输出 shell 错误，而不是版本号。

```
./wantasticd: line 1: syntax error: unexpected "("
```

- **Where:** shell
- **Likely cause:** 版本与 CPU 类型不匹配。
- **Fix:** 使用另一个选项卡（用 mips 代替 mipsle，或反之）。如果两个版本都无法运行，则该路由器无法运行 wantasticd。

### 空间不足。

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

- **Where:** install.sh
- **Likely cause:** 闪存已满。8 MB 闪存的路由器通常装不下 wantasticd。
- **Fix:** 移除不用的软件包，或按照《手动安装 tarball》指南将二进制文件放到 USB 存储上。

检查空间:

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

### 服务一启动就立即停止。

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

- **Where:** 服务日志
- **Likely cause:** 内核 TUN 驱动未加载。
- **Fix:** 加载 TUN 驱动，然后重启服务。

OpenWrt:

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

- **Verify:** ls -l /dev/net/tun 显示该设备。

### 服务无法启动，或反复重启。

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

- **Where:** 服务日志
- **Likely cause:** wantasticd 已安装，但设备尚未认领，因此其配置文件为空。
- **Fix:** 认领设备，然后重启服务。

认领并重启:

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

- **Verify:** wantasticd status 显示 Status: Connected。

### 你已点击 Claim Device，但终端始终没有打印 "Device claimed"。

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

- **Where:** wantasticd genkey
- **Likely cause:** 设备时钟不准确。只有当时钟与实际时间相差在 30 秒以内时，认领才能成功。
- **Fix:** 修正时钟。genkey 会继续等待，并自行完成。

设置一次时间:

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

### status 显示 Running (tunnel down)，或 peers 显示 (server) 为 HANDSHAKE never。

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

- **Where:** 服务日志
- **Likely cause:** 网络阻止了到中心节点（wg.wantastic.app）的出站 UDP 51820 端口，或 DNS 不可用。
- **Fix:** 在防火墙中放行出站 UDP 51820，然后重启服务。

测试 DNS 并重启:

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

- **Verify:** wantasticd peers 显示 (server) 有最近的握手（例如 "8s ago"）。

### 令牌安装在下载后立即失败。

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

- **Where:** install.sh / wantasticd login
- **Likely cause:** 令牌错误、已过期、已用完（达到 Max Uses）或已被删除。
- **Fix:** 不使用令牌，改为认领设备。

改用认领:

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

- **Verify:** 设备出现在 Devices 中并显示为 Online。

## Continue with

- [Install on OpenWrt](https://wantastic.app/zh/docs/install-openwrt): Install wantasticd on an OpenWrt router in 2 minutes over SSH: add the TUN driver, run one wget command, scan a QR code, click Claim Device.
- [Install on BusyBox / embedded Linux](https://wantastic.app/zh/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.
- [Manual tarball install](https://wantastic.app/zh/docs/install-manual): Install wantasticd by hand from the release archive on any Linux CPU (including ppc64, s390x and loong64), claim it with genkey, and add your own service.
- [Choose your install method](https://wantastic.app/zh/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.
- [OpenWrt and embedded device errors](https://wantastic.app/zh/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/zh/docs/errors-installer): Every message the Wantastic installers print when they stop, what it means and the easiest fix.
- [Update, roll back and uninstall](https://wantastic.app/zh/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.
