sh2/d2ypp2/docs/easytier-operations.md
2026-06-02 03:19:23 -05:00

89 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# EasyTier 组网运维记录
EasyTier 可作为 WireGuard 的补充方案,用于 NAT 穿透、P2P 优先连接和 TCP/KCP 兜底。当前生产访问 Neko 优先使用 WireGuard 腾讯云中继;EasyTier 保留为备用和实验链路。
## 适用场景
- 两端 NAT 条件较好,希望优先 P2P 直连。
- WireGuard Endpoint 被运营商或本地代理栈影响,需要另一条覆盖网络。
- 临时排查 Neko、ShellCrash、Windows 远控链路时,作为旁路验证。
不建议把 EasyTier 和 WireGuard 同时承担同一个网段的默认路由。两者共存时,只让其中一个负责 `10.88.0.0/24` 或 Neko 访问网段,另一条链路保持禁用路由或使用不同虚拟网段。
## 推荐参数
优先使用 UDP/P2P,必要时打开 KCP 或 TCP 兜底:
```toml
instance_name = "d2ypp2-neko"
ipv4 = "10.88.0.2"
dhcp = false
listeners = [
"udp://0.0.0.0:11010",
"tcp://0.0.0.0:11010"
]
rpc_portal = "127.0.0.1:15888"
enable_kcp_proxy = true
disable_p2p = false
```
Windows 端使用独立节点名和地址,例如:
```toml
instance_name = "d2ypp2-windows"
ipv4 = "10.88.0.6"
dhcp = false
peers = ["udp://<server>:11010", "tcp://<server>:11010"]
enable_kcp_proxy = true
```
## 端口
建议放行:
- `11010/udp`:P2P 和 UDP 中继。
- `11010/tcp`:TCP 兜底。
- `11011/udp`:如果拆分控制/数据端口,可作为第二监听端口。
如走公网中继,云安全组必须同步放行对应 TCP/UDP 端口。
## 与 ShellCrash 共存
ShellCrash/Mihomo TUN 可能劫持默认路由。EasyTier 只应承担覆盖网段路由,不应抢系统默认路由。出现以下现象时,优先查路由表:
- `ping 10.88.0.2` 延迟突然变成美国出口链路。
- Neko HTTP 可打开但 WebRTC 黑屏。
- ShellCrash 代理检测一直卡住。
排查命令:
```bash
ip route
ip addr
ss -lunpt | grep -E '11010|11011'
```
Windows:
```powershell
route print
Get-NetIPInterface -AddressFamily IPv4
```
## 与 WireGuard 的取舍
WireGuard 优点是内核态、稳定、可控,适合固定 VPS 中继和生产访问。EasyTier 优点是 P2P/NAT 穿透能力强,适合网络条件变化时快速试链路。
当前 Neko 生产建议:
- 主链路:WireGuard 腾讯云中继。
- 备用链路:EasyTier,网段不与主链路抢默认路由。
- WebRTC:`NEKO_WEBRTC_NAT1TO1` 必须填客户端实际可达的 Neko 地址;用 EasyTier 访问时填 EasyTier 地址,用 WireGuard 访问时填 WireGuard 地址。
## 常见故障
- 不能 P2P:检查两端 UDP 是否出站可达,必要时开启 KCP/TCP fallback。
- 能 ping 但 Neko 黑屏:检查 `NEKO_WEBRTC_NAT1TO1` 和 UDP mux/端口段。
- 访问慢:检查是否被本地 TUN 代理绕路;覆盖网络 Endpoint 应走物理网关。
- 代理检测卡住:在 Neko 容器内测试 `curl -x http://host.docker.internal:7890 https://www.youtube.com/`。