Skip to content
Skills Library
DevOps & cloud · Analysis

macos-network-drop-triage

/macos-network-drop-triage

排查 macOS 上「经常断网、网络时好时坏、手机端看不到这台电脑(WorkBuddy/远程控制/局域网设备显示离线)」的问题。定位隧道类工具(Cloudflare WARP / Clash TUN / Tailscale / 各类 VPN)劫持默认路由与 DNS 的病因,并用网关 vs 外网对比测试区分「无线问题」和「出口问题」。当用户说「经常断线」「老是离线」「网络不稳定」「手机上看不到我的电脑」「网络一会儿好一会儿断」时使用。

Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

排查 macOS 上「经常断网、网络时好时坏、手机端看不到这台电脑(WorkBuddy/远程控制/局域网设备显示离线)」的问题。定位隧道类工具(Cloudflare WARP / Clash TUN / Tailscale / 各类 VPN)劫持默认路由与 DNS 的病因,并用网关 vs 外网对比测试区分「无线问题」和「出口问题」。当用户说「经常断线」「老是离线」「网络不稳定」「手机上看不到我的电脑」「网络一会儿好一会儿断」时使用。

Original author description

排查 macOS 上「经常断网、网络时好时坏、手机端看不到这台电脑(WorkBuddy/远程控制/局域网设备显示离线)」的问题。定位隧道类工具(Cloudflare WARP / Clash TUN / Tailscale / 各类 VPN)劫持默认路由与 DNS 的病因,并用网关 vs 外网对比测试区分「无线问题」和「出口问题」。当用户说「经常断线」「老是离线」「网络不稳定」「手机上看不到我的电脑」「网络一会儿好一会儿断」时使用。

How it works

  1. 核心判断原则
  2. 排查顺序(照抄执行)
  3. 各工具的特征与处置
  4. ⚠️ 踩坑记录
  5. 面向「手机端看不到这台电脑」的额外检查
  6. 根治原则
Original SKILL.md headings · 110 lines, 419 words
SKILL.md preview
---
name: macos-network-drop-triage
description: 排查 macOS 上「经常断网、网络时好时坏、手机端看不到这台电脑(WorkBuddy/远程控制/局域网设备显示离线)」的问题。定位隧道类工具(Cloudflare WARP / Clash TUN / Tailscale / 各类 VPN)劫持默认路由与 DNS 的病因,并用网关 vs 外网对比测试区分「无线问题」和「出口问题」。当用户说「经常断线」「老是离线」「网络不稳定」「手机上看不到我的电脑」「网络一会儿好一会儿断」时使用。
agent_created: true
---

# macOS 断网 / 离线排查

## 核心判断原则

**先分清是「无线链路问题」还是「出口链路问题」——两者修法完全不同,别一上来就折腾 Wi-Fi。**

判定方法就是两条 ping 的对比:

| 现象 | 结论 |
|---|---|
| 网关丢包 / 高延迟 | **无线链路问题** → 查信道干扰、信号、网线 |
| 网关 0 丢包且 <5ms,但外网丢包/高延迟 | **出口问题** → 查隧道/VPN/DNS 劫持(见下) |

## 排查顺序(照抄执行)

```bash
# 1. 有几个默认路由?(最关键的一步)
netstat -rn -f inet | grep "^default"
#    ✅ 只应有 1 条,指向 en0/en1
#    ❌ 出现第 2 条走 utun* → 有隧道工具在劫持全网流量

# 2. DNS 被谁接管了?
scutil --dns | grep -m3 nameserver
#    ✅ 192.168.x.x(路由器)或 223.5.5.5 / 119.29.29.29
#    ❌ 127.0.2.2 / 127.0.2.3   → Cloudflare WARP
#    ❌ 100.100.100.100         → Tailscale
#    ❌ 127.0.0.1 / 127.0.0.53  → 本地代理(Clash TUN 等)

# 3. 当前在用哪个接口?
ifconfig -a | grep -B1 "status: active"
route -n get default | grep -E "interface|gateway"

# 4. 网关 vs 外网对比测试(各 15–30 秒)
ping -c 30 -i 0.5 192.168.x.1     # 网关
ping -c 30 -i 0.5 223.5.5.5       # 国内 DNS,正常应 <15ms

# 5. 谁在跑隧道/代理?
ps aux | grep -iE "warp|cloudflare|tailscale|clash|mihomo|sing-box|v2ray|xray|openvpn|wireguard" | grep -v grep
```

## 各工具的特征与处置

### Cloudflare WARP(最常见的元凶)

特征:
- DNS = `127.0.2.2` / `127.0.2.3`(本地 DNS 代理)
- 多一条 `default link#NN UCSIg utun*`
- 网卡被伪造 IPv6,形如 `2606:4700:110:...`
- 国内目标延迟劣化到 200–400ms,丢包 10–40%

```bash
# 看状态(注意:直接调 App 内的二进制可能挂住,用 /usr/local/bin/warp-cli)
warp-cli status          # Connected + Warp 模式 + MASQUE = 在替所有流量兜圈子
warp-cli settings        # 看 Always On / Mode / exclude 列表
warp-cli disconnect      # 先断开验证病因(路由 DNS 应立刻恢复)
```

**彻底卸载**(官方自带脚本,逻辑干净,只清自己的东西):

```bash
sudo "/Applications/Cloudflare WARP.app/Contents/Resources/uninstall.sh" -f
# 它会:杀 GUI → 删注册 → unload+删 daemon/updater 两个 plist
#       → 删钥匙串密钥 → 删 App → 删 /Library/Application Support/Cloudflare 与 ~/Library/Logs/Cloudflare
sudo rm -f /usr/local/bin/warp-cli   # ⚠️ 脚本不会删这个软链,会留下死链
```

卸载后验收:`netstat -rn -f inet | grep "^default"` 只剩 1 条;`scutil --dns` 恢复正常。

### Clash Verge / mihomo TUN

- `tun.enable: true` 才会劫持;`false` 时不影响路由(可看
  `~/Library/Application Support/io.github.clash-verge-rev.clash-verge-rev/config.yaml`)
- 系统代理是否开启:`networksetup -getwebproxy Wi-Fi`
- 与 WARP **不要同时开**;两者都想抢默认路由时会互相打乱。

### Tailscale

- DNS 特征 `100.100.100.100`;接口 `utun*` 地址为 `100.x.x.x`
- 状态:`scutil --nc list`

## ⚠️ 踩坑记录

- **别用 App 内的二进制当 CLI**:`/Applications/Tailscale.app/Contents/MacOS/Tailscale status` 会挂住不返回
  (会拉起 GUI)。用 `/usr/local/bin/tailscale` 或带 `timeout` 包裹。
- **`~/Library/Application Support/com.cloudflare.1dot1dot1dot1.macos/` 里的日志文件(root 属主)
  在沙箱环境可能读不到**(`ls` 能列出但 `cat` 报 No such file)。别在这上面耗时间,直接看路由/DNS 就够定性。
- **`pmset -g log | grep Sleep` 可能返回空**,别据此判断"没睡眠";以 `pmset -g` 里的
  `sleep` 值为准(`0` = 永不休眠)。
- **Mac mini 的有线口常常空着没用**:`en0` 显示 `status: inactive` 就是没插网线,
  此时上网走 `en1`(Wi-Fi)。想更稳就插网线,但**如果网关 ping 是 0 丢包,插网线并不能解决断网**,别误判方向。
- **`ipconfig getpacket en1` 的 `lease_time` 是十六进制**(`0xa8c0` = 43200 秒 = 12 小时),别当十进制读。

## 面向「手机端看不到这台电脑」的额外检查

如果问题表现为手机 App(如 WorkBuddy「我的 Buddy」)里电脑显示离线:

```bash
lsof -nP -iTCP -a -c WorkBuddy | grep -v "127.0.0.1"
```

- 源地址是 `2606:4700:...` 之类**海外/伪造 IPv6** → 云端心跳被隧道拖死,长连接会断
- 出现 `CLOSE_WAIT` → 连接已经死了但进程还攥着,界面就会显示离线
- 修复后应看到**国内 IPv4 + ESTABLISHED**,此时手机端会自行恢复

## 根治原则

**同一时间只允许一个工具接管默认路由。** 代理统一用一个工具(如 Clash Verge `127.0.0.1:7897`),
不要在系统里叠两套隧道。修完后记得写进设备档案,防止下次又装回来。

Versions

The database has no other skills named macos-network-drop-triage.

Database snapshot: 13.11.2026 · package version e5220ce474a8 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90clash-doctor
    Clash Verge 与 mihomo 诊断和 profile 管理。当用户遇到代理失败、需要配置 AI 工具路由、本地 Hub 拓扑、多机对齐、TUN 绕过、克隆或切换订阅,或同步后 配置未生效时使用。进程线路使用 clash-routes,出口 IP 质量使用 ip-check。 普通网络测速不使用。
  • 100privacy-fortress
    系统审计并加固 Windows、macOS、Linux、Android 和 iOS 的网络隐私与最小信息暴露面。覆盖 30 项防护台账、Mihomo/Clash 或 sing-box 网关、TUN 与规则顺序、DoH-over-proxy、DNS/IPv6/UDP/WebRTC 泄漏、exe/MSIX fail-closed、浏览器分边、Android Always-on/锁死/分应用、iOS On Demand/includeAllNetworks 边界、上游可见性、回退与巡检。Use when the user asks for privacy…
  • 95lov-clash-tun-doctor
    Diagnose and repair application connectivity failures caused by Clash Verge Rev TUN routing, rule precedence, stale runtime state, proxy timeouts, or unusable IPv6 paths. Trigger for symptoms such as WeChat images failing to send, Moments images loading slowly, an app hanging…
  • 90Clash 控制器
    通过 Clash / mihomo RESTful API 实时监控和控制 Clash(含 Clash.Meta / mihomo 内核)。支持状态/连接/流量/规则查询、节点与策略组切换、节点测速、DNS 查询、配置重载。当用户提到 Clash、mihomo、切换节点、查看连接、实时流量、规则匹配、节点测速、Clash 控制器时使用。
  • 100optimize-network
    Safely diagnose and improve local network speed, latency, jitter, DNS, Wi-Fi, Ethernet, macOS network services, and bufferbloat. Use this skill whenever the user asks to optimize internet/network speed, make the network faster, diagnose slow Wi-Fi, latency, packet loss, DNS…
  • 100network-operations
    Use when connections fail or hang — connection refused vs timed out (timeouts), wrong IPs or ports, no route to host, network unreachable, EPERM to a Service, MTU stalls, blocked SMTP/egress, firewall/NSG rules, VPN tunnels (WireGuard/Tailscale/IPsec). ACL policy →…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.