断网保护详解
没有断网保护时,隧道一旦中断,操作系统通常会退回到物理网络的默认路由,应用继续以明文发送流量,而用户往往浑然不觉。断网保护通过防火墙规则(例如借助 Windows 筛选平台、macOS 上的 pf 或 Linux 上的 nftables)来防止这种情况,这些规则只允许流量通过隧道接口以及发往 VPN 服务器本身。
不同实现之间有两点差异,对测试至关重要。其一是范围:应用级断网保护只会终止选定的程序,而系统级断网保护则阻断所有流量。其二是时机:有些客户端仅在检测到中断之后才启用阻断,由此留下了数据包可以逃出的时间窗口;另一些客户端则在 VPN 开启期间始终保持阻断,通常标注为“始终开启”或“严格”。在 Android 上,系统设置中的“始终开启的 VPN”和“屏蔽没有 VPN 的连接”在操作系统层面提供了这一能力;iOS 则为 VPN 应用提供了类似选项(includeAllNetworks),是否使用取决于应用本身。
断网保护可能与强制门户、打印机等本地设备的访问以及拆分隧道发生冲突。为这些情形设置的例外规则,是泄露的常见来源,需要单独测试。
VPN Labs 如何测试
VPN Labs 通过多种方式强制隧道失效,包括终止客户端进程、在上游阻断 VPN 服务器的地址、切换网络,以及让设备挂起和恢复,同时在物理接口上捕获所有流量。只有在全部 20 次运行中,除预先声明允许的本地流量(ARP、邻居发现、DHCP、链路本地名称解析)之外,没有任何数据包在隧道之外离开设备,该场景才算通过。断网保护会在默认设置和最严格模式(即默认配置与加固配置)下分别测试。
各方法论页面是对每项流程的权威描述;本摘要仅供参考。
相关研究
VPN Labs 发布的、深入讨论断网保护的出版物。
-
VPNL-R-2026-003
Kill switches compared: firewall-based vs route-based enforcement
A VPN kill switch stops traffic leaving outside the tunnel while the tunnel is unavailable. Firewall-based designs use default-deny filters that outlive tunnel…
阅读该出版物 -
VPNL-R-2026-001
How DNS leaks happen in VPN clients: a technical taxonomy
A DNS leak occurs when name-resolution traffic leaves a device outside the VPN tunnel, or reaches a resolver the VPN did not designate, while the tunnel is meant to be…
阅读该出版物 -
VPNL-R-2026-005
IPv6 and WebRTC: the overlooked leak paths
IPv6 and WebRTC are the two leak paths most often missed in VPN testing. On dual-stack networks a tunnel that carries only IPv4 leaves IPv6 traffic, and the…
阅读该出版物 -
VPNL-R-2026-006
Reading a VPN security audit report: scope, authorisation and severity
A VPN “security audit” claim is only as informative as its report: what was in scope, who authorised and paid for it, which versions were tested, how findings were…
阅读该出版物
引用本定义
VPN Network Research Labs.(2026). 断网保护. VPN Labs 术语表. https://vpn.com.de/zh-cn/glossary/kill-switch
术语表 v1.1 · 术语编号 VPNL-G-006 · 最后更新于 。定义可在注明出处的前提下引用;如有错误,请依据更正政策报告。