Check all ports for openness. How to check for TCP connections (open ports on a Windows computer)

Now we will deal with the question of what open ports are. This issue should be sorted out if Internet traffic begins to “suddenly go away” into the unknown. First of all, you should look at where, what program and what exactly it uses. Based on such information, the situation can be corrected.

Network Applications

There is a situation when an application that uses the network to run does not want to work. If so, it is worth which program uses for its own work. Situations when you need to find out the list of open ports occur quite often.

To view the list, you must use either a third-party or a standard utility for Windows and Linux operating systems: netstat. It is launched from the usual command line. First, call the command line. This can be achieved in two ways. For the first option, go to the Start menu and click on Run.

In the window that appears, enter “cmd”, then press “Enter”. Another method is to launch the required command line “with your own hands”, that is, by going to the “System32” folder, use the “cmd.exe” program.

Netstat

To find out which ones, in the next step we run the “netstat” utility. To do this, enter “netstat” into the command line that you launched earlier, then press “Enter”.

Those users for whom this information is not enough can access the capabilities of this utility by running it with the special switch -h, in other words, try entering “netstat -h” into the command line. If you use the “netstat -b” switch, the utility will show open ports, as well as applications that use these ports for their own work.

There is another useful key “netstat 5”. If you use it, you will see not only open ports, but also the ability to stream information updates, new data will be displayed every 5 seconds. To stop the appearance of information with the specified key, you must use the keyboard shortcut “Ctrl+C”.

Studying the information received

The command prompt window will show open ports. It will look like this: directly divided into 4 parts. The left column will display the protocol name, the second - the domain, and after the colon the open port itself, the third part - the external address, the fourth - the state.

Opening ports on Windows

Next we'll look at Windows. Users can perform the operation of opening ports on Windows 7 and Vista by using standard tools of the operating system itself without using special software from third-party developers.

Click the “Start” button to bring up the main menu of the system, go to the “Control Panel” item in order to initiate the procedure for opening ports in the Windows firewall.

Select the “Security” item and go to the “Windows Firewall” section. Select the item called “Advanced options”, which is located on the left side of the application window. After this, enter the administrator password. It must be entered in the appropriate field after the authorization window appears.

Expand the link that talks about allowing the program to run through the Windows Firewall, and select the section about the rules for incoming connections. We indicate the item called “Create a rule”, run the “Add port” function to perform the operation of opening the specified port. Click the “Next” button and enter a name that allows you to associate the specified open port.

For this purpose, a corresponding “Name” field is provided. Enter the number of the selected port in the corresponding “Port” field and click the “Next” button. We indicate the desired one (can be TCP or UDP) in the next one, which is dedicated to ports and protocols. Apply the checkbox for the “Allow connection” item by moving to the next “Actions” window.

Final stage

Apply the checkboxes for all the fields in the next dialog box called “Profile”, click the “Done” button to apply the selected changes. Click the button called “Change Scope” to select the option for the number of computers that have permission to use the selected port. Specify the required value.

We repeat the above procedures for each of the ports that are to be opened. Reboot the computer to apply the selected changes. It should be remembered that the described algorithm of actions will allow you to open ports only in the firewall of a personal computer, but is not related in any way to the permissions of a specific Internet connection provider.

To solve such problems, you need to contact a representative of your provider company directly. When connecting to the Internet, the system allocates ports to programs that work with the network through which data is received and sent. Ports can be not only open, but also closed.

Sometimes a user has a situation when it is necessary to open one or another computer port for video games, complex programs or special Internet clients. But how can you check if this port is currently open? There are several options for solving such problems.

I. CHECKING OPEN PORTS ON A LOCAL COMPUTER

Method 1. In order to check open ports on your local (your) computer, you can use the “Command Line” of the Windows operating system (

To call this line, you need to press the Win+R key combination and enter the “cmd” command, then click “OK”.

In the window that opens, enter the special command “netstat -a” and read the list of open ports on your computer.

Method 2. If you are connected to the Internet, you can check if the port is open on the website

whatsmyip.org/port-scanner/

This resource will determine your IP address itself, and you can scan ports through a special field “ Custom Port Test».

Enter the port you are interested in and click the " Check Port", after which you will receive an answer whether this port is open or closed.

II. CHECKING OPEN PORTS ON A REMOTE COMPUTER

Now let's look at how to check if a port is open on a remote computer or server. Use the same “Command Line” in Windows, but now write the telnet command in the format:

telnet IP address port

Press the Enter key. If there is no “Could not open...” entry, then the requested port is open, otherwise it is closed.

We briefly looked at how to check if a port is open on a computer. If you have any questions, please ask them in the comments field.

What does the port check result mean?

Status Port closed

It is not possible to connect to this port at this time. Malicious programs or attackers cannot use this port to attack or obtain confidential information (the material 4 best free antiviruses for Windows 10 will help you). If all unknown ports have the “closed” status, this means that the computer is well protected from network threats.

If the port should be open, then this is a bad indicator. The reason for the unavailability of the port may be incorrect configuration of the network hardware or software. Check the program's network access rights in the firewall. Make sure the ports are forwarded through the router.

The "port closed" result can also be obtained if the port is open, but your computer's network response time (ping) is too high. It is practically impossible to connect to the port in such conditions.

Status Port is open

You can connect to this port; it is accessible from the Internet. If that's what you need, great.

If the reason why the port may be open is unknown, then it is worth checking the running programs and services. Perhaps some of them quite legally use this port to work with the network. There is a possibility that the port is open due to the operation of unauthorized/malware software (the material How to enable protection against potentially unwanted programs in Windows Defender will help you). In this case, it is recommended to scan your computer with an antivirus.

F.A.Q.

What kind of ports? What are they needed for?

The ports that PortScan.ru checks are not physical, but logical ports on a computer or network device.
If a program or service plans to work with a network, it opens a port with a unique number through which it can work with remote clients/servers. In fact, the network program reserves a certain number for itself, which allows you to understand that the incoming data is intended specifically for this program.

In human language it would sound something like this: “I, the server program, open port number 1234. If data with port number 1234 arrives via the network cable, this is for me.”

What port numbers can the program open?

Ports are identified by numbers from 0 to 65535 inclusive. Any other port cannot be opened, and therefore cannot be checked either. These are limitations of the TCP/IP protocol.

It is worth noting that the client program must always know the port number to which it needs to connect on the server or other remote network device. For this reason, ports in the range from 0 to 1023 are reserved for the most popular protocols.

So, for example, when surfing the Internet, your browser connects to port 80 on the remote server on which the site is located. In response, the browser receives a set of code and data, which it downloads and displays as a web page.

For what situations is it possible to check open ports?

Checking open ports is possible if your computer is assigned an external IP address. You can find out more about this from your Internet service provider.

It is worth considering that if your computer is connected to the Internet not directly, but through a router (router), then the test results apply specifically to the router. It is possible to check the port status of a computer inside such a subnet only if port forwarding is available.

What is port forwarding?

Port Forwarding (sometimes Virtual Servers) is a special setting on the router that allows you to redirect external requests (from the Internet) to computers on the local network. Essentially, this is a way to specify which local computer to forward data and connection requests that come on a specific port.

Let's say you have a gaming or web server at home, connected via a router to the Internet. All computers connected to the same router are on the same network, so they will be able to connect to this server. However, from the outside, from the Internet, it will no longer be possible to connect to your server without port forwarding.

If your computer is connected to the Internet directly (without a router), then port forwarding is not required. All your open ports must be accessible from the Internet (with a dedicated IP, of course).

How can I find out which ports are open on my computer?

For Windows: Start → "cmd" → Run as administrator → "netstat -bn"
For Linux: In the terminal, run the command: "ss -tln"

How to close a port?

First of all, you need to eliminate the cause - the running program or service that opened this port; it needs to be closed/stopped. If the reason for an open port is not clear, check your computer with an antivirus, remove unnecessary port forwarding rules on the router and install an advanced firewall.

The popular question “how to check if a port is open” is relevant for both experienced gamers and novice system administrators. Accordingly, before opening ports on a computer running Windows XP, 7 or 8, you need to decide on the ultimate goal of this “enterprise” and which ports need to be opened. For example, for Skype this is port 433 and 80, and for the mega-popular game Minecraft you will need to open port 25565.

In itself, “opening ports” does not cause any damage to your computer: its security will depend on what program uses and “listens” on it and how.

To further protect yourself, you can view statistics on the ports most vulnerable to viruses and hacking.

For example, most companies providing information security services recommend paying attention to port numbers: 21, 23, 25, 80, 1026, 1028, 1243, 137, 139, 555, 666, 1001, 1025, 7000, 8080, 12345, 31337, 31338.

In other words, open ports are like open doors to the harsh world of high technology, so you shouldn’t open everything without knowing who and for what purpose this port can be used.

How to find out which ports are open on a Windows 7 computer?

Once the target has been determined and the list of ports has been “agreed”, it is necessary to check whether the port is currently open. To do this, you can use the Command Line:

Open Command Prompt and enter the command “netstat -a”;

In response to the command, Windows OS will present a list of all open “TCP” and “UPD” ports;

The "Status" column will indicate what is happening with this port:

  • - “Listening” - that is, the port is “listening”. In other words, some program monitors the activities of a given port;
  • - “Established” - the port is open and in use;
  • - “Time wait” - the port is in standby mode: i.e. the program using it is preparing to put the port into one of the specified states.

Currently, there are quite a lot of services that allow you to check whether ports are open or not: for example, the online “2ip” check has earned the trust of users. To check, you just need to enter the port number and click “check”.

So, having decided how to view open ports, now calmly open the desired port.

How to open a port in windows 7 firewall?

The easiest way to open the required port on your computer is to use the built-in Windows Firewall:

- (“Start” - “Control Panel”);

In the left column “Advanced settings” the “Windows Firewall with Advanced Security” window will open;

  • - click “Rule for incoming connection” and in the “Actions” section (right side of the window) select “Create rule”;

  • - the “Rule Creation Wizard” will open: from the list presented, select “For a port” and click “Next”;

Below is the line “Specified local ports”: this is where you need to register the port to open (or range of ports) and click “Next”;

  • - the “Actions” section will open, in which select “Allow connection” - since you need to open a port on the computer;

  • after which all you have to do is enter the name of the created rule and, if desired, fill out a description.

If the firewall is configured incorrectly, this may occur, which we discussed in one of the previous articles.

This is the easiest way to open ports on a Windows 7 computer. No secret knowledge or secrets of network magic are required for this action, it is only important to know which port needs to be opened and in which protocol it is used.

How to open a port via Windows command line?

However, the ability to open a port through a firewall is far from the only method that can be used. You can also open ports on your computer using the “Command Line”: it is not difficult, but this approach requires basic knowledge of the structure and functional part of the “netsh” command.

So, open a command prompt with “Administrator rights” and enter the command “netsh advfirewall firewall add rule name=L2TP_TCP protocol=TCP localport=xxxx action=allow dir=IN”

The command structure includes the following parameters:

  • - the name “L2TP_TCP” is a second-layer tunnel protocol (the abbreviation “L2TP” literally means “Layer 2 Tunneling Protocol”);
  • - “protocol=TCP” means which protocol the port being opened belongs to: if it is for UPD, then after the “equals” symbol it is necessary to write this abbreviation;
  • - “localport=xxxx” instead of “x” indicate the number of the port to open.

Thus, opening a port on a computer is quite simple, and everyone can choose the most convenient method for themselves. The advantage of using Windows Firewall is only step-by-step configuration with an intuitive user interface.

It probably goes without saying that sometimes the user needs to use special ports in order to access, for example, online games. Sometimes this is required by specialized Internet clients or complex specific programs. Let's try to figure out how to check if the ports are open in the system. As it turns out, doing this is not so difficult.

How to check if ports are open? Command line

So, let's start with, perhaps, the simplest thing that the user has at his disposal. As a rule, in most cases, the solution to the question of how to check whether ports are open in the system comes down to using the command line, the functional set of which is quite diverse and allows you not only to view specific information, but also to correct many errors or problems.

It is accessed by typing “Run” in the menu bar, which, in turn, is called either from the main “Start” menu or by pressing Win + R. In order to check whether the Windows port of interest to the user is open, you can first display a complete list of ports, where the one you are looking for will be present. To do this, use the netstat -a command. After it is completed, the screen will display a complete list of ports indicating their status.

Use of online resources

In some cases, the question of how to check whether a port used by a program or online game is open (especially if it is required to be accessible from the Internet) cannot be resolved without the help of special online resources. This is only due to the fact that the availability of a certain port was checked, so to speak, from the outside - when trying to access the local machine, and not vice versa.

For such purposes, you can use quite a few sites that check the connection and the status of the supposed open port. For example, as a quick check tool, you can use the Port-scanner section located on the WhatsMyIP.org resource. Here in the Custom Port Test section there is a special field in which the user needs to enter the port he is interested in, then click the Start Test button. Needless to say, this process will take a little time. Upon completion, the result will be displayed.

How to Telnet in Windows XP

Finally, let's move on to checking for In Windows XP, as well as in any other system, this is done simply.

How can I check if the ports needed to access certain Internet features or resources are open? It's as simple as that. Again, the main tool will be used. But this time you will need to enter a variant of the Telnet command “server name” “port number” (for example, to check the connection via SMTP with port number 25 it looks like telnet smtp.name.ru 25, where the domain name is entered as the name). As you can see, everything is simple.

Problems in Windows Vista and higher

Vista and higher operating systems may experience problems. This is only due to the fact that by default the Telnet service is simply disabled in them. Therefore, in order to check whether the ports of interest to the user are open, you will first have to install (activate) it.

In the simplest version, you should go to the programs and components section, and then check the box next to the Telnet client itself. If for some reason it does not turn on, use the following on the command line: dism /online /Enable-Feature /FeatureName:TelnetClient.

If the client is not in the list at all, go to (regedit command in the Run menu), then go down the HKLM/SYSTEM branch through the CurrentControlSet subfolder to the Windows directory. In the window on the right we find the CSDVersion parameter and instead of the value 200 we assign it 0. Next, we use the same method as for the “expert”.

Why are some ports unavailable?

Based on the results, you can judge the state of a particular port. If one of them is currently unavailable, but needs to be used, there can be many reasons for this. Most often this is due to the consequences of exposure to viruses. Sometimes you should check your TCP/IP settings. In some cases, you will have to verify that the router settings are correct, especially in the case of a router. You should also pay attention to your firewall settings - it may be that it is blocking the port. Finally, it is not excluded that the port is actually in an open state, and its ping (response) time is too high.

However, this is not what we are talking about now, since correcting such errors and failures is a separate topic. As for checking the ports themselves, as can be seen from everything stated above, it is done quite simply. Therefore, if, say, an unprepared user has such a problem, there is no need to panic due to ignorance of the essence of the issue. Any of the proposed solutions allows you to perform such operations in a matter of seconds. In general, it is obvious that when checking, for example, online, the user must know exactly which port he needs. But sometimes the problem may also be due to the fact that this port is blocked by the provider. Then the problem will have to be solved at this level.

It is better to start scanning your network for security by checking the availability of ports. For these purposes, special port scanning software is most often used. If it is missing, one of the online services will come to the rescue.

A port scanner is designed to search for hosts on a local network with an open interface. It is mainly used by either system administrators or attackers to detect vulnerabilities.

The described services do not require registration and are easy to use. If you access the Internet via a computer, the sites will display the open ports of your host; when using a router to distribute the Internet, the services will show the open ports of the router, but not the computer.

Method 1: Portscan

A special feature of the service is that it offers users fairly detailed information about the scanning process and the purpose of a particular port. The site operates free of charge; you can check the functionality of all ports together or select specific ones.


In addition to checking ports, the site offers to measure ping. Please note that only those ports that are listed on the website are scanned. In addition to the browser version, users are offered a free scanning application, as well as a browser extension.

Method 2: Hide my name

A more universal tool for checking port availability. Unlike the previous resource, it scans all known ports; in addition, users can scan any hosting on the Internet.

The site is completely translated into Russian, so there are no problems with its use. In the settings you can enable English or Spanish interface language.


On the site you can find out your IP address, check your Internet speed and other information. Despite the fact that it recognizes more ports, working with it is not entirely comfortable, and the resulting information is displayed in too general a manner and is incomprehensible to ordinary users.

Method 3: IP Test

Another Russian-language resource designed to check the ports of your computer. On the website, the function is referred to as a security scanner.

Scanning can be carried out in three modes: normal, express, full. The total scan time and the number of detected ports depend on the selected mode.


The scanning process takes a few seconds, while the user only has information about open ports; there are no explanatory articles on the resource.

If you need to not only detect open ports, but also find out what they are for, your best bet is to use Portscan. The information on the site is presented in an accessible form and will be understandable not only to system administrators.