Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Windows 10 關閉防火牆三種方法:控制台、設定 App、命令列完整教學

編輯:關於 Windows

方法一:控制台傳統介面 (最相容)

  1. 控制台 → 檢視模式:大圖示 → Windows Defender 防火牆。
  2. 左側點擊 「開啟或關閉 Windows Defender 防火牆」。
  3. 分別針對 網域網路、私人網路、公用網路 選擇 「關閉 Windows Defender 防火牆 (不建議)」 → 確定。

方法二:設定 App 現代介面 (Win10 原生)

  1. Win + I 開啟設定 → 更新與安全性 → Windows 安全性 → 防火牆與網路保護。
  2. 點擊目前作用中設定檔 (如「私人網路」) → 將 「Microsoft Defender 防火牆」 切換為 關閉。
  3. 重複對其他設定檔操作。

方法三:命令列/腳本自動化 (適合部署)

# 關閉所有設定檔防火牆 (需系統管理員權限)
netsh advfirewall set allprofiles state off

# 關閉特定設定檔
netsh advfirewall set domainprofile state off
netsh advfirewall set privateprofile state off
netsh advfirewall set publicprofile state off

# 查詢狀態
netsh advfirewall show allprofiles

圖片資訊

控制台Windows Defender防火牆

開啟或關閉防火牆選項

關閉防火牆確認對話框

⚠️ 重要風險警示

  • 關閉防火牆將使裝置直接暴露於網路攻擊 (掃描、滲透、勒索軟體、蠕蟲傳播)。
  • **僅建議在以下情境暫時關閉**:
    ▸ 疑難排解特定應用程式連線問題 (確認為防火牆封鎖後,立即重新啟用並新增允許規則)。
    ▸ 受控測試環境 (隔離網路、無外部連線)。
    ▸ 使用具備防火牆功能的第三方安全套件完全接管防護時 (確認第三方防火牆已啟用並更新)。
  • 完成測試/除錯後,**務必立即重新啟用防火牆**。

替代方案:新增允許規則 (不關閉防火牆)

# 允許特定程式輸出連線
netsh advfirewall firewall add rule name="Allow MyApp" dir=out action=allow program="C:\Path\MyApp.exe" enable=yes

# 允許特定埠入站 (如遠端桌面 3389)
netsh advfirewall firewall add rule name="Allow RDP" dir=in action=allow protocol=TCP localport=3389 enable=yes

精準放行比全關安全得多,建議養成「最小權限原則」管理防火牆規則。

Copyright © Windows教程網 All Rights Reserved