Configure Windows Firewall under command line

Source: Internet
Author: User

Command: netsh firewall

Parameters:

        ? // 显示命令列表

  add // 添加防火墙配置

  delete // 删除防火墙配置

  dump // 显示一个配置脚本

  help // 显示命令列表

  reset // 将防火墙配置重置为默认值。

  set // 设置防火墙配置

  show // 显示防火墙配置

  add allowedprogram // 添加防火墙允许的程序配置。

  add portopening // 添加防火墙端口配置

  delete allowedprogram // 删除防火墙允许的程序配置

  delete portopening // 删除防火墙端口配置

  set allowedprogram // 设置防火墙允许的程序配置

  set icmpsetting // 设置防火墙 ICMP 配置

  set logging // 设置防火墙记录配置

  set multicastbroadcastresponse // 设置防火墙多播/广播响应配置

  set notifications // 设置防火墙通知配置

  set opmode // 设置防火墙操作配置

  set portopening // 设置防火墙端口配置

  set service // 设置防火墙服务配置

  show allowedprogram // 显示防火墙允许的程序配置

  show config // 显示防火墙配置。

  show currentprofile // 显示当前防火墙配置文件

  show icmpsetting // 显示防火墙 ICMP 配置

  show logging // 显示防火墙记录配置

  show multicastbroadcastresponse // 显示防火墙多播/广播响应配置

        show notifications // 显示防火墙操作配置

  show opmode // 显示防火墙端口配置

  show portopening // 显示防火墙端口配置

  show service // 显示防火墙服务配置

  show state // 显示当前防火墙状态 

For example:

        netsh firewall show allowedprogram //查看防火墙放行的程序

  netsh firewall set portopening TCP 445 ENABLE //打开445端口

  netsh firewall set portopening TCP 3389 ENABLE //不用说了,放行终端啦。。

  netsh firewall delete allowedprogram C:\qq.exe //删除放行程序qq.exe

  netsh firewall set allowedprogram C:\qq.exe A ENABLE //添加程序C盘下的qq.exe并放行

  netsh firewall add allowedprogram C:\qq.exe A ENABLE //添加程序C盘下的qq.exe并放行



Www.keread.com

Configure Windows Firewall under command line

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.