Opening ports on the Xiaomi Mi Router 4 router is a necessary procedure if you want to start a home server, improve connection in online games like CS2 or Call of Duty, speed up torrent downloads or configure remote access to security cameras. Despite the seeming complexity, the port rollover process takes no more than 10 minutes, if you follow the instructions clearly.
The main problem is that users don't understand terms like "ports rolling," "static IP" or "DMZ." In this article, we'll take each step through the Mi Router 4 (including MiWiFi and Padavan firmware), explain why each option is needed, and warn against common mistakes. If you're a beginner, don't worry: we avoid technical jargon and give explanations on the fingers.
Important: before setting up, make sure that your ISP does not block incoming connections (relevant for Beeline, Rostelecom and some MTS tariffs). If the ports do not work after the rollover, the problem may be on the operator's side.
What is port port transfer and why it is needed
Imagine that your router is a security guard in an office building, and when an external device (such as a game server or torrent tracker) tries to "call" you, the security guard won't miss the call because he doesn't know who it is intended for. Port rolling is an instruction to the security guard: "If someone knocks on port 25565, let him to my computer with IP 192.168.31.100."
Without open ports, you canโt:
- ๐ฎ Create your own servers in games (Minecraft, Counter-Strike, Terraria).
- ๐ฅ Receive incoming connections in torrent clients (without this, the download speed will be lower).
- ๐ฅ๏ธ Connect to a home PC remotely via RDP or TeamViewer, bypassing their servers.
- ๐น Set up access to security cameras from the outside (e.g., via the Xiaomi Home app).
On Xiaomi Mi Router 4, port forwarding is done through Port Forwarding, but two prerequisites must be met beforehand:
- Assign a static IP to the device (so that the router always โknowsโ where to redirect traffic).
- Make sure that the target device (PC, NAS, camera) is running an application that โlistensโ to the desired port.
โ ๏ธ Warning: Opening ports reduces the security of your network. If you are scrawling through a port for play or torrenting, make sure the device has an antivirus and firewall installed. For critical services (e.g., RDP), it is better to use VPN instead of direct dash.
Preparation: Assign static IP to the device
If you don't assign a permanent IP- address to your device, the router can assign a different address to it after the reboot and the port rollout will stop working. On the Mi Router 4, this is done by associating the MAC- address to the IP.
Instructions:
- Connect to the router via Wi-Fi or cable.
- Open your browser and type 192.168.31.1 (or miwifi.com).
- Log in (the default login and password is usually admin/admin combination or is indicated on the router sticker).
- Go to Additional Settings โ Network โ Local Network โ DHCP.
- Find the device in the list for which you need to open ports, and click Reservation.
- Specify the desired IP- address (e.g., 192.168.31.100) and save it.
Example of IP backup for PCs with MAC- address 00:1A:2B:3C:4D:5E:
| Parameter | Meaning |
|---|---|
| MAC-address | 00:1A:2B:3C:4D:5E |
| Reserved IP | 192.168.31.100 |
| Description | Gaming PC (CS2) |
Make sure the device is connected to the router|Reserve static IP into DHCP|Write it down. MAC-address and assigned IP|Check that the target port is not blocked by the Windows firewall-->
โ ๏ธ If you already have a device on your network IP 192.168.31.100, select another address from the range 192.168.31.2-192.168.31.254. IP-Addresses will cause you to lose contact.
Port rollover on Xiaomi Mi Router 4: step-by-step instructions
Now, to the main stage, on the Mi Router 4 with the original MiWiFi firmware, the path to settings may be different from alternative firmware like Padavan, and we'll look at both.
Method 1: Original MiWiFi firmware
- Go to the router control panel (192.168.31.1).
- Go to Additional Settings โ Redirect โ Port Redirect.
- Press Add the rule.
- Fill in the fields: Rule name: Any (e.g., "CS2 Server"). Protocol: TCP, UDP or TCP/UDP (select depending on application requirements). External port: Port that will be open "outside" (e.g., 27015 for CS2). Internal port: Usually the same as the external (unless the application requires otherwise). Internal IP: Static IP devices (e.g., 192.168.31.100).
Save the rule and restart the router.
Method 2: Padavan firmware (alternative)
If you are using Padavan, the path will be different:
- Go to 192.168.1.1 (address may vary).
- Go to Firewall โ Port Forwarding.
- In the Custom Rules field, add a line of the form: iptables -t nat -A PREROUTING -p tcp --dport 27015 -j DNAT --to-destination 192.168.1.100:27015 (replace 27015 and 192.168.1.100 with their values).
- Save and restart the router.
How to check:
- Run a program on the target device that uses a port (such as a game server or torrent client).
- Open one of the services above and enter the port number.
- If the port is open, you will see either Open or Success status.
If the port is closed:
- Check that the rule of the pass is saved in the router.
- Make sure that the Windows/ antivirus does not block the port.
- Restart the router and device.
- If nothing helps, contact the provider (it may be blocking incoming connections).
What if the provider blocks the ports?
DMZ and UPnP: Alternative ways to open ports
If port rollover doesnโt work or you need to open many ports at once, consider two alternative methods:
1. DMZ (Demilitarized Zone)
DMZ redirects all external requests to a single device on your network, which is convenient but highly insecure, making the device vulnerable to attack.
How to turn on:
- Go to the Additional settings โ Redirect โ DMZ.
- Enter the IP of the device (e.g. 192.168.31.100).
- Save and restart the router.
2. UPnP (Universal Plug and Play)
UPnP allows devices (like game consoles or torrent clients) to automatically open ports without manually configuring.
How to turn on:
- Go to Additional Settings โ UPnP.
- Activate the switch Enable UPnP.
- Save the settings.
โ ๏ธ Warning: Don't use DMZ and UPnP at the same time as manual port-drift, which creates conflicts and security holes. If you turn on DMZ, turn off UPnP, and vice versa.
๐ก
UPnP is convenient for gaming (Xbox, PlayStation) and torrenting, but it is best turned off when it is not needed.DMZ should only be used temporarily and only for trusted devices.
Typical errors and their solutions
Even after you set up the ports properly, here are the most common reasons and ways to fix them:
| Problem. | Reason. | Decision |
|---|---|---|
| The port won't open. | Provider blocks incoming connections | Call for support or use VPN |
| The pass rule does not remain | Firmware failure or lack of memory | Reset the router to factory settings |
| The port is open, but the connection is not working. | Windows Firewall Blocks Port | Add an exception to the firewall for the program |
| The IP of the device is lost after restarting | Not fixed static IP | Reserve IP over DHCP (see section above) |
Another common mistake is to skip the wrong protocol, like Minecraft needs TCP, and Call of Duty needs UDP, and specify the port requirements in the game or program documentation.
How do I know what protocol is needed?
How to protect your network after opening ports
Open ports are like open windows in your home, and can be used by thieves as well as guests.
- ๐ Use complex passwords on devices that have ports open (especially for RDP or FTP).
- ๐ก๏ธ Update the routerโs firmware โ older versions have vulnerabilities.
- ๐ Turn off port port port port port port port port transfer when they are not needed (e.g. after play).
- ๐ Set up a guest network for open-port devices (if the router supports).
For maximum safety:
- Replace the standard router admin/admin password with a complex one.
- Disable remote access to the router control panel (Additional settings โ System โ Remote management).
- Use a VPN instead of direct dash for critical services (such as OpenVPN or WireGuard).
If you are using security cameras, you must:
- Turn off access via HTTP, leave only HTTPS.
- Set up two-factor authentication in the camera app.
- Check your connection log regularly for suspicious activity.