How to use commands to manage Windows 7 Desktop Firewall

Source: Internet
Author: User
(1) Enable the Desktop Firewall Netsh advfirewall set allprofiles state on (2) set the Default Input and Output policies Netsh advfirewall set allprofiles firewallpolicy allowinbound, allowoutbound The above is set to allow, if set to deny the use of blockinbound, blockoutbound (3) disable TCP port 139 Netsh advfirewall Firewall add rule name = "Deny tcp 139" dir = in Protocol = TCP localport = 139 action = block (4) Disable UDP port 139. Netsh advfirewall Firewall add rule name = "Deny UDP 139" dir = in Protocol = UDP localport = 139 action = block (5) disable TCP port 445 Netsh advfirewall Firewall add rule name = "Deny TCP 445" dir = in Protocol = TCP localport = 445 action = block (6) Disable UDP port 445. Netsh advfirewall Firewall add rule name = "Deny UDP 445" dir = in Protocol = UDP localport = 445 action = block (7) use the same method to disable TCP ports 21, 22, 23, 137, 138, 3389, 5800, and 5900. Netsh advfirewall Firewall add rule name = "Deny tcp 21" dir = in Protocol = TCP localport = 21 action = block Netsh advfirewall Firewall add rule name = "Deny TCP 22" dir = in Protocol = TCP localport = 22 action = block Netsh advfirewall Firewall add rule name = "Deny TCP 23" dir = in Protocol = TCP localport = 23 action = block Netsh advfirewall Firewall add rule name = "Deny TCP 3389" dir = in Protocol = TCP localport = 3389 action = block Learning computer Netsh advfirewall Firewall add rule name = "Deny TCP 5800" dir = in Protocol = TCP localport = 5800 action = block Netsh advfirewall Firewall add rule name = "Deny TCP 5900" dir = in Protocol = TCP localport = 5900 action = block Netsh advfirewall Firewall add rule name = "Deny TCP 137" dir = in Protocol = TCP localport = 137 Action = block Netsh advfirewall Firewall add rule name = "Deny TCP 138" dir = in Protocol = TCP localport = 138 action = block (8) paused after execution Pause EchoPress any key to exit 2. Restore Initial Configuration (1) restore the initial firewall settings Netsh advfirewall Reset (2) disable the Firewall Netsh advfirewall set allprofiles state off
Related Article

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.