How to open a port in a router. How to open ports on a router

Home / Brakes

This review will cover the following: how to open ports on the router and what must be done before that, as well as why all this is needed.

Router DIR-300 D-Link

Let's say a packet addressed to a specific port (for example, 8080) arrives from the Internet to the router. This package will be ignored by default. If it is necessary that it be sent to one of the PCs local network– perform port forwarding, or “open a port”.

Before opening a port required by a particular program for its operation, you can check: what if the port is already open? We go to the site “2ip.ru” directly from the local network computer. In the address bar, add: “/check-port/”. And check the required port:

But by performing certain manipulations in the router settings, you can make the port open. Only, in this case, you need to specify the IP of the target computer (therefore, all PCs for which port forwarding is performed on the router must be included in the “IP reservation area”).

It is important to know: you can open a port with a certain value for no more than one PC on the local network. That is, you cannot open one port for two or more computers.

Introduction to Port Forwarding

Typical port values

Information in networks is transmitted in packets. Each packet carries a recipient address and a port value (an “address: port” pair). If the required port is closed on the recipient's side, the packet is simply ignored and disappears from the network.

The ports commonly used are:

  • 20 and 21 – ftp server ports
  • 22 – SSH secure shell port
  • 80 – http server port (you need a site “in public access" – open port eightieth)
  • 8080 – web caching service port (hard to say what it is)

In some programs (for example, in the DC++ client-server), you can specify the port value directly in the settings. That is, there is no concept of “default port” in these programs. However, the port value must be from a certain range (which is very desirable).

Let's say there is a PC with an FTP server on the local network. Let’s also assume that the user knows the IP address assigned to him by the provider. This ftp server can be made accessible from an external network. For this purpose, they open ports on the router (20th and 21st). The route of incoming packets will look like this:

Route of the packet directed to the ftp server

If it is clear in general terms why “port forwarding” is needed, move on to the next chapter.

Algorithm for forwarding in a router

Having received incoming package, the router “looks” at the value of the port to which this packet is addressed. A list of the form “port -> local address: port” is stored inside the router, and the list is specified by the user himself.

According to the given list, the behavior of the router should be as follows:

  • If this port value is not in the list, the packet is “lost”
  • If there is, then the IP address value in the packet header will be replaced (with the IP of the target computer), and the packet will be sent to the local network

And setting up router ports is creating a list. Each line must contain 3 elements: the value of the port specified in the packet header; IP address of the local PC to which this packet should be sent; new port value (usually left the same).

Example. For computer with installed server http (and local IP equal to 192.168.0.112), the list line should contain the values: “80 -> 192.168.0.112: 80”. Everything should be clear here.

Setting up the router

“Reservation” of local IPs

Enabled in the router DHCP server, which changes the IP addresses of local devices (for example, once every 3 hours or more often). To forward a port to a PC with a specific IP, you need to “assign” the IP to this computer.

Opening a port on a router should not remain “temporary”. There is a solution - turn off DHCP. We will do things differently by setting up a “reservation” of IP addresses for the required PCs.

In the web interface of TP-Link routers, for example, it is difficult to configure a reservation. You need to know the MAC address of the target computer (its network card). On Windows, this can be found by going to the "Status" of the connection (opening the "Support" tab and clicking on "Details").

In the configuration interface, on the “DHCP” -> “Address Reservation” tab, click the “Add New” button:

Address reservation tab

A new tab will appear. Let’s indicate the MAC address of the target PC (as well as the IP “assigned” to it):

Address reservation for local PC

Make “Status” – “Enabled”, click “Save”.

It is important to know that we will have to “reserve IP” for each PC to which we will forward a port (at least one).

IN D-Link routers– it’s easier to do the same thing. Go to the “Setup” -> “LAN Setup” tab:

Setting up a local area network (LAN)

We see the “DHCP Client List” block (here – all PCs on the local network). We remember the name “Host Name”, then in the block below we select the required one from the list. Click on the button "<<». IP-адрес

from the middle cell - we assigned it to this PC.

How to open ports through a router will be discussed using D-Link devices as an example (for others everything is very similar).

Configuring port forwarding (“old” interface)

Go to the “Advanced” -> “Port Forwarding” tab, check the box on the left:

Port forwarding tab

Next, the following is done:

  1. You must specify the target PC (Host Name, or just local IP)
  2. Set the protocol to use (for most programs - TCP, you can also create two identical rules for TCP and UDP)
  3. Specify the value of the forwarded port (in the example - “35000”)
  4. We check that the rule is always on (Always On)
  5. Click “Save Settings”

Thus, we looked at how to open a port on the router. In the modern version of the interface, you can specify a “range” of ports (by setting the minimum and maximum numbers). Also, there is an option to “change” the internal value of the port (a packet addressed to port 80 can be forwarded to port 81). Let's look at this in more detail.

Configuring port forwarding (“new” interface)

First of all, in the new version of the D-Link router, you need to enable the firewall. Then, the administrator creates “Virtual Servers” for it:

Creating Firewall Servers

Click the "Add" button. On the tab that appears, we will create a port forwarding rule:

Forwarding port “23” to PC 192.168.0.100

You need to set “Custom” at the top, then come up with a name for the rule. We are considering how to open ports through the router for packets directed “outside” (and therefore, we select the “WAN” interface). Then everything is standard: select the protocol used (TCP/UDP), indicate the port value (in this case, “internal” is no different from “external”). Finally, indicate the “target” IP address and click “Change”.

Forwarding a port with changing its value

In the IP packet header, you can change, firstly, the recipient address (which is done by the router), and also the port to which the packet is sent. Using this option is simple; just specify the “internal” port (it may differ from the “external” one).

How to forward ports on a router by changing their values ​​is clear from the example in the previous chapter. It is necessary to indicate the value required by the program in the “Internal port” field. If the external port is "23", this does not mean that the "internal" will only be the same.

Possible difficulties

By opening a port on the router, you can get a negative result (the port will still be unavailable).

This is possible for the following reasons:

  • The local address “reservation” was not performed correctly (which is necessary for each target PC)
  • The 2ip service is useless when the “internal” value of the port is obviously not equal to the “external” (there will be a message “Port closed”)
  • We looked at how to open a port through a router, but it may be blocked by your ISP

At the same time, if the port is not open, there is no need to try to call the provider right away. It is better to try to solve the problem “locally”.

Here we show how to open a port in the classic D-Link interface (which is different from the one discussed - here you can specify “internal” and “external” values):

Opening ports on a router is not such a difficult procedure, especially if you only need to open one port. You may need this if the necessary ports on the router are simply closed. Many manufacturers close ports to protect user traffic, so opening the ports yourself is your responsibility, as are any consequences thereafter. For example, if you wanted to play an online game with friends and act as a host on your own server, then most likely you will have to open the port that this server accesses. You will find detailed instructions on opening ports on the router in this article.

How to open ports on a router for online games

If you are simply not allowed into any online game server, then it is better to resort to this method, but it is also suitable for some programs that access specific ports blocked by the router. If your goals are different, for example, opening a port for a website or hosting a server, then refer to the next point and skip this one.

This method is relatively simple as it does not require any additional information other than the port number.

Go to your browser and enter the following address in the address bar:

  • 192.168.1.1
  • Or 192.168.0.1

A login window for managing the router will open. The default login is admin. The password is exactly the same. This data will be different if you have changed your login and password previously.


Go to the “Forwarding” tab and then “Port Triggering”.
Here you need to click on the “Add” button.


In the window that appears, write the port number in the “Trigger port” line. Leave the remaining lines unchanged, click “Save”.

Add in this way all the ports that you need to open for the above purposes.


How to open ports on a router for other purposes

  • If the simpler method does not suit you, then proceed to these instructions. First, find out your ip on the website https://2ip.ru


  • Your IP must be static, since a dynamic one will constantly change the address of the host server that you distribute to your friends.
  • Now do a little test: remove the cable from the router and connect it to your computer or laptop yourself. Go to the link https://2ip.ru/check-port and enter the required port number in the special line.
  • If the port is available, then the problem is really with the router, but if not, then contact your provider, since setting up ports on the router will not help you.


  • Re-insert the cable into the router and connect to the Internet. Enter the address 192.168.0.1 in your browser and go to the router settings.
  • Select the “Forwarding” line.


  • Click “Add”.


Now enter the following information:

  • In the first line, enter the numbers of the port that you want to open.
  • You can skip the second line.
  • Next, enter your IP address.
  • Leave the “Everyone” protocol unchanged.
  • The state must be enabled.


It is better to select “Enabled” for the standard service port if you do not know exactly what value to specify.
Now click “Save” and reboot your router. The port will open and you can use it.


The question of how to open ports on a router sometimes arises for some reason. The main one is that initially these ports are closed, and sometimes they are needed. They are closed on one side. Accessing the network is not a problem, but obtaining information from the outside can be complicated.

Receiving incoming data is enabled in all routers by default, but sometimes you have to configure the sending of outgoing data yourself.

A router is an integral attribute of apartments where, in addition to a desktop computer, there are laptops, smartphones, tablets, and some even have refrigerators with Internet access. A device that distributes Wi-Fi is very convenient in such cases. But the router becomes a significant hindrance when you need to play online games, exchange information over peer-to-peer networks, or allow any access to the computer. Then you won’t be able to get through the router without taking measures to open the port. But there are ways to solve this problem.

TP-LINK WR841N: opening and configuring ports

As practice shows, you can open a port on the TP-LINK WR841N router in much the same way as on other devices from this manufacturer, so the advice is universal, but with some nuances, since each model may have its own characteristics. The algorithm of actions is not very complicated, but it must be followed strictly, since mistakes will render all efforts useless.

For the described device, as well as for devices manufactured by other companies, it is necessary to determine a network address on the local network, which will allow you to enter the control panel and carry out the necessary actions. This address is in the instructions for the router. If you don’t have such a document at hand, you can try the most commonly used addresses for the local network: 192.168.0.0, 192.168.0.1, 192.168.1.1 or similar.

For a faster search, you can use the command line capabilities. To do this, click on the “Start” button in the lower left part of the Windows operating system window, then click on the “Run” command and enter the cmd command in the field that appears. The command line will open, enter the Ipconfig command into it, press “Enter” and select the desired one from the information that appears. It is located in the column called Ethernet Adapter, which has a line with the network address.

The control panel usually runs in a browser, and to enter it you must enter a username and password. Usually a one-size-fits-all traditional factory option is suitable. This is the admin password and admin login. Of course, if you select a new password and login, you must enter it.

The second step required to open ports on the router is to provide a network address to a computer or other device that will be used for games, and possibly for other needs.

You need to go to the DHCP section, find Address Reservation there, click add new. In the text field that appears labeled MAC Address, you must enter the physical address of the computer’s network card. Since not everyone knows where to find such information, we should dwell on this in more detail.

You need to click the “Start” button, select “Control Panel”. In the “Network and Internet” section, select “Network and Sharing Center”. The next action is to left-click on the “Change adapter settings” item. A list of connections will appear, select the one you need. Next is a click on it, but with the right mouse button. In the context menu that appears, select the “Status” line. In another window there is a “Support” tab, which is exactly what you need. In the “Property” column there is a line “Physical Address”. This is the required parameter, its value is the same MAC Address of the network card.

There is an easier way, using the same command line. Enter the getmac command into it. As a result of its execution, a list of all network cards and their physical addresses will appear. If there are several of them, you need to look for the one that is currently in use.

The MAC Address has been entered, now in the IP field you need to enter the network address of the device, which was determined earlier. Now the router will be able to give the device used its own network address each time you log in. The next step is to configure the ports.

Static ports require some configuration before use. To do this, you need to know the port number that will have to be opened and the same network address of your own computer. If the second has already been determined, then the first can be found in information about games or other programs trying to penetrate the computer. For the Minecraft game it is usually 25565, but you can use another one.

The rest is simple. Finding the Forwarding item, and in it - Virtual Servers, will not take much time. There is a Service Port field and an Internal Port field. They must be filled in, the information is the same port number that needs to be opened. The already familiar procedure of entering an IP address in the appropriate field should not cause difficulties.

In order not to subsequently look for the reason for the failure to open a particular port, you should first check whether it is available. Before opening the ports on the router, you simply need to disconnect the cable from the device and connect it directly to your own network card. Then go online and find one of the specialized sites where the status of ports can be checked in a few clicks. The resource will determine whether the required route is open or closed. If everything is in order, you can continue driving.

The next step is to open a port on the router for the servers used to play online games. To do this, in the device control panel you need to find the already familiar Forwarding item, there - Port Triggering, and enter the desired port in the Incoming Ports field.

Rebooting the router is a required step for the changes to take effect. After the device starts up, the procedure can be considered completely completed. All that remains is to connect the server, go to the same site where you checked the status of the port, and once again make sure that everything is in order.

D-Link: everything is the same, but with nuances

The next model that needs to be manipulated is D-Link. The first action when opening ports on the router, as in the previous case, is to log into the management system. Login is carried out in the same way as was done in the previous case, including searching for the router’s network address and other information necessary for operation. You may need to reset previously carried out settings, then the process will proceed without problems. The parameters can then be returned back; for this it is better to write them down.

After successful login, the “Firewall” option will appear. It has a “Virtual Servers” tab, second from the top. It has an “Add” button that you need to click on.

The next action is usually called port forwarding. To do this, you need to make changes in the fields of the window that opens.

The inscription in the “Template” field should be left unchanged. In the “Name” field you can enter any name you like. The values ​​of the drop-down lists labeled “Interface” and protocol should also be left unchanged.

  • external port (initial);
  • external port (end);
  • internal port (initial);
  • internal port (end).

The required port is registered. How it is determined is described above. The last field is “Internal IP”. It contains the address of your own computer on the local network, the definition of which is already familiar to the user. You should be careful not to confuse the computer address with the network address of the router. All that remains now is to save the changes by clicking on the corresponding button at the bottom left of the tab window.

An obstacle to opening the required port may be not only the router, but also other devices or programs. These are routers, firewalls (firewalls) and the like. The latter are easy to configure accordingly. A standard firewall has a list of exceptions in which you must enter the necessary data. Third-party programs also have a corresponding item. All actions must be carried out carefully, having first read the necessary information.

https://site/

It should be noted that you should not completely disable the firewall. This seems like a simple solution, but it's better to let it work, protecting your computer from outside threats. Moreover, disabling this program does not provide any guarantees for the automatic opening of the required port.

The description of the process of opening the necessary ports showed that the process is simple, but the order in which it is carried out depends on the router model

Each of them has its own management interface, unlike any other. However, the required data (physical addresses of the computer and router, the number of the port intended to open, the physical address of the network card) is the same in all cases and is recognized in the same ways.

If you actively play Minecraft or other multiplayer games that require connecting to a server, then sooner or later you will probably be faced with the question of how to open ports. By default, the firewall and antivirus close most ports, so games and programs may not work correctly. This deficiency can only be corrected manually.

Setting up a firewall

Before you start opening a port, you need to find out its number. For example, for GTA V online mode to work properly, you need to open port number 80. Unturned requires open port 25444. You can find this information on game forums or support pages.


In some cases, you need to specify permission for two protocols - TCP and UDP.

It's simple: two incoming rules are created, for which different protocols are specified. The rest of the data must match.

Firewall in antivirus

Some antiviruses manage the firewall themselves, so you need to open the logins in their settings. There is no fundamental difference, but the order changes slightly. Let's look at the algorithm using the example of ESET Smart Security antivirus.


If you do not want to configure rules in your antivirus settings, disable its firewall. The system will prompt you to activate the Windows Firewall, after which you can open access using the first part of our instructions.

Allowing access in the router

If you have a router, then you need to additionally open access in its interface, otherwise the data packets will not pass through as intended. First, look at the physical address of the computer on the network - the input opens for a specific machine.

  1. Go to Network and Sharing Center and click on the connection you are using.
  2. Click Details.
  3. Find and remember the IPv 4 address.

You have found out the physical address of the computer on the network, now you need to open ports for it in the router. Go to the router's web interface (usually available at 192.168.0.1). Go to the section responsible for the operation of the firewall. You need to configure a virtual server.

Click "Add" to open the virtual server setup form. Please provide the required information:

  • Name (use the name of the game).
  • The interface is everything.
  • The protocol is the one you need, TCP or UDP.
  • External and internal starting port - a specific number, for example 25444.
  • Internal IP – the IPv4 address that you looked at in the connection information.

After saving the configuration, the port will be open. To check its operation, go to the website 2ip.ru. There is a "Port Test" tool here.

If you do not carry out the procedure for opening and forwarding ports for the router, then you may have problems with its operation in the future. Fortunately, on most modern routers you can do this yourself using a special settings panel.

Briefly about working with ports

All work will take place in a specialized control panel, which opens in any browser after entering one of the following IP addresses in the address bar:

  • 192.168.0.1
  • 192.168.1.1

Also, before working with ports, check with your provider to see if he has configured them. In this case, it is not recommended to change the port settings yourself without a good reason.

Stage 1: Pre-configuration

Initially, you need to log into the control panel of your router. You can do it like this:


After logging into the control panel, you must make a change to the distribution of local IP addresses within the network. Let's look at this procedure using routers from TP-Link as an example:


Stage 2: Opening ports

After completing the preparatory stage, you can proceed directly to opening the ports:


As you can see, opening ports on a computer is not something complicated. If problems arise, study the documentation from the provider or contact them for help by calling technical support.

© 2024 ermake.ru -- About PC repair - Information portal