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

Xiaomiโ€™s modern wireless routers are well-deservedly popular for their stylish design, affordable price and powerful hardware, but like many other network devices, they block incoming connections from the external network by default to protect the home LAN from unauthorized access.

To play online games comfortably, organize video surveillance with access from anywhere in the world or run your own web server, you need to perform a procedure known as port forwarding. This process allows you to redirect traffic coming to a specific port of your external port. IP-addresses to a particular device within a local network.

In this guide, we will discuss in detail how to properly configure static IP-address for your device and create appropriate rules in the routerโ€™s web interface.You will learn to avoid common errors and provide a stable connection for your applications.

Before you start setting up, make sure you know. IP-Your router address (usually 192.168.31.1 or 192.168.1.1) and access to the administration panel, you will also need to know the ports you need to open for a particular program or game.

Preparation for port transfer and static IP

The first and critical step is to assign a static IP-Addresses to the device that opens the ports, if your computer or console receives the address dynamically through the DHCP, It may change after the router restarts and the rules will no longer work because they will link to a non-existent address.

First, it is necessary to determine the current IP-On a Windows computer, you can do this via the command line by ipconfig, and on Linux or macOS, you can do this by typing the ifconfig or ip a command. MAC-address of the network card, as they will be required for binding.

Next, enter the settings of the Xiaomi router. Open the browser and enter in the address bar IP-Gateway address. Once you have entered your administrator password, go to Settings and find the item. LAN or static appointment IP (Static IP allocation. A new rule must be added here that connects MAC-address of your device with the desired IP-address.

Choose an address from your subnet range but outside the address pool DHCP-a server to avoid conflict, for example, if DHCP Gives out addresses from 100 to 200, set a static address 192.168.31.50.

โ˜‘๏ธ Preparation for port port port transfer

Done: 0 / 4

โš ๏ธ Attention: If you do not secure IP-address behind the device, then after the next lease update DHCP Your computer may get a new address, and all port forwarding settings will go wrong, requiring reintervention.

Log in to the web interface of the Xiaomi router

The management interface of Xiaomi routers may vary depending on the firmware version and the regional affiliation of the device (Chinese or global). In most cases, the login is via the browser at 192.168.31.1. Some models also support management through the Mi Wi-Fi mobile application, but it is recommended to use the web version for fine-tuning the ports, since it provides full functionality.

When you log in, you'll be asked to enter your administrator password. If you've changed it before, use current data. For security reasons, make the administrator password complex and different from the Wi-Fi password. If you forget the password, you'll have to reset your router to factory settings, which will require reconfiguring the Internet.

Global firmware versions often translate the interface into English, while Chinese versions may require the translation of pages via a browser or the use of an in-app translator. The main terms you will come across are Settings, Advanced Settings, NAT or Port Forwarding.

If the standard address doesn't open, check your computer's network card settings. Make sure it's on the same subnet as the router and receives it. IP-address.

What to do if the administrator password is forgotten?
If the password from the web interface is lost, the only way to restore access is to reset the factory settings (Hard Reset). To do this, find a small hole on the router's case that says Reset, press it with a clip and hold it for 5-10 seconds until the indicator blinks. After that, the router will return to the factory password specified on the sticker at the bottom, but all your Internet and Wi-Fi settings will be deleted.

Setting up port forwarding rules

After successful authorization and consolidation IP-You can go to the direct rule settings on the Xiaomi router interface, and this section is usually located along the path: Advanced Settings) โ†’ NAT โ†’ Port Forwarding: In some versions of the firmware, this may be called Virtual Servers).

You need to create a new rule here, and you need to fill out a few fields, each of which plays a major role in the proper operation of the connection, and you usually need to specify the name of the rule (for convenience), the protocol, the external and internal ports, and the following: IP-target-point.

The protocol is chosen depending on the application requirements: TCP is used for reliable data transfer (websites, mail), UDP for streaming and games where speed is important. If an application requires both protocols, you often have to create two separate rules or choose the TCP/UDP option if it is available.

The External Port and Internal Port fields determine which port to listen to when you enter the Internet and to which port to redirect traffic within the network. IP-The address must match the static address you set in the first step.

ParameterDescriptionExample of meaning
NameArbitrary name of the ruleGame_Server
ProtocolType of network protocolTCP / UDP
External PortPort for incoming connections25565
Internal PortPort of a device within a network25565
IP AddressLocal IP of the target device192.168.31.50
๐Ÿ“Š What type of device you are setting up?
Game console
Computer (PC)
IP-camera
NAS server
Other

Advanced settings and UPnP

In addition to manual rollover, many modern games and programs use UPnP (Universal Plug and Play) technology, which allows applications to automatically open the necessary ports on the router without user intervention. On Xiaomi routers, this feature is usually enabled by default in the Advanced Settings โ†’ UPnP section.

While UPnP is convenient, it carries some risks from a cybersecurity perspective, as any application on the LAN can request a port to be opened. If you are setting up a network for an organization or want to maximize protection, it is better to disable UPnP and manually prescribe ports.

It is also worth paying attention to the function. DMZ (Demilitarized Zone: Inclusion DMZ certain IP-The address opens all the ports for this device, making it fully accessible from the Internet, which can help solve connection problems in games, but it is extremely dangerous for computers with important data.

Use DMZ only in extreme cases and only for devices that do not store sensitive information, such as game consoles, if other methods do not work.

โš ๏ธ Warning: Never turn on the mode DMZ It's like leaving the front door of your home open wide open, letting intruders directly into your files.

Port Opening and Diagnostics

Once you have set up the settings, you need to make sure that the ports are actually open and accessible from the external network. A simple check inside the local network (for example, trying to connect to the server over local IP) will not give a reliable result, since the connections within the network are different.

To check, use online services such as 2ip.ru, portscanner.online, or built-in verification tools in the games themselves. Enter the port number you opened. If the service shows the status of "Open" or "Listening", then the setting is successful.

If the port is displayed as โ€œClosedโ€ or โ€œFilteredโ€, check if the port is correctly indicated. IP-Device address, whether the built-in Windows firewall (Firewall) blocks the connection, and whether the protocols match TCP/UDP.

The Internet provider itself is often a problem. Many operators use the technology. CGNAT, by giving users "gray" IP-In this case, your router does not have direct access to the global Internet, and port port transfer is technically impossible without contacting the provider's technical support for obtaining a "white" (static) IP-address.

๐Ÿ’ก

If you check online and you see that the port is closed, try temporarily disabling the Windows firewall or antivirus on your computer. If the port opens, it's at the software level of the computer, not the router. Remember to create an exception rule in the firewall.

Possible problems and solutions

Users may encounter various difficulties in setting up. One of the common problems is incompatibility of firmware versions. Chinese versions of Xiaomi routers may have hidden menus or differ in the logic of NAT. In such cases, you may need to flash the device to a global version or use third-party firmware, such as OpenWrt, if the model supports.

Another nuance is IPv6. Modern providers are increasingly adopting IPv6. If your router and ISP support IPv6, devices get global addresses, and classic NAT port-over may not be necessary or work differently, but for compatibility with older IPv4 services, the sleeves are still relevant.

If the connection is unstable after all the settings, try changing the port range. Some games allow you to specify a specific port to use in the network settings. Make sure that this port is not occupied by another application in the system.

Also, itโ€™s worth remembering that antivirus packages often have their own network screens that ignore the routerโ€™s settings. Check your antivirus protection logs for blocking incoming connections.

๐Ÿ’ก

Successful port overlay depends on three factors: static IP within the network, the correct NAT rule on the router, and the absence of locks at the provider or firewall level of the OS.

Is it safe to open ports on a router?
Opening ports creates a potential vulnerability because you provide external access to a particular service. However, if you open ports only for trusted applications, use complex passwords, and update the routerโ€™s firmware and software on your device in a timely manner, the risks are minimal, the key is not to open unnecessary ports and avoid DMZ mode for PCs.
Why is port 80 or 443 not open?
Ports 80 (HTTP) and 443 (HTTPS) are often reserved by providers for their needs (authorization pages, technical services). Even if you create a pass rule, the provider can block traffic to these ports on its equipment.
Do I need to restart the router after setting up?
Usually the settings are applied instantly, but in some cases, especially when changing the settings. LAN or DHCP, It may be necessary to restart the router or reconnect the client to the network so that the device receives a new static device. IP-The address and rules are now in place.