命令行添加防火墙

添加

netsh advfirewall firewall add rule name=BHC禁用TCP端口入站 description=禁止TCP端口进行入站 dir=in action=block protocol=TCP localport=21,23,17,138,139

删除

netsh advfirewall firewall Delete rule name=BHC禁用TCP端口入站

开启防火墙

netsh advfirewall set privateprofile state on
netsh advfirewall set publicprofile state off
set allprofiles - 在所有配置文件中设置属性。
set currentprofile - 在活动配置文件中设置属性。
set domainprofile - 在域配置文件中设置属性。
set global     - 设置全局属性。
set privateprofile - 在专用配置文件中设置属性。
set publicprofile - 在公用配置文件中设置属性。

 打开windows防火墙设置界面

 firewall.cpl

猜你喜欢

转载自www.cnblogs.com/wuyuan2011woaini/p/10455564.html
今日推荐