自動斷網開關詳解
沒有自動斷網開關時,通道中斷通常會使作業系統退回使用實體網路的預設路由,應用程式隨即繼續以明文傳送流量,而且使用者往往渾然不覺。自動斷網開關透過防火牆規則來避免這種情況(例如 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-tw/glossary/kill-switch
術語表 v1.1 · 術語編號 VPNL-G-006 · 最後更新於 。註明出處即可引用本定義;如有錯誤,請依「更正政策」通報。