枫叶落
windows高级防火墙命令行操作
2013-12-8 Eagle


1.导出防火墙配置到文件

   netsh advfirewall export c:\zzj.pol



2.导入防火墙配置文件到系统中

   netsh advfirewall import c:\zzj.pol



3.防火墙恢复默认设置

   Netsh advfirewall reset



4.关闭防火墙

  netsh advfirewall set allprofiles state off



5.开启防火墙

  netsh advfirewall set allprofiles state on



6.在所有配置文件中设置默认阻挡入站并允许出站通信:

  netsh advfirewall set allprofiles firewallpolicy blockinbound,allowoutbound



7.删除名为 allow80 的规则:

   netsh advfirewall firewall delete rule name=allow80



8.删除本地端口 80 的所有入则:

   netsh advfirewall firewall delete rule name=all protocol=tcp localport=80



9.添加远程桌面入站规则允许端口1319

   netsh advfirewall firewall add rule name=远程桌面(TCP-In-1319) protocol=TCP dir=in localport=1319 action=allow

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容