Xiaomi’s modern routers are well-deservedly popular for their high performance and affordable price, but their software often requires a deeper understanding of network settings. The standard out-of-the-box configuration is focused on security, which automatically blocks incoming connections from the external network, which becomes a serious obstacle when you need to run a home game server, configure remote access to CCTV cameras or simply lower ping in online games.
Port forwarding is the process of creating a special rule in a router firewall that allows a certain type of traffic to pass to a particular device on your local network. Without this setting, requests from the Internet are simply ignored by the router, because it does not know what gadget in the house they are intended for. In this article, we will discuss in detail all the stages of preparation and configuration so that you can safely and efficiently manage network flows.
Preparation of the device and obtaining static IP-address
Before moving on to complex routing settings, it is critically important to fix IP-The address of the device you plan to access. In standard operating mode, the Xiaomi router distributes addresses dynamically through the protocol. DHCP, So if the address changes and the pass rule stays attached to the old value, the service stops working, and you lose the connection.
To solve this problem, you need to reserve a static IP-address directly in the settings of the computer, console or IP-Go to the operating system's network settings and manually write out the address, the gateway, and DNS-Make sure that the address you select is in the same range as the router network, but does not fall into the dynamic distribution pool to avoid conflicts.
An alternative and more reliable way is to link the address to the MAC-Find the partition that's responsible for the local network in the menu, and add a new static lease rule. Now, no matter when the device connects to the network, the router will always give it the same reserved address.
💡
Write it down. MAC-address and reserved IP-address on paper or in notes – this will save time if you have to reset your router settings or change your computer.
Once the address is fixed, check the device's availability with the ping command from another computer on the network. A stable response confirms that the underlying network infrastructure is working correctly and you can proceed to configure security rules.
Entrance to the admin panel of the Xiaomi router
Xiaomi network equipment is managed via a web interface that is only accessible from the local network. Open any browser on a device connected to the router and enter the standard gateway address in the address bar. This is usually 192.168.31.1 or the domain name miwifi.com. If the standard addresses were changed during the initial setup, use the current IP, which can be found through the command line.
The system will request authorization. In newer routers, login is often via the Mi Home mobile app or the password you set when you first started. Beware: a few incorrect password attempts may temporarily block access to the admin panel for security reasons.
☑️ Check before entering the settings
The interface can be presented in Chinese or English, depending on the firmware version (CN or Global). Chinese versions often require the use of an embedded translator in the browser or knowledge of basic terms such as Settings, Status, and Advanced.
Search Port Forwarding and Create a Rule
In the Xiaomi router interface, port port rolling can be called Port Forwarding, NAT, Virtual Servers, or simply Port Browsing. Depending on the firmware version, this section can be located in the Advanced Settings → NAT menu or in a separate Port Management tab. If you don’t see these options, make sure that the router mode is not set to Access Point mode, since in this mode routing functions are disabled.
To create a new rule, click the Add or Create button, and you need to fill in a few key fields, each of which determines the parameters of the traffic that is going through, and any error in any of them will cause the rule to fail.
The main parameters to be specified are:
- 📡 Name is an arbitrary rule name for your convenience (e.g., Minecraft Server or Minecraft Server "CCTV").
- 💻 Internal IP — static IP-The address of the device that we reserved in the first phase.
- 🔢 Protocol - Protocol type: TCP, UDP The choice depends on the requirements of the specific application.
- 🚪 Port Range - A range of ports, often requiring an external and internal port that may coincide.
💡
The rule will only take effect after saving and applying settings; some Xiaomi models require a router reboot to activate the new NAT rules.
After filling in all the fields, save the changes. The system can warn you of a decrease in security because you open access from the outside. Confirm the action if you are sure of the reliability of the device for which the port is open.
Static adjustment IP and binding MAC-address
While we mentioned the importance of static IP earlier, Xiaomi routers have a convenient anchoring mechanism that ensures network stability, a process called Static IP Assignment or Static Rental. It differs from manually configuring on a computer in that control goes entirely to the router.
Find the section in the menu LAN Settings or Address Reservation. Here you will see a list of all connected devices from their MAC-Select the desired device from the list or enter MAC-Manual address. Make sure the address is IP-address is outside the pool range DHCP, The router does not attempt to give it to another device automatically.
The table below shows an example of a proper static rental configuration for a typical home network:
| The device | MAC-address | Reserved IP | Status |
|---|---|---|---|
| Gaming PC | AA:BB:CC:11:22:33 | 192.168.31.100 | Active |
| NAS Storage | AA:BB:CC:44:55:66 | 192.168.31.101 | Active |
| IP Camera | AA:BB:CC:77:88:99 | 192.168.31.102 | Active |
| Smart TV | AA:BB:CC:DD:EE:FF | 192.168.31.103 | Active |
Once set up, reboot the client device so that it requests a new address, check in the network status that the IP received matches the reserved IP, ensuring that the port-over rule always leads to the correct recipient.
Open port inspection and diagnostics
After you have applied all the settings, you need to make sure that the port is really open and accessible from an external network. Simply having a rule in the router does not guarantee its operation, since the provider or firewall of the operating system can interfere. To check, use specialized online services such as 2ip.ru, portchecker.co or yougetsignal.com.
Enter the port number you opened and run the scan. If the service shows "Open" or "Open" status, then the configuration is correct. If the status is "Closed" or "Filtered", the problem may lie in the settings of the device itself or with the ISP.
Frequent causes of incapacity:
- 🛡️ Windows Firewall - blocks incoming connection even when the router port is open.
- 🏠 CGNAT The provider, if your white» IP-The address is actually the internal address of the provider, it is impossible to open the ports directly.
- ❌ Antivirus – Third-party antivirus programs often have their own network screens that ignore the router’s settings.
What is CGNAT and how to get around it?
For a deeper diagnosis, you can use the telnet or nc (netcat) utility from another device on the Internet (for example, from a mobile phone disconnected from Wi-Fi_ip_Port number address will allow you to establish a direct connection.
Problems with the provider and dual NAT
One of the most common problems when setting up Xiaomi routers is having a dual NAT (Double NAT).This is a situation where your router is connected to another router (for example, the provider terminal), and both devices perform routing functions, in which case even a properly configured crossover on Xiaomi will not work, since the external request is lost on the first device.
To fix this problem, you need to switch the provider's modem to Bridge Mode, in which the provider's device ceases to perform the functions of the router and simply transmits a signal to your Xiaomi, which becomes the only gateway to the Internet» IP-The address will be changed to “white” (if provided by the provider), and the port transfer will work.
⚠️ Note: Transferring the provider’s modem to bridge mode may require a call to technical support or special authorization data (PPPoE login/password.
If the bridge mode is not available, the alternative is to adjust the bridge. DMZ (Demilitarized Zone) on the provider's router, indicating as the target device IP-The address of your Xiaomi router is less secure, however, because it opens all the ports of your router to the external network.
Security and network protection after port opening
Opening ports inevitably expands the attack surface of your home network, and every open window is a potential door for attackers, especially if the software of the service running on that port contains vulnerabilities, so the security approach must be comprehensive and rigorous.
First of all, never open ports unless absolutely necessary. If you rarely use a service, create a rule only for the duration of use, and then delete it. Use complex passwords for all services available from the outside, and update them regularly.
⚠️ Never open standard remote control ports (e.g. 3389 for the remote control port). RDP, 22 for SSH, 23 for Telnet) on standard numbers. Change them to non-standard (e.g. 2222) in the settings of the service itself to avoid automated scans by bots.
Xiaomi routers also support Firewall with flexible settings, and it is recommended to turn on DoS protection and prevent Ping from responding to requests from an external network (WAN), which will hide your router from simple network scanners, making it less visible to potential attackers.
💡
Use different ports for different services and don’t use standard values (for example, use 8080 or 54321) instead of 80, this will significantly reduce the number of automatic attacks.
Check your router logs regularly for suspicious activity if you see multiple attempts to connect from unknown locations. IP-addresses to an open port, it is necessary to temporarily block access or change the filtering rules.