Port rollover on Xiaomi routers is a necessary procedure for organizing remote access to home devices, launching game servers (Minecraft, CS2), connection IP-Despite the unified MiWiFi interface, users often encounter errors due to firmware or network settings, this article covers all the steps: From network preparation to testing of open ports, taking into account the nuances of the latest software versions (2023-2026.).
It's important to understand that opening ports reduces network security if you don't follow the basic rules. For example, rolling over port 3389 for RDP without changing the standard password can lead to a hack in a few hours. We'll take a look at not only the technical side, but also the protections, from enabling DMZ to configuring fail2ban on the connected server.
Preparation for port port port transfer: network and equipment inspection
Before setting up your router, make sure your ISP does not block incoming connections. Many operators (such as Rostelecom or Beeline) use the default router. CGNAT โ Technology where your router gets a โgrayยป IP-You can check this out on the website. 2ip.ru: if IP The same address in the personal account of the provider โ CGNAT absent.
If CGNAT is detected, you will need to:
- ๐ Order a static white service provider IP (fee, ~100โ300 โฝ/moss).
- ๐ Use services like Ngrok or Cloudflare Tunnel to circumvent restrictions (free but with traffic restrictions).
- ๐ง Switch to a tariff with real support IP (For example, โHome Internet Proโ at MTS).
Also check the router model. Some Xiaomi budget devices (such as the Mi Router 4A Gigabit Edition) have limited port port port port port port port port port port port port port port portability in stock firmware, and alternative software like OpenWRT or Padavan will help, but installing it requires unlocking the bootloader.
Log in to the router web interface and basic settings
To open ports, log in to the router control panel first.
- Connect to the router network via Wi-Fi or cable.
- Open your browser and type in 192.168.31.1 (for most Xiaomi models) or miwifi.com.
- Enter the login and password (by default โ admin/admin, unless changed).
If the page does not open:
- ๐ Make sure the cable is connected to the port. WAN (usually blue).
- ๐ Reset the router with the Reset button (hold 10 seconds).
- ๐ก Check what your device is getting. IP-address automatically (in the settings of the network connection should be DHCP).
After you log in, update your router firmware: go to General Settings โ Firmware Update. The current version of the software fixes vulnerabilities and adds support for new protocols (such as IPv6).
๐ก
If the router requests a password from your Xiaomi account but you havenโt tied it, reset the settings with the Reset button and reset the device without being linked to your account.
Static adjustment IP-device-address
Port rollover only works for fixed local IP devices. If your PC or server receives a DHCP address, it can change after the router restarts and the rollover will stop working.
- Reservation of IP in the router (recommended):
Go to Additional Settings โ Local Network โ IP and MAC binding. Press Add, select the device from the list and save. Now the router will always give it the same IP.
- Manual IP setting on the device:
On Windows: Control Panel โ Network & Internet โ Network Control Center โ Change Adapter Settings. Select Connection, click Properties โ IP version 4 and enter data manually (e.g., 192.168.31.100 with 255.255.255.0 mask and 192.168.31.1 gateway).
Critical error: If you assign a static IP manually, but it falls within the DHCP range of the router (e.g. 192.168.31.2-192.168.31.100), there will be an address conflict. Always check the DHCP range in the router settings (Local Area โ DHCP Settings) and select the IP outside of it.
| Parameter | Meaning for Xiaomi | Example |
|---|---|---|
| IP-router | 192.168.31.1 | โ |
| DHCP range | 192.168.31.100โ192.168.31.200 | Indicated in router settings |
| Static IP for the device | Beyond DHCP | 192.168.31.99 or 192.168.31.201 |
| Subnet mask | 255.255.255.0 | โ |
| Gateway | IP router | 192.168.31.1 |
Port Forwarding on the Xiaomi router
Now, let's get to the main setting. In the router control panel,
- Open the section Additional settings โ Redirect โ Port forwarding.
- Click "Add rule."
- Fill in the fields:
- ๐ Rule name: arbitrary (e.g., Minecraft Serverยป).
- ๐ก Protocol: Select TCP, UDP or TCP/UDP (Most games and services are suitable TCP).
- ๐ข External port: port that will be open from the outside (e.g. 25565 for Minecraft).
- ๐ Internal port: port on a local device (may coincide with an external port).
- ๐ฅ๏ธ IP-address: static IP The device for which you open the port.
Example for Minecraft Server:
Name: Minecraft
Protocol: TCP
Outer port: 25565
Inland port: 25565
IP- Address: 192.168.31.100Once the rule is saved, the router will restart. If the port does not open, check:
- ๐ฅ firewall Windows/Linux: It can block incoming connections. Open the port in the firewall settings.
- ๐ Double. NAT: If you have two routers (for example, from a provider) + Xiaomi, the sling needs to be configured on both.
- ๐ก UPnP: If it's on, it can conflict with manual rules. Turn it off in Additional Settings โ UPnP.
The port is not used by another service.|IP-address|The protocol was chosen correctly.|The external and internal ports are the same (unless you need to mask)|The rule is saved and applied (the router has restarted)-->
DMZ settings and alternative methods of transfer
If port rollover is not working or you need to open all ports for a single device (for example, for testing), use DMZ (Demilitarized Zone). This redirects all external connections to the selected IP, which is convenient but extremely insecure.
To enable DMZ on Xiaomi:
- Go to Additional Settings โ Redirect โ DMZ.
- Enter the static IP device.
- Save the settings and restart the router.
โ ๏ธ Attention: DMZ expose all device ports to the Internet, including vulnerable services (e.g., Telnet or FTP). Use only temporarily and necessarily:
- ๐ Set up a firewall on your device (e.g., ufw allow). 22/tcp for SSH).
- ๐ Disable unnecessary services (systemctl stop) apache2).
- ๐ก๏ธ Update to the latest version.
Alternative methods of dripping:
- ๐ Cloud spread: Ngrok or LocalXpose services create a tunnel without router settings.
- ๐ IPv6: if the provider supports IPv6, You can open the port directly via firewall-cmd (Linux).
- ๐ Double pass: if you have two routers, set up the pass on the first (provider) to the IP The second (Xiaomi) and then the target device.
What happens if the port does not open?
Open port testing and troubleshooting
After you set up the dashboard, check if the port is available from the Internet.
- ๐ YouGetSignal โ Checking a specific port.
- ๐ PortChecker โ Supports port ranges.
- ๐ก๏ธ On Linux sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT sudo ufw allow 25565/tcp โ ๏ธ Note: If you are testing a port from the same device you are sniffing to (for example, from a PC behind a router), use an external port. IP Or a domain. Local connection. 127.0.0.1 or 192.168.x.x bypass NAT, And the port may appear closed, even though it's open to external connections. Security: how to protect open ports. Open ports are a potential vulnerability: ๐ Change the standard passwords: SSH (port 22), RDP (3389), FTP (21). Use generators like Bitwarden. ๐ Limit the range IP: In the squash rule, specify the permitted IP (For example, only for your work network. ๐ก๏ธ Use it. fail2ban: program IP After several failed attempts to connect. Install on Linux: Sudo apt install fail2ban sudo systemctl enable fail2ban For game servers (such as Minecraft): ๐ฎ Set up a whitelist (whitelist)=true in server.properties). ๐ Turn it off. RCON, if you don't use. ๐ก Update your server software regularly, if you want to access files remotely, instead of opening ports. FTP or SMB (It is not safe!) use it: ๐ Nextcloud + Letโs Encrypt (HTTPS). ๐ Syncthing (P2P, portless). ๐ฆ SFTP through SSH (Port 22 with an authentication key). ๐กNever open ports 135-139 (SMB), 445 (SMB over IP), 3389 (RDP) without extreme necessity โ they are most often scanned by bots for attacks. FAQ: Frequent questions about port port port transfer on Xiaomi โ Why is the port still closed after the rollover? The reasons may be: The provider uses the port. CGNAT (check IP on 2ip.ru). Firewall on the device blocks the port (turn it off temporarily for the test). IP-The device address has changed (set up static). IP). The port is occupied by another service (check via netstat or ss). โ How to open the port for IP-For cameras (e.g. Xiaomi Mi Home Camera): Assign the camera a static camera IP Router, run the ports. TCP 80 (HTTP) and TCP 554 (RTSP). In the camera settings, enable access to RTSP (usually in the "Network" section. DDNS (For example, No-IP, if you have a dynamic IP. โ ๏ธ Do not open access to the camera without a password โ this will allow anyone to view video! โ Can I open ports without static? IP Yes, but with limitations: Use DDNS (For example, DynDNS or No-IP for linking a domain to a dynamic domain. IP. Set up Cloudflare Tunnel or Ngrok to get around CGNAT. For games (e.g, CS2) Sometimes you get UPnP, but it's less reliable. IP The connection will break and you will need to reconnect. โ How to close the port after use? To remove the rollover rule: Go to Additional settings โ Redirection โ Port forwarding. Find the rule you want and click Delete. Save the settings and reboot the router. Also check if it's disabled. DMZ (Is the port in the firewall of the device closed. โ Does port port port port port port porting work on Xiaomi routers with alternative firmware? Yes, but the setting is different: OpenWRT: rollover rules are configured in the /etc/config/firewall or through the LuCI web interface. Padavan: section NAT โ Port Forwarding, a stock interface. Advantages of alternative firmware: Support IPv6 And WireGuard, more flexible firewall rules, no link to Xiaomi account. โ ๏ธ Installation of custom software can deprive warranty and damage the router in case of errors!