Appendix 16. Using command-line tools

Source: Internet
Author: User

Appendix 16. Using command-line tools


In Windows Server Core mode, because there is no graphical interface, you must configure Windows Firewall through the command line.


6.1 Enabling a program

netsh advfirewall firewall add rule name= "My application" Dir=in action=allow program= "C:\MyApp\MyApp.exe" Enable=yes



netsh advfirewall firewall add rule name= "My application" Dir=in action=allow program= "C:\MyApp\MyApp.exe" Enable=yes rem Oteip=157.60.0.1,172.16.0.0/16,localsubnet Profile=domain


6.2 Enabling ports

netsh advfirewall firewall add rule name= "Open Port" Dir=in action=allow protocol=tcp localport=80



6.3 Remove an enabled program or port

netsh advfirewall firewall delete rule name= rule name program= "C:\MyApp\MyApp.exe"

netsh advfirewall firewall delete rule name= rule name protocol=udp localport=500


6.4 Configuring ICMP

netsh advfirewall firewall add rule name= "ICMP allow incoming V4 echo request" Protocol=icmpv4:8,any Dir=in Action=allow

netsh advfirewall firewall add rule name= "all ICMP V4" Protocol=icmpv4:any,any dir=in Action=allow

netsh advfirewall firewall add rule name= "Block Type ICMP V4" Protocol=icmpv4:13,any dir=in Action=block



6.5 Logging Settings

netsh advfirewall set currentprofile logging filename%systemroot%\system32\logfiles\firewall\pfirewall.log

netsh advfirewall set currentprofile logging maxfilesize 4096

netsh advfirewall set currentprofile logging droppedconnections enable

netsh advfirewall set currentprofile logging allowedconnections enable



6.6 Enabling, resetting the firewall

netsh advfirewall set currentprofile state on

netsh advfirewall reset


6.7 Enabling other services

netsh advfirewall firewall set rule group= "Remote Desktop" new Enable=yes



This article from "SQLServer2014 series" blog, declined reprint!

Appendix 16. Using command-line tools

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.