To configure Windows firewall from the command line

Source: Internet
Author: User

To configure Windows firewall from the command line

Advanced users can use the command line to configure Windows firewall. You can use the Netsh command-line tool to configure.

The Netsh commands in the following table are available for Microsoft Windows XP Service Pack 2 (SP2). Type the netsh command and the "/?" The Help for this command is displayed.

ADD

netsh firewall add allowedprogram adds the allowed program configuration to Windows Firewall

netsh firewall add portopening Adding a port configuration to Windows Firewall

Delete

netsh firewall delete allowedprogram remove allowed program configuration from Windows Firewall

netsh firewall delete portopening remove port configuration from Windows Firewall

Reset

netsh firewall reset resets the Windows firewall configuration to the default configuration

Set

netsh firewall set allowedprogram editing the Allow program configuration in Windows Firewall

netsh firewall set icmpsettings edit ICMP configuration in Windows Firewall

netsh firewall set logging edit logging configuration in Windows Firewall

netsh firewall set notifications edit notification configuration in Windows firewall

netsh firewall set opmode edit operation configuration in Windows Firewall

netsh firewall set portopening edit port configuration in Windows Firewall

netsh firewall set service edit Services configuration in Windows Firewall

Show

netsh firewall show allowedprogram shows the allowed program configuration in Windows Firewall

netsh firewall show config displays Windows firewall configuration

netsh firewall show currentprofile Displays the current configuration file for Windows firewall

netsh firewall show icmpsettings shows the ICMP configuration in Windows Firewall

netsh firewall show logging shows the logging configuration in Windows Firewall

netsh firewall show notifications Show notification configuration in Windows firewall

netsh firewall show opmode shows the operation configuration in Windows Firewall

netsh firewall show portopening shows the port configuration in Windows Firewall

netsh firewall show service shows the configuration of services in Windows firewall

netsh firewall show state displays the current status of Windows firewall

Attention

    • Windows Firewall does not support setmachine,set online,set offline , and Dump commands, and these commands do nothing.
    • The show command typically displays only locally configured settings. Group Policy settings are displayed only in the display state.

http://tcshare.org/%E4%BB%8E%E5%91%BD%E4%BB%A4%E8%A1%8C%E9%85%8D%E7%BD%AEwindows%E9%98%B2%E7%81%AB%E5%A2%99/

To configure Windows firewall from the 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.