Would you like to learn how to open a TCP port on the Windows Firewall using the command-line? In this tutorial, we are going to show you how to use the command-line to create a firewall rule to open a port on Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Windows Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Windows.

Tutorial Firewall - Open a TCP port using the command-line

As an Administrator, start an elevated command-line.

Windows - Elevated command prompt

Create a firewall rule to open a TCP port.

Copy to Clipboard

Verify the created firewall rule.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, we created a firewall rule to allow the input on the TCP port 80 using the command-line.

Create a firewall rule to allow the input to multiple TCP ports.

Copy to Clipboard

Verify the created firewall rule.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, we created a firewall rule to open multiple TCP ports using the command-line.

Congratulations! You are able to create a firewall rule to open a TCP port using the command-line on Windows.