Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 7 VPN 連線錯誤 800 解決:防火牆/防毒干擾、埠 1723 TCP 視窗大小、重新設定 VPN 主機

編輯:Windows 7 系統介紹

Windows 7 建立 VPN (PPTP/L2TP) 連線出現「錯誤 800:無法建立網路連線」,常見原因:本機防火牆/防毒封鎖 GRE 協定 (IP 47) / TCP 1723、路由器未開啟 PPTP 穿透、VPN 伺服器設定錯誤。

標準排查與修復步驟

  1. 暫時關閉本機防火牆/防毒軟體測試:
    控制台 →「Windows 防火牆」→「關閉」 (僅測試用) → 關閉第三方防毒即時防護 → 嘗試連線 VPN。
    若成功 → 為防火牆/防毒規則問題,需精準開放而非永久關閉。
  2. 精準開放防火牆規則 (管理員命令列):
    `netsh advfirewall firewall add rule name="VPN PPTP TCP 1723" dir=in action=allow protocol=TCP localport=1723`
    `netsh advfirewall firewall add rule name="VPN GRE Protocol" dir=in action=allow protocol=47`
    `netsh advfirewall firewall add rule name="VPN PPTP TCP 1723 Out" dir=out action=allow protocol=TCP localport=1723`
    `netsh advfirewall firewall add rule name="VPN GRE Protocol Out" dir=out action=allow protocol=47`
  3. 調整 TCP 1723 視窗大小 (登錄):
    部分網路設備對 PPTP 控制連線視窗大小檢查嚴格,導致連線失敗。
    `reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v TcpWindowSize /t REG_DWORD /d 0 /f`
    重開機生效。(將視窗大小設為 0 讓系統自動調整/停用縮放視窗檢查)
  4. 檢查路由器/閘道設定:
    ① 開啟「PPTP 穿透」/「VPN 穿透」/「IPsec 穿透」 (L2TP/IPsec 需)。
    ② 連接埠轉發:外部 TCP 1723 → 內部 VPN 伺服器 IP:1723。
    ③ 防火牆規則允許 GRE 協定 (IP 47) 雙向通過。
  5. 重新設定 VPN 主機端 (伺服器端):
    Windows Server RRAS / 軟體路由器 / 硬體防火牆 VPN 設定 → 確認使用者帳號「允許遠端存取」→ IPv4 位址池未耗盡 → 驗證協定 (MS-CHAP v2) 正確 → 重啟 RRAS 服務。

進階診斷指令

:: 檢查本機 TCP 1723 是否監聽
netstat -an | findstr :1723

:: 檢查 GRE 協定是否被防火牆封鎖 (需 Wireshark 抓包分析)
:: 客戶端發送 PPTP 控制封包 (TCP 1723) → 伺服器回應 → 客戶端發送 GRE 封包 → 若無後續 → GRE 被封鎖

:: 查看 VPN 連線詳細錯誤 (事件檢視器)
eventvwr.msc → Windows Logs → System → 來源: RasClient / RasMan / Event ID: 20226, 20227

替代方案:改用 L2TP/IPsec 或 SSTP/IKEv2

  • PPTP 加密弱 (MS-CHAP v2 可暴力破解)、GRE 協定易被封鎖/NAT 穿透失敗。
  • L2TP/IPsec:UDP 500/4500 + ESP (IP 50),較易穿透 NAT,需預先共用金鑰/憑證。
  • SSTP (Secure Socket Tunneling Protocol):TCP 443 (HTTPS),幾乎不被封鎖,需憑證,Win7/Vista/Server 2008+ 原生支援。
  • IKEv2:UDP 500/4500,支援 MOBIKE (行動裝置切換網路不斷線),Win7 需熱修補 KB2592687 或升級 Win10+。
Copyright © Windows教程網 All Rights Reserved