Get 50% Discount Offer 7 Days


Contact Info

Chicago 12, Melborne City, USA

+88 01682648101

[email protected]

Recommended Services
Supported Scripts
Tutorial Configure Firewall on Windows Server 2016

A firewall generally prevents dangerous attacks on the local network and computer. In simple terms, a wall that prevents fire from moving from one part to another is called a firewall. Generally, a firewall controls the information that is transmitted between computers and the Internet. In this article, we are going to teach you How to Configure Firewall on Windows Server 2016.

What is Firewall?

A Firewall is a network security system that controls and monitors incoming and outgoing network traffic based on predefined security rules. A firewall is a network security device that monitors inbound and outbound network traffic. It protects the network against threats and creates a barrier between a trusted internal network and an unreliable external network such as the Internet. This process is governed by a set of predefined security instructions. It is interesting to know that a Firewall is designed to secure the communication process between different networks. The Firewall prevents unauthorized data from entering computers where ports called ports enter.

How to Configure Firewall on Windows Server 2016

Before starting the steps to configure the firewall, we suggest you visit the Windows VPS and Admin RDP plans provided on our website and configure the firewall after installing Windows Server 2016.

By default, the Windows Firewall with Advanced Security is turned on. Note that you should confirm the current status and turn on the firewall.

To turn on the firewall first, you need to open “Server Manager“, then click on the Tools tab, and then select Windows Firewall with Advanced Security:


windows firewall with advanced security


Now you can check the current status of Windows Firewall profiles from open group policy management and if it was not set to On. You need to click on Windows Firewall properties and turn on the service in each profile:


firewall console


You can permit or block specific input and output network packets on your server and select multiple parameters for each inbound or outbound rule with the help of a Windows Firewall. Windows server profiles include Domain, Private, and Public groups. The Domain represents your server’s connection to a corporate domain network, Private is used to connecting to your home or workplace network, and Public represents insecure public network locations.

How to Open an Inbound Port

First, you need to launch the Windows Firewall with Advanced Security from the Tools sub-menu under Server Manager. Select Inbound Rules from the left panel of the Firewall console. Then click on New Rule under the right sub-menu of Inbound Rules under Actions: 


choose inbound rule on windows server


Now you should select Port in the rule wizard section and then click on Next:


choose port for windows firewall


In this step, you have to choose whether the new rule applies to a TCP or UDP port on the server. Then select your desired ports and enter their number. Also, you can enter ports range or multiple ports separated by – and, respectively, and finally click Next:


choose the port rule for windows firewall


You can use Allow the connection to allow incoming connections to the specified server port.

Allow the connection if it is secure will authenticate with IP security and you can deny or allow the connection. For example, HTTP connections will be allowed and HTTP blocked.

Block the connection will block all incoming connections to your server through the specified port.

In this step, you should select the allow the connection to open port option and then click Next to assign a new rule to the profile:


type of connection in windows firewall


Now select Domain, Private, and Public, or select all to apply the Firewall rule in multiple profiles:


apply the firewall rule in windows server


Remember to give your new firewall rule a name and description. Finally, you should click on Finish to enable the new rule. All connections to the server that match the port are accepted:


choose name for windows server firewall


How to Open an Outbound Port

First, you should go to the Windows Firewall with Advanced Security console and click on Outbound Rules on the left pane. Now you will see a list of available outgoing connection rules. Then, you need to click on New Rule on the right pane under the outbound rules node.


outbound rule on windows firewall


In the next step, you should select Port as the rule type in the new output rule wizard and then click Next:


choose rule type on firewall - Configure Firewall on Windows Server 2016


Next, you have to choose whether the new rule applies to the TCP port or UDP. Select specific remote ports and then enter the port number of the server you want:


choose the port rule for windows firewall


In this step, after selecting Allow the connection on the Action page, you should click Next:


type of connection in windows firewall - Configure Firewall on Windows Server 2016


Then you need to select the Server Profile on which the rule should be enabled:


choose server profile for windows server firewall


Remember to name the new output rule and describe it. Finally, you should click Finish to enable the outbound rule for the target port on all selected server profiles:


choose the name of firewall - Configure Firewall on Windows Server 2016


How to Open a Port through Windows PowerShell

To do this first, you should go to the Windows Start menu and search for PowerShell and open it. Then you have to replace your settings in the following command:

New-NetFirewallRule  -Enabled:True  -LocalPort 21  -Protocol TCP  -Direction Inbound  -Profile Domain  -Action Allow  -DisplayName example opening a port rule"

The words in the above command indicate:

New-NetFirewallRule: It will create a new Firewall rule.

Enabled: It enables the new rule and by default, it will be set to True.

LocalPort: It is your target port number.

Protocol: It specifies the protocol associated with your port number.

Direction: It sets your target direction to either Inbound or Outbound.

Profile: It assigns the new rule to a server profile.

Action: It defines the state for the new firewall rule. You should enter Allow.

DisplayName: It sets a custom name for the new firewall rule.


PS C:\Users\Administrator> New-NetFirewallRule -Enabled:True -LocalPort 21 -Protocol TCP -Direction Inbound -Profile Domain -Action Allow -DisplayName "example opening a port rule"

Name : {427a1b12-ece6-4d54-847d-de482b227c6c}
DisplayName : example opening a port rule
Description :
DisplayGroup :
Group :
Enabled : True
Profile : Domain
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local

That is it!


This article taught you how to configure the Firewall on Windows Server 2016. You can use this article to open a network port on your Windows Server 2016. The server accepts incoming and outgoing connections through selected ports, but the Firewall blocks profile connections that don’t comply with port rules.


Are there any other tools available for managing Windows Firewall?

Yes, you can use a command line provided by Microsoft.

Is it dangerous to turn off Windows Firewall?

It allows all the data packets to enter your network easily and makes it vulnerable to all kinds of Cyber attacks.

Rate this post
Share this Post

Leave a Reply

Your email address will not be published. Required fields are marked *