Help and Support
 

powered byLive Search

HOWTO: Adding a new rule for the Vista firewall using 'Netsh' command.

Author: Hirotaka Mieda MVP
Article ID:555914
Last Review:April 17, 2007
Revision:1.0
On This Page

SUMMARY

Windows Vista has the firewall with advanced security. This firewall can control both inbound connections and outbound connections. You can use 'netsh advfirewall' context to add, modify, and delete rules for this new firewall feature.

Back to the top

Tips

Adding the new rule which allows the specific executable file to receive inbound connections, using 'Netsh advfirewall' context.

To do so, do the following command:  
 
netsh advfirewall firewall add rule name="New_Inbound_Rule" dir=in action=allow program=<The Path for the executable> description="This is the new rule for the executable"

 
This creates the new rule named "New_Inbound_Rule" which allows the specific program to receive the inbound connection.

Back to the top

Back to the top

Adding the new rule which disables the specific remote port to be used for the outbound connection.

To do so, do the following command:
 
netsh advfirewall firewall add rule name="Outbound_HTTP_Block" dir=out action=block protocol=tcp remoteport=80

 
This creates the new rule named "Outbound_HTTP_Block" which disables outbound connections for the remote port TCP 80.

Back to the top

Back to the top

Confirm that the rules you created have been registered correctly.

You can also use MMC console with the [Windows Firewall with advanced security] snap-in to confirm, add, modify, and delete firewall rules.
 

Back to the top


APPLIES TO
Windows Vista Business
Windows Vista Ultimate 64-bit Edition
Windows Vista Business 64-bit Edition
Windows Vista Enterprise
Windows Vista Enterprise 64-bit Edition
Windows Vista Ultimate

Back to the top

Community Solutions ContentCOMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.