---
title: "MikroTik / RouterOS 错误 | Wantastic Docs"
description: "所有 [deploy]、[backup] 和 [restore] FAIL 消息，以及 RouterOS 粘贴错误和握手问题。"
url: "https://wantastic.app/zh/docs/errors-mikrotik"
category: "Troubleshooting"
reading_time: "8 分钟"
---

# MikroTik / RouterOS 错误

所有 [deploy]、[backup] 和 [restore] FAIL 消息，以及 RouterOS 粘贴错误和握手问题。

> **Outcome:** 脚本以 "[deploy] step=done — configuration applied" 结束，且路由器处于 Online 状态。

## Before you start

- 具有完整管理员权限的 RouterOS 7。
- 从 Show Config → MikroTik 选项卡获取的最新脚本。

## 开始之前

大多数错误可以通过运行一份新复制的脚本来解决。重复运行始终是安全的。

1. 在 Devices 中，点击路由器的 Show Config 并打开 MikroTik 选项卡。
2. 点击 Copy，粘贴到 RouterOS Terminal 中，然后按 Enter。
3. 如果粘贴出错，点击 Download，将文件拖入 Winbox 的 Files，然后运行 /import file-name=wantastic-overlay.rsc。

- "[deploy] FAIL: …" 行会指出问题所在。
- 如果 RouterOS 因其自身错误而停止，最后一条 "[deploy] step=… attempting" 行显示失败的步骤。
- "[backup] FAIL" 绝不会中断隧道。

## 检查要点

1. 完全没有 [deploy] 行：粘贴出错，或路由器运行的是 RouterOS 6。
2. [deploy] FAIL：修复下文指出的原因，然后重新运行脚本。
3. 部署完成但仍为 Offline：检查 NTP、出站 UDP 51820 和 MTU。

*失败：没有 DNS，随后修复: 设置 DNS 服务器，然后重新运行脚本。*

```
[deploy] step=parse-endpoint host=wg.wantastic.app port=51820
failure: dns server failure
$ [admin@MikroTik] > /ip dns set servers=1.1.1.1,8.8.8.8
$ [admin@MikroTik] > /import file-name=wantastic-overlay.rsc
[deploy] step=done — configuration applied
```

## 速查表

| 错误 | 最简单的修复方法 |
| --- | --- |
| [deploy] FAIL: RouterOS version <v> is too old; v7+ required | 升级到 RouterOS 7。 |
| [deploy] FAIL: … required / endpoint must be host:port | 重新复制脚本，或使用 Download + /import。 |
| [deploy] FAIL: cannot resolve endpoint host <h>; check DNS | /ip dns set servers=1.1.1.1,8.8.8.8 |
| expected end of command / syntax error | Download + /import。 |
| failure: already have such name | 重命名另一个接口。 |
| [backup] FAIL / [restore] FAIL: no … token / saved config | 重新运行完整脚本。 |
| 没有 last-handshake | 启用 NTP；放行 UDP 51820。 |
| Online，但大流量传输卡住 | 将 MTU 设置为 1380。 |

## Verify the result

- 输出 "[deploy] step=done — configuration applied"。
- /interface wireguard peers print detail 显示 last-handshake 在几秒之内。
- 路由器在 Devices 中为 Online。

## Common issues

### RouterOS 版本过旧。

```
[deploy] FAIL: RouterOS version <v> is too old; v7+ required
```

- **Where:** RouterOS 终端
- **Likely cause:** RouterOS 6 不支持 WireGuard。
- **Fix:** 备份配置，升级到 RouterOS 7，然后重新运行脚本。

RouterOS v6:

```routeros
/system backup save name=pre-v7
/system package update set channel=upgrade
/system package update check-for-updates
/system package update install
```

- **Verify:** /system resource print 显示 7.x。

### 无法读取版本号。

```
[deploy] FAIL: cannot parse RouterOS version <v>
```

- **Where:** RouterOS 终端
- **Likely cause:** 版本文本不常见（自定义构建或非常旧的构建）。
- **Fix:** 将 /system resource print 的输出发送至 hello@wantastic.app。不要发送脚本。

RouterOS 终端:

```routeros
/system resource print
```

- **Verify:** 支持团队会回复修复方法。

### 缺少必需的值。

```
[deploy] FAIL: privateKey required
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断。
- **Fix:** 重新复制完整脚本，或使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=validate ok"。

### 缺少公钥。

```
[deploy] FAIL: publicKey required
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断。
- **Fix:** 使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=validate ok"。

### 缺少端点。

```
[deploy] FAIL: endpoint required
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断。
- **Fix:** 使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=validate ok"。

### 缺少地址。

```
[deploy] FAIL: address required
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断。
- **Fix:** 使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=validate ok"。

### 缺少允许的网络。

```
[deploy] FAIL: allowedIPs required
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断。
- **Fix:** 使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=validate ok"。

### 没有管理子网。

```
[deploy] FAIL: allowedIPs has no usable management subnet
```

- **Where:** RouterOS 终端
- **Likely cause:** 脚本被编辑过或已损坏。
- **Fix:** 从 Show Config 复制一份新脚本。不要编辑它。

- **Verify:** "[deploy] step=management-subnet ok subnet=…"。

### 端点格式错误。

```
[deploy] FAIL: endpoint must be host:port
```

- **Where:** RouterOS 终端
- **Likely cause:** 端点值被编辑过或已损坏。
- **Fix:** 从 Show Config 复制一份新脚本。

- **Verify:** "[deploy] step=parse-endpoint host=wg.wantastic.app port=51820"。

### 无法解析端点。

```
[deploy] FAIL: cannot resolve endpoint host <h>; check DNS
```

- **Where:** RouterOS 终端
- **Likely cause:** 路由器没有配置 DNS 服务器。
- **Fix:** 设置 DNS 服务器，然后重新运行脚本。

RouterOS 终端:

```routeros
/ip dns set servers=1.1.1.1,8.8.8.8
:put [:resolve get.wantastic.app]
```

- **Verify:** 第二条命令输出一个 IP 地址。

### 库文件下载失败。

- **Where:** RouterOS 终端（/tool fetch）
- **Likely cause:** 路由器没有 DNS 或无法访问互联网，因此无法下载 https://get.wantastic.app/init.rsc。
- **Fix:** 修复 DNS 和默认路由，然后测试下载。

RouterOS 终端:

```routeros
/ip dns set servers=1.1.1.1,8.8.8.8
/tool fetch url="https://get.wantastic.app/init.rsc" mode=https check-certificate=no
```

- **Verify:** init.rsc（约 25 KB）出现在 Files 中。

### 粘贴时出现语法错误。

```
expected end of command (line X column Y)
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴内容被截断或自动换行。
- **Fix:** 点击 Download，将文件拖入 Winbox 的 Files，然后导入。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc verbose=yes
```

- **Verify:** "[deploy] step=done — configuration applied"。

### 通用语法错误。

```
syntax error
```

- **Where:** RouterOS 终端
- **Likely cause:** 粘贴出错，或路由器运行的是 RouterOS 6。
- **Fix:** 检查版本，然后使用 Download 和 /import。

RouterOS 终端:

```routeros
/system resource print
/import file-name=wantastic-overlay.rsc
```

- **Verify:** 部署完成。

### 命令无法识别。

```
bad command name wireguard
```

- **Where:** RouterOS 终端
- **Likely cause:** 路由器运行的是不支持 WireGuard 的 RouterOS 6。
- **Fix:** 升级到 RouterOS 7。

RouterOS v6:

```routeros
/system package update set channel=upgrade
/system package update install
```

- **Verify:** /interface wireguard print 正常工作。

### 在创建接口时停止。

```
failure: already have such name
```

- **Where:** RouterOS 终端（"[deploy] step=create-wg-iface attempting" 之后）
- **Likely cause:** 已有另一个接口（VLAN、网桥或 EoIP）名为 wg-wantastic。
- **Fix:** 重命名该接口，然后重新运行脚本。

RouterOS 终端:

```routeros
/interface print where name="wg-wantastic"
/interface set [find name="wg-wantastic"] name=wg-wantastic-old
```

- **Verify:** "[deploy] step=create-wg-iface ok"。

### 在创建接口时停止（端口被占用）。

- **Where:** RouterOS 终端（"[deploy] step=create-wg-iface attempting" 之后）
- **Likely cause:** 另一个 WireGuard 接口已占用 UDP 51820。
- **Fix:** 将另一个 WireGuard 接口改用其他端口，然后重新运行脚本。

RouterOS 终端:

```routeros
/interface wireguard print
/interface wireguard set <other-wg> listen-port=13231
```

- **Verify:** "[deploy] step=create-wg-iface ok"。

### 在创建对端时停止。

- **Where:** RouterOS 终端（"[deploy] step=create-wg-peer attempting" 之后）
- **Likely cause:** 脚本中的某个密钥因编辑或自动换行而损坏。
- **Fix:** 使用 Download 和 /import。

RouterOS 终端:

```routeros
/import file-name=wantastic-overlay.rsc
```

- **Verify:** "[deploy] step=create-wg-peer ok"。

### 在地址步骤停止。

- **Where:** RouterOS 终端（"[deploy] step=add-address attempting" 之后）
- **Likely cause:** 相同的覆盖网络地址已存在于另一个接口上。
- **Fix:** 删除重复的地址，然后重新运行脚本。

RouterOS 终端:

```routeros
/ip address remove [find where address="<overlay-ip>/<prefix>" and comment!="WANTASTIC-WG"]
```

- **Verify:** "[deploy] step=add-address ok"。

### 值被拒绝。

```
input does not match any value of …
```

- **Where:** RouterOS 终端
- **Likely cause:** 脚本中的某个值为空或已损坏。
- **Fix:** 从 Show Config 复制一份新脚本。不要编辑它。

- **Verify:** 部署完成。

### 防火墙为空时出错。

```
no such item
```

- **Where:** RouterOS 终端
- **Likely cause:** 旧版本脚本的问题，当前脚本已修复。
- **Fix:** 从 Show Config 复制一份新脚本并运行。

- **Verify:** "[deploy] step=firewall ok"。

### 备份：没有令牌。

```
[backup] FAIL: no backup token (deploy was not called with backupToken=)
```

- **Where:** RouterOS 终端
- **Likely cause:** 部署后路由器重启过，或脚本中没有备份令牌。
- **Fix:** 从 Show Config 重新运行完整脚本。

- **Verify:** "[backup] step=token len=…"。

### 备份：无法读取 WireGuard 密钥。

```
[backup] FAIL: cannot read wg-wantastic public key for peer-bound onboarding
```

- **Where:** RouterOS 终端
- **Likely cause:** 由于部署失败，wg-wantastic 不存在。
- **Fix:** 重新运行完整脚本。必须先部署成功。

- **Verify:** /interface wireguard print 显示 wg-wantastic。

### 备份：设备信息上传失败。

```
[backup] FAIL: separate device information upload failed
```

- **Where:** RouterOS 终端（"[backup] WARN: device-info attempt=N failed" 之后）
- **Likely cause:** 路由器无法通过 HTTPS 访问控制台。
- **Fix:** 从路由器测试 HTTPS，然后重新运行备份。

RouterOS 终端:

```routeros
/tool fetch url="https://console.wantastic.app" output=none check-certificate=no
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=device-info ok"。

### 备份：RouterOS 版本过旧，不支持备份。

```
[backup] FAIL: RouterOS <v> cannot safely chunk large HTTP uploads; upgrade to v7.13+
```

- **Where:** RouterOS 终端
- **Likely cause:** 控制台备份需要 RouterOS 7.13 或更高版本。隧道可以正常工作。
- **Fix:** 升级 RouterOS。

RouterOS 终端:

```routeros
/system package update check-for-updates
/system package update install
```

- **Verify:** "[backup] step=done"。

### 备份：无法读取版本号。

```
[backup] FAIL: cannot parse RouterOS version <v>
```

- **Where:** RouterOS 终端
- **Likely cause:** 版本文本不常见。
- **Fix:** 将 /system resource print 的输出发送给支持团队。

RouterOS 终端:

```routeros
/system resource print
```

- **Verify:** 支持团队会回复修复方法。

### 备份：未创建导出文件。

```
[backup] FAIL: export file was not created
```

- **Where:** RouterOS 终端
- **Likely cause:** 闪存已满。
- **Fix:** 删除 Files 中旧的 .backup、.rsc 或 .npk 文件，然后重试。

RouterOS 终端:

```routeros
/file print
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=export ok bytes=…"。

### 备份：导出文件为空。

```
[backup] FAIL: export file is empty
```

- **Where:** RouterOS 终端
- **Likely cause:** 路由器非常慢，或闪存已满。
- **Fix:** 释放空间，然后重试备份。

RouterOS 终端:

```routeros
:global wantasticBackup; $wantasticBackup
```

- **Verify:** 导出文件包含数据。

### 备份：导出文件过大。

```
[backup] FAIL: export is larger than the 50 MiB upload limit bytes=…
```

- **Where:** RouterOS 终端
- **Likely cause:** 配置非常大（大型地址列表或大量队列）。
- **Fix:** 缩小配置。不支持如此大的备份。

- **Verify:** 修改后备份完成。

### 备份：分块过多。

```
[backup] FAIL: export requires N chunks; maximum is 2048
```

- **Where:** RouterOS 终端
- **Likely cause:** 导出文件过大。"[backup] FAIL: native backup requires N chunks; maximum is 2048" 是原生备份的同类情况。
- **Fix:** 缩小配置。

- **Verify:** 修改后备份完成。

### 备份：分块读取错误。

```
[backup] FAIL: cannot read chunk=… offset=…
```

- **Where:** RouterOS 终端
- **Likely cause:** 读取文件失败。"cannot read native chunk=… offset=…" 和 "native chunk=… is empty" 属于同一情况。
- **Fix:** 重试备份。

RouterOS 终端:

```routeros
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=upload all-chunks ok"。

### 备份：分块上传重试。

```
[backup] WARN: chunk=i/n attempt=k failed
```

- **Where:** RouterOS 终端
- **Likely cause:** 短暂的网络错误，脚本会自动重试。
- **Fix:** 除非最终以 FAIL 结束，否则无需操作。

- **Verify:** 上传完成。

### 备份：分块上传失败。

```
[backup] FAIL: upload failed for chunk=…
```

- **Where:** RouterOS 终端
- **Likely cause:** 链路不稳定，或传输过程中 HTTPS 被阻止。
- **Fix:** 在稳定的链路上重试备份。

RouterOS 终端:

```routeros
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=upload all-chunks ok"。

### 备份：没有加密密码。

```
[backup] FAIL: no native backup encryption password
```

- **Where:** RouterOS 终端
- **Likely cause:** 部署后路由器重启过，或脚本中没有备份令牌。
- **Fix:** 重新运行完整脚本。

- **Verify:** "[backup] step=native-backup attempting" 继续执行。

### 备份：未创建原生备份。

```
[backup] FAIL: native backup file was not created
```

- **Where:** RouterOS 终端
- **Likely cause:** 闪存已满。
- **Fix:** 释放空间，然后重试。

RouterOS 终端:

```routeros
/file print
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=native-upload all-chunks ok"。

### 备份：原生备份大小无效。

```
[backup] FAIL: invalid native backup size bytes=…
```

- **Where:** RouterOS 终端
- **Likely cause:** 备份文件不完整。
- **Fix:** 释放空间，然后重试。

RouterOS 终端:

```routeros
:global wantasticBackup; $wantasticBackup
```

- **Verify:** 原生备份上传完成。

### 备份：原生备份上传失败。

```
[backup] FAIL: native upload failed for chunk=…
```

- **Where:** RouterOS 终端
- **Likely cause:** 上传期间网络故障（之前会先出现 "[backup] WARN: native chunk=i/n attempt=k failed"）。
- **Fix:** 在稳定的链路上重试。

RouterOS 终端:

```routeros
:global wantasticBackup; $wantasticBackup
```

- **Verify:** "[backup] step=done"。

### 恢复：没有已保存的配置。

```
[restore] FAIL: no saved config (deploy must run first)
```

- **Where:** RouterOS 终端
- **Likely cause:** 路由器重启过，已保存的值丢失。
- **Fix:** 从 Show Config 重新运行完整脚本。

- **Verify:** 部署完成。

### 恢复：配置不完整。

```
[restore] FAIL: saved config string is incomplete
```

- **Where:** RouterOS 终端
- **Likely cause:** 已保存的值已损坏。
- **Fix:** 重新运行完整脚本。

- **Verify:** 部署完成。

### 部署后没有 last-handshake。

- **Where:** /interface wireguard peers print detail
- **Likely cause:** 时钟错误、上游防火墙阻止了 UDP 51820，或该脚本属于另一台设备。
- **Fix:** 启用 NTP，放行出站 UDP 51820，并使用此设备对应的脚本。

RouterOS 终端:

```routeros
/system ntp client set enabled=yes servers=pool.ntp.org
/interface wireguard peers print detail
```

- **Verify:** last-handshake 显示为几秒。

### Online，但在 PPPoE 或 LTE 上大流量传输或 Winbox 卡住。

- **Where:** RouterOS
- **Likely cause:** 1420 的 MTU 对该链路来说过大。
- **Fix:** 调低 wg-wantastic 的 MTU。

RouterOS 终端:

```routeros
/interface wireguard set wg-wantastic mtu=1380
```

- **Verify:** Winbox 和大页面加载正常。

## Continue with

- [Connect a MikroTik router (RouterOS 7)](https://wantastic.app/zh/docs/remote-mikrotik): Connect a RouterOS 7 router in two minutes: copy one script from the console and paste it into the router terminal. No package and no open WAN port.
- [RouterOS Dashboard and backups](https://wantastic.app/zh/docs/routeros-dashboard-backups): See a MikroTik router's live state in the console, and back up its configuration to the console.
- [Winbox and RoMON through Wantastic](https://wantastic.app/zh/docs/winbox-romon): Open MikroTik Winbox on any router through winbox.wantastic.app with two tokens, including RoMON to routers behind a gateway.
- [Troubleshooting: start here](https://wantastic.app/zh/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
- [Winbox, WebSSH and WebProxy errors](https://wantastic.app/zh/docs/errors-remote-tools): Console messages when Winbox, WebSSH or the WebProxy browser fail, and the easiest fix for each.
