ref
- (Windows) 創(chuàng)建出站端口規(guī)則 | Microsoft Learn
- Windows Defender Firewall with Advanced Security (Windows) | Microsoft Learn
- 組策略 Windows) 高級安全性的 Windows 防火墻 (管理 | Microsoft Learn
打開防火墻控制面板
-
windows-itpro-docs/open-windows-firewall-with-advanced-security.md at public · MicrosoftDocs/windows-itpro-docs (github.com)
- 使用高級安全性打開Windows Defender防火墻 (Windows) | Microsoft Learn
- List Of Microsoft Management .MSC Files In Windows (itechtics.com)
- 直接在命令行工具中輸入
wf.msc
- powershell中允許你只輸入
wf
回車啟動
- powershell中允許你只輸入
常用部分
限制某個軟件聯(lián)網(wǎng)
- 主要是限制指定軟件發(fā)送請求(出站請求(outbound Request))來實現(xiàn)組織軟件主動聯(lián)網(wǎng)
- 所謂的
站
(就是主機host,一般可以理解為計算機)
- 所謂的
利用命令行操作
-
Windows Defender Firewall with Advanced Security Administration with Windows PowerShell (Windows) | Microsoft Learn
-
How to Allow or Block or a Program in Windows Firewall (winbuzzer.com)
powershell
- Where is Powershell NetSecurity module? - Stack Overflow
- 防火墻管理功能的NetSecurity模塊似乎只有服務(wù)器版本的windows server powershell
- 個人電腦中是沒有相應(yīng)模塊的
netsh
- Use netsh advfirewall firewall context - Windows Server | Microsoft Learn
權(quán)限說明
- 執(zhí)行防火墻配置,需要管理員權(quán)限
- 因此,您應(yīng)當(dāng)使用管理員方式打開一個終端,以便后續(xù)操作可以順利執(zhí)行
新增防火墻規(guī)則
-
netsh advfirewall firewall add rule ?
-
Usage: add rule name=<string> dir=in|out action=allow|block|bypass [program=<program path>] [service=<service short name>|any] [description=<string>] [enable=yes|no (default=yes)] [profile=public|private|domain|any[,...]] [localip=any|<IPv4 address>|<IPv6 address>|<subnet>|<range>|<list>] .............
-
自行輸入上述命令查閱文檔
-
-
例如:禁止火狐瀏覽器聯(lián)網(wǎng)
-
PS D:\Program Files\Mozilla Firefox> netsh advfirewall firewall add rule dir=out action=block program="D:\Program Files\Mozilla Firefox\firefox.exe" name="blockFirefox" description="createByNetsh" enable=yes Ok.
-
防火墻規(guī)則命名建議
- 通常,不建議建立兩個同名的規(guī)則,應(yīng)為防火墻配置命令是通過規(guī)則名字來區(qū)分規(guī)則,如果同名,可能會造成副作用
查看已有的防火墻規(guī)則
-
Usage: show rule name=<string> [profile=public|private|domain|any[,...]] [type=static|dynamic] [verbose] Remarks: - Displays all matching rules as specified by name and optionally, profiles and type. If verbose is specified all matching rules are displayed. Examples: Display all dynamic inbound rules: netsh advfirewall firewall show rule name=all dir=in type=dynamic Display all the settings for all inbound rules called "allow browser": netsh advfirewall firewall show rule name="allow browser" verbose
-
查看已知的某個具體防火墻規(guī)則配置(比如我想查看名為blockfirefox)的防火墻規(guī)則
-
netsh advfirewall firewall show rule name=blockfirefox
-
Rule Name: blockFirefox ---------------------------------------------------------------------- Enabled: No Direction: Out Profiles: Domain,Private,Public Grouping: LocalIP: Any RemoteIP: Any Protocol: Any Edge traversal: No Action: Block Rule Name: blockFirefox ---------------------------------------------------------------------- Enabled: No Direction: Out Profiles: Domain,Private,Public Grouping: LocalIP: Any RemoteIP: Any Protocol: Any Edge traversal: No Action: Block Ok.
- 上面出現(xiàn)了兩條規(guī)則的詳情,是因為我有兩條規(guī)則重名了
- 通常,如果匹配到多條規(guī)則,就應(yīng)該小心,這種情況下,建議使用
wf.msc
GUI程序修改其中的一條規(guī)則為新的名字
-
-
列舉并查看所有已存在的防火墻規(guī)則配置
-
netsh advfirewall firewall show rule name=all
-
修改已有防火墻規(guī)則
-
例如
-
PS C:\Users\cxxu\Desktop> netsh advfirewall firewall set rule name="blockFirefox" new enable=no Updated 2 rule(s). Ok.
-
利用GUI操作
文檔參考
-
更換語言可以在網(wǎng)址中的
zh-cn
和en-us
修改實現(xiàn)互換 -
Create an Outbound Program or Service Rule (Windows) | Microsoft Learn
-
(Windows) 創(chuàng)建出站程序或服務(wù)規(guī)則 | Microsoft Learn
具體操作
-
-
-
文章來源:http://www.zghlxwxcb.cn/news/detail-783252.html
-
注意,最后一步的名字最好取的清楚一點(只要自己能夠認(rèn)出這個規(guī)則是干什么的就行)文章來源地址http://www.zghlxwxcb.cn/news/detail-783252.html
- 這樣便于找到創(chuàng)建的規(guī)則進行修改/刪除
- 為了便于稱呼,把剛才創(chuàng)建的名字記為RE(上例中RE=blockSublimeText)
取消控制/禁用
- 如果需要回復(fù)被禁止聯(lián)網(wǎng)的軟件,可以回到防火墻出站設(shè)置界面,找到RE,右鍵規(guī)則,進行禁用/啟用規(guī)則
第三方軟件控制
- 例如第三方殺毒軟件或者管家,衛(wèi)士,提供的聯(lián)網(wǎng)控制功能,甚至可以控制分配給每個軟件的帶寬
- 但是可能引入額外的開銷,所以如果追求簡單輕量,使用自帶的防火墻來控制基本的軟件聯(lián)網(wǎng)是不錯的選擇
到了這里,關(guān)于windows@網(wǎng)絡(luò)防火墻@軟件聯(lián)網(wǎng)控制@netsh advfirewall firewall的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!