How to open a port on the Xiaomi router: step-by-step instructions

Modern Wi-Fi routers from Xiaomi are famous for their minimalist design and thoughtful software shell, but the default security settings often block incoming connections from the external network. This is standard practice for protecting user data, but it becomes a major hurdle if you plan to deploy your own game server, set up remote access to security cameras, or run a torrent client with the maximum number of peers. Without the right router configuration, external requests are simply lost without reaching your computer or NAS-storage.

The process of opening a port, technically called Port Forwarding or port-over, requires carefulness and a clear algorithm of actions. Unlike simple home networks, where all devices access the Internet automatically, here you will have to manually prescribe traffic filtering rules, and errors in setting can either lead to a service failure or, in the worst case, to a decrease in the level of cybersecurity of your local network.

In this article, we will discuss in detail how to correctly configure the network environment, fix IP-address and make changes to the management interface of the Xiaomi router. We will consider the nuances of working with protocols TCP and UDP, And we're also going to look at the problems that users often have when they first try to set up, and understanding these processes will allow you to not just copy actions, but to consciously manage the data streams on your network.

Preparing for Network Environment Configuration

Before you go directly to the router interface, you need to perform a series of preparatory actions on the computer or device for which you open the port. IP-By default, most home networks use DHCP-This means that your computer today may have an address of 192.168.31.50, and after restarting the router, it will change to 192.168.31.51, which will reset all the throwover settings.

To avoid this situation, you need to either reserve the address in the router itself, or, more reliably for the initial stage, prescribe a static address. IP-The address in the network settings of your PC operating system is also critically important to know the exact port number and protocol that your application uses. For example, for a web server, port 80 is standard, for Minecraft game servers - 25565, and for torrents, the range can be any, but often chosen above 10000.

πŸ’‘

Write down the current settings DNS and lock before change IP-address to static, so that in case of an error in the connection to the Internet, it is possible to quickly return everything as it was.

Check what type of connection is used in your system. To work correctly port rolling, the device must be in the same subnet with the router. Usually, the gateway address on Xiaomi networks is the form 192.168.31.1 or 192.168.1.1, but this depends on the specific model and settings of the provider. Make sure you are connected to the right Wi-Fi network or LAN-port operated by the router, not through a third party modem operating in router mode.

Control Panel entrance and basic diagnostics

To get started, you need to log in to your device's web interface. Open any browser on a computer connected to Xiaomi's network and type in the address bar IP-Gateway address. It's usually 192.168.31.1, but if you've changed your settings before, the address may be different. Once you enter the address, the system will ask for the administrator password. If you haven’t changed it after you bought it, try the standard one, which is often listed on the sticker at the bottom of the case, although modern Xiaomi Mi Router models require you to set a password when you first set it up via the mobile app.

The management interface can come in two versions: classic or new, depending on the firmware version. In newer versions of MIWiFi, the interface looks very ascetic, and some advanced features, such as manual port rolling, can be hidden or ported. If you don't find the right items in the web version, it makes sense to use the Mi Wi-Fi mobile application, which is available for Android and iOS. Sometimes the functionality in the application is more complete or, conversely, more simplified, so checking both interfaces can save time.

⚠️ Note: If your Xiaomi router is connected to another router (such as a provider) through WAN-The port, you are behind the double NAT. In this case, opening ports on the router Xiaomi will not give results until you set the pass and on the main device provider or do not transfer the modem provider in the bridge mode (Bridge).

After successfully logging in, look carefully at the tabs available. We are interested in the section related to security or advanced network settings. Depending on the interface localization (Chinese or global firmware), the names may differ. In Chinese versions, look for characters meaning "Settings" (usually a gear) and then sections related to "Port Forwarding" or "Virtual Servers." Global versions often have a more understandable menu in English or Russian.

Static adjustment IP-device-address

As mentioned, dynamic address change within the network is the main enemy of stable port-over operation. To ensure that your computer or game console always receives the same address, the best way to use the address reservation function in the Xiaomi router itself, which ensures that even when the device is rebooted, it will receive a reserved IP, and the firewall rules will continue to work correctly.

To implement this method, go to the settings section LAN or DHCP-And you'll see a list of all the customers that are currently connected, and you'll find your device by name or by name. MAC-Next to it should be the option of fixing the address or setting a static lease. Select it, and the router will remember the match between the two. MAC-address of your network card and selected IP-address.

β˜‘οΈ Checking before port port rollover

Done: 0 / 4

Alternative option - manual registration IP Go to Network Settings, select Adapter Settings, open the properties of your connection (Ethernet or Wi-Fi) and find the protocol IP version 4 (TCP/IPv4). Switch from automatic receipt to "Use the following" IP-Enter the address from the same subnet as the router (e.g. if the router is a router) 192.168.31.1, give the device 192.168.31.150), Specify the subnet mask 255.255.255.0 and gateway - the address of your router.

Step-by-step process of opening the port

Now, to the most important step, creating a dash rule. In the Xiaomi router interface, this section is often called "Port Forwarding," "Virtual Servers" or "NAT." In some firmware, it may be hidden inside the "Advanced Settings" or "Security" partition. If you use the Chinese version of the interface, look for the section with the name that contains the word "transfer".

The process of adding a rule is as follows: press the Add Rule or Create button. You will be asked to fill in a few fields. In the Name or Service Name field, type in an arbitrary name for the rule, for example,"Minecraft_Server" or"Camera_Living", So you don't want to get confused in the future, and then you need to specify the internal IP-The address of the device that we recorded in the previous step is the address of your computer or console within the LAN.

The next important parameter is ports. You need to specify the external port (the port from which the request comes from the Internet) and the internal port (the port to which the application on the computer expects a connection), they are most often the same. You also need to choose the protocol. There are three options here: TCP, UDP or ALL (Both). If you are not sure which protocol your application uses, choose ALL or create two separate rules for TCP and UDP.

πŸ“Š What type of device you are setting up?
Game console
IP-camera
Torrent client
Web server
Other

After filling in all fields, click "Save" or"OK". The rule will appear in the list of active roll rules. Make sure the status of the rule is "Enabled" or "Active." Some Xiaomi router models require a reboot to apply changes, although most settings take effect instantly. Check the list again: it should clearly read IP-address, ports and selected protocol.

For ease of settings, here is a table with the most common ports that users often need to open, which will help you navigate faster if you are setting up a standard application and do not know what range to use.

Service/ApplicationProtocolPort portDescription
Web Server (HTTP)TCP80Standard Port for Websites
Secure Web (HTTPS)TCP443Secure connection for websites
Minecraft ServerTCP/UDP25565Default port for Minecraft server
BitTorrent / uTorrentTCP/UDP6881-6999Port range for torrent clients
FTP ServerTCP21Transfer of files via FTP protocol

Using standard ports like 80 or 21 can be insecure, as they are often scanned by bots for vulnerabilities. If the application allows you to change the port in its settings, it is better to choose a non-standard value, such as 8080 instead of 80, and change the router’s pass rule accordingly, which will add an additional, albeit small, level of stealth from automatic scanners.

Performance check and diagnosis

Once you have all the settings, you need to make sure that the port is really open and accessible from the external network. Just running an application on your computer is not enough, since it can run inside the local network, but it can not be accessed from the outside. There are many online services to check, such as 2ip.ru or portchecker.co. Enter the port number you just opened and run the check.

If the service shows that the port is closed, although the router is configured correctly, the problem may be in the Windows firewall or antivirus. The operating system often blocks incoming connections at the software level, ignoring the router settings. Go to the Windows firewall settings, find "Additional options" and check the rules for incoming connections. Make sure that your application or port has a resolution.

Why does the check show a closed port?
Often, the reason is that the check is done from a device that is inside the same network (for example, from a phone on Wi-Fi). NAT Loopback (Hairpinning), so check the availability of the port through the mobile Internet or ask a friend to run the check from another IP-address.

It is also worth noting that some Internet service providers use the technology. CGNAT, smacking" IP-In this case, your router gets an address from a range. 10.x.x.x or 100.x.x.x, It's not unique on the global network. You can check that by comparing it. IP-status WAN router IP-address that the site sees 2ip.ru. If they do not match, port transfer is impossible without ordering a static service. IP provider.

Possible problems and methods of solving them

One of the common problems is the instability of the drip after the router restarts. This can happen if you do not fix it. IP-address behind the device, as described at the beginning of the article. IP It's changed, the rule leads nowhere. Always use static binding. IP down MAC-address DHCP-settings of the Xiaomi router.

Another challenge is working with IPv6. Modern providers are increasingly giving away IPv6 And the way that Xiaomi routers do it, they do it, but the rules are for the pass (NAT) work only for IPv4. If your computer is primarily IPv6 The address is trying to open the port for IPv4, There will be no connection. LAN router switched on handout IPv4 Addresses and your device has a format address 192.168.x.x.

⚠️ Warning: Opening ports creates a direct hole in your network security. Never open ports to services you don't know or suspicious programs. Regularly update your Xiaomi router firmware, as manufacturers often close vulnerabilities in the mechanism. NAT firewall.

If you use complex configurations, such as torrent port ranges, make sure the router handles the load. Xiaomi's budget models can lose packets or freeze with a large number of simultaneous connections through an open port. In this case, try to reduce the maximum number of connections in the settings of the torrent client itself.

πŸ’‘

Successful port overlay depends on three factors: static IP within the network, the absence of dual NAT on the part of the provider, and correct rules in the operating system firewall.

Additional safety recommendations

When you open ports, you take responsibility for the security of the device behind that port. If you open a security camera, make sure it has a complex, unique password. Standard passwords like "admin/admin" or "12345" for devices accessible from the Internet are equivalent to no security at all.

It is recommended to periodically check open ports with security scanners, which will help to identify forgotten rules that you created back and safely forgot about them, and the service is no longer used. Excess open ports are an extra surface for a potential attack. In the interface of the Xiaomi router, you can quickly disable an unnecessary rule by simply unchecking the "Enable" tick.

For particularly important services, consider using VPN instead of direct port port forwarding. VPN-A server (like WireGuard or OpenVPN) on a router or separate device, you can safely connect to your home network from anywhere in the world without opening ports for specific applications outward.

Can I open a port if I have a dynamic IP from my provider?
Yes, you can. The port port overlay on the router will work correctly. IP-The address will change every time you restart the router or once a day, you will have to learn a new one every time. IP. To solve this problem, use the services of Dynamic DNS (DDNS), Many of which are built into Xiaomi routers or supported through third-party scripts.
Is it safe to open port 80 for a home web server?
Port 80 is standard for HTTP and is constantly scanned by bots. If you do not plan to host a public site, it is better to use a non-standard port (for example, 8080 or 8888) and set up a redirect.This will reduce the amount of junk traffic in logs and reduce the risk of automatic attacks on known web server vulnerabilities.
Why are the settings not saved after the router restarts?
This can be due to a configuration reset or firmware error. Make sure you press the Save button and, if any, Apple. In rare cases, resetting the router to factory settings and reconfiguration helps. Also check if the device's log file is full, which sometimes happens on older models when you're busy.
Does Open Ports Affect Internet Speed?
The fact that the port is opened does not affect speed. Speed depends on the bandwidth of the channel and the load on the router processor. However, if a large amount of traffic goes through the open port (for example, active torrent distribution), this can load the channel and the router's processor device, which will lead to lags in games or buffering video on other devices.