Port forwarding (or port forwarding) is a key feature for gamers, server administrators and users who need remote access to devices on the local network. On Xiaomi devices โ whether they are Mi Router routers, Redmi AX6 or even Mi TV smart TVs โ this procedure has its own nuances associated with proprietary MIUI firmware and MiWiFi interface. Unlike standard solutions, it often requires to bypass manufacturer restrictions, especially on devices with Chinese firmware.
In this article, we will not only discuss the basic steps for port port port port port port port port port port forwarding, but also consider hidden settings that Xiaomi does not advertise in the official documentation, as well as ways to diagnose typical errors (for example, when the port does not open despite the correct settings). The material is relevant for devices on firmware 2023โ2026 Years including models with support IPv6 and dual-band networks 2.4/5 GHz.
What is port port transfer and why it is needed on Xiaomi
Port rollover allows you to redirect external requests from the Internet to a specific device on your local network, for example, if you run a home server on a Raspberry Pi or want to connect to the Xiaomi Mi Home security camera from the outside, without port rollover, this will not be possible.
- ๐ฎ Online Games: Improved Connection in Minecraft, Counter-Strike or GTA Online by connecting directly to the game server.
- ๐ฅ๏ธ Remote Access: Connecting to a Home PC via RDP or SSH (relevant to the Mi Router 4A Gigabit and newer).
- ๐น Video surveillance: access to stream from Xiaomi Mi Home Security Camera via mobile app off-home.
- ๐ Web servers: website hosting or Nextcloud on a local server with white IP-address.
It is important to understand that port rollover works only if there is a static port. IP-Addresses (or reserved) DHCP) the target device and the white IP Your router, if your ISP uses CGNAT (For example, Beeline or MTS in some regions, port port transfer will not be possible without additional services (for example, dedicated services). IP).
โ ๏ธ Attention: On Xiaomi routers with Chinese firmware (CN ROM) Port rollover can be blocked even in the web interface, in which case you will need firmware on Global. ROM use SSH manually.
Preparation for port port port transfer: network and equipment inspection
Before you start setting up, make sure your network is ready to roll. Here's a checklist of mandatory conditions:
Make sure the router is connected to the Internet via WAN-port USB-modem)
Check that the target device (PC, server, camera) has a static IP on the local network
Disable the firewall on the target device temporarily for tests
Know the outside IP-Router address (must be white, not grey)
Update the routerโs firmware to the latest version (via MiWiFi or manually)
-->
To check if your external IP is white, go to 2ip.ru and compare the address to what appears in the routerโs web interface (Status โ Internet). If the addresses are different, your ISP uses NAT, and port rollover will not work without additional actions.
For Xiaomi devices, it is also critical to update the firmware. For example, in older versions of MiWiFi for Mi Router 3G, there was an error that caused port spillage to reset after rebooting. In 2023+ firmware, this bug is fixed, but on Chinese versions (CN) it may require manual installation of Global ROM.
Mi Router 4A Gigabit
Redmi AX6/S/Pro
Mi Router 3/3G/3C
Mi AIoT Router AX3600
Another (write in the comments)-->
Port transfer on Xiaomi routers: step-by-step instructions
Consider the popular Redmi AX6. Other routers (Mi Router 4A, AX3600) may have slightly different interfaces, but the logic remains the same. Importantly, all settings are done via the web interface, since the Mi WiFi mobile application does not support port port overlay.
- Connect to the router via cable or Wi-Fi. Open your browser and go to 192.168.31.1 (or 192.168.0.1 for some models).
- Go to the section Additional settings โ Port Forwarding.
- Click Add Rule and fill in the fields: Rule name: arbitrary (e.g., "Minecraft Server"). Protocol: select TCP, UDP or TCP/UDP. External port: port that will be open outward (e.g., 25565 for Minecraft). Internal port: port on the target device (often the same as the external one). Internal IP: local IP device (e.g., 192.168.31.100).
Save the rule and restart the router through System Tools โ Reboot.
For supported models IPv6 (for example, AX3600) In the section Redirection will appear an additional tab IPv6 Port Forwarding. Settings are similar but require IPv6-provider.
๐ก
If the port doesnโt open after saving the rule, try disabling the UPnP function in the router settings (Additional Settings โ UPnP).
Ports rollout on Xiaomi TVs (Mi TV)
Few people know, but smart TVs Xiaomi Mi TV (For example, the Mi models TV 4S, Mi TV Q1) It also supports port port port port transfer for certain services, such as DLNA-server or remote control through ADB. But there are nuances:
- ๐ The transfer only works for local ports (for example, to access the port). ADB over Wi-Fi within a network).
- ๐ซ You canโt skip ports to access from the Internet โ this is a PatchWall firmware restriction.
- ๐ง For activation ADB You need to turn on the developer mode (go to Settings). โ About TV and 7 times click on the Android version TV).
To open the port for ADB:
- Turn it on. ADB-Debugging in the developer settings (Settings) โ For developers โ Debugging by ADB).
- Connect your TV and computer to the same network.
- On PC, run the command: adb connect 192.168.31.XXX:5555 where XXX โ last-minute IP-TV address.
โ ๏ธ Note: On Xiaomi TVs with firmware older 2022 port 5555 for ADB This can be blocked by default, and you will need to manually change the configuration file. /system/build.prop Magisk (root rights required).
Common mistakes and their solutions
Even with the right settings, port overlay may not work, and here are the typical problems and ways to fix them:
| Mistake. | Possible cause | Decision |
|---|---|---|
| Port not open (checking via canyouseeme.org shows error) | The provider uses CGNAT or blocks ports. | Order static IP from the provider or use Cloudflare Tunnel/Ngrok |
| The rollover rule is reset after the router is restarted | Firmware bug (relevant to Mi Router 3G on older versions) | Update the firmware or use the auto-setting script via SSH |
| Port open, but no connection is established | Firewall on target device blocks incoming connections | Disable the firewall temporarily or add an exception for the port |
| There is no Port Forwarding section in the web interface | Chinese firmware (CN ROM) with limited functionality | Switch Global ROM or use SSH to manually configure iptables |
If you encounter a โPort is not openโ error when checking, make sure that:
- The target device is on and connected to the network.
- It runs an application/service that uses a probe port (for example, a game server).
- The port is not occupied by another process (check through the command netstat -ano | findstr:PORT on Windows).
How to check if the port is open without external services?
Port transfer via SSH (for advanced users)
If the routerโs web interface does not allow for configuring the spread (for example, on Chinese firmware), you can use SSH. This method requires root access and is suitable for models based on Qualcomm or MediaTek chips (for example, Mi Router 4A Gigabit, Redmi AC2100).
Steps to set up via SSH:
- Activate SSH on your router. To do this: Download the MiWiFi SSH Enabler utility (the official tool from Xiaomi). Connect to the router via Wi-Fi and launch the utility (it will automatically turn on SSH and show the password).
Connect to the router via SSH (e.g., via PuTTY or Terminal):
ssh root@192.168.31.1The password is the one that generated the utility.
Add the rule of skipping with iptables:
iptables -t nat -A PREROUTING -p tcp --dport External port -j DNAT --to-destination Local IP:Inner port
iptables -A FORWARD -p tcp -d Local IP --dport Indoor port -j ACCEPTFor example, to roll port 8080 to a device with IP 192.168.31.100:
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 192.168.31.100:8080Keep the rules to apply after the reboot:
iptables-save > /etc/iptables.rulesThen add a line to /etc/rc.local:
iptables-restore < /etc/iptables.rulesโ ๏ธ Attention: Incorrect iptables commands can disrupt the network.Before experimenting, back up the current rules: iptables-save > /tmp/iptables_backup.rules
๐ก
On Xiaomi routers with OpenWRT-based firmware (such as some versions for Mi Router 4C), port rollover is configured via /etc/config/firewall. This is a more flexible method, but requires knowledge of UCI syntax.
Alternative ways to pass ports without setting up a router
If port port port overflow on the router is not possible (for example, due to CGNAT), you can use workaround solutions:
- ๐ Cloudflare Tunnel: a free service for creating secure tunnels to local resources. SSH.
- ๐ Ngrok: utility to flip ports through the cloud.free tariff limits traffic, but enough for tests.
- ๐ Reverse SSH: If you have an external server (VPS), reverse-tune SSH-connection to access local devices.
- ๐ก Hamachi/ZeroTier: virtualization (VPN), where devices can "see" each other as if they were on a local network.
For example, to set up Cloudflare Tunnel:
- Install cloudflared on the target device (PC or server).
- Sign in with the command: cloudflared tunnel login
- Create a tunnel and specify a local port: cloudflared tunnel --url http://localhost:PORT
- Set up. DNS-recording in the Cloudflare panel to link the domain to the tunnel.
The advantage of this approach is the lack of dependence on router settings and the ability to use even for CGNAT. The disadvantage is an additional delay (ping) due to intermediate servers.