Opening ports on the Xiaomi router: a complete guide for beginners and advanced users

Opening ports on the Xiaomi router is a task faced by smart home owners, gamers, administrators IP-And the camera people, the people who deploy the home servers, although it's so complicated, the port forwarding procedure on the Mi Router devices is actually a very simple one. 4/4A/5/AX no more 10 Now, if you know the nuances of MiWiFi, the main problem most users have is not understanding which port to open (TCP, UDP Or both) and how to properly link it to the local IP-device.

In this article, weโ€™ll look at not only the basic setup steps, but also the common mistakes: why a port might not open even after the correct configuration, how to check the result with telnet or online services, and what to do if your ISP blocks incoming connections. Special attention will be paid to alternative methods โ€” DMZ UPnP, which are sometimes easier than the classic pass.

Port Opening Preparations: What You Need to Know in Advance

Before you start setting up your router, make sure you understand three key points:

  • ๐Ÿ”Œ Local. IP The device must be static (fixed in a fixed DHCP). If IP Changes with each connection, the port will stop working.
  • ๐ŸŒ Outside IP Your network must be white (not gray like most providers). 2ip.ru.
  • ๐Ÿ”’ The port you open should not conflict with other services (for example, port 80 is often occupied by the routerโ€™s web server).

If your ISP uses CGNAT (Common External Multi-Subscriber IP), you won't be able to open ports in the standard way.

  1. Buy from the provider dedicated IP-address (paid, ~100-300โ‚ฝ/month).
  2. Use services like Ngrok or Cloudflare Tunnel to circumvent restrictions.
๐Ÿ“Š What kind of Xiaomi router do you have?
Mi Router 4A
Mi Router 4
Mi Router 5
Mi Router AX
Other

Step 1: Enter the control panel of the Xiaomi router

To start setting up, connect to the router network and open the browser. In the address bar, enter one of the following addresses:

  • 192.168.31.1 is the standard IP for most Xiaomi models.
  • miwifi.com โ€“ Alternate address (works if the DNS is not lost).

If the page does not open:

โš ๏ธ Warning: Make sure you are connected to the Xiaomi router network, not the repeater or Mesh system. Also check if your network settings have gone wrong after the device is reset.

After entering the address, you will be met by an authorization window.

  • Login: admin
  • Password: Admin or Wi-Fi password (depends on firmware).
What to do if you canโ€™t get in?
If you forget your password, reset the router to factory settings by holding the Reset button for 10-15 seconds. After resetting, the login data will return to the standard (admin/admin).

Step 2: Set up a static IP for your device

Port rollover works only on a fixed local IP. If your device (camera, server, game console) receives IP automatically via DHCP, the port may "fall off" after restarting the router. To avoid this, fix the IP in the settings.

Instructions:

  1. Go to Settings โ†’ Local Network โ†’ DHCP.
  2. Find the IP and MAC binding section (or Static DHCP in English firmware).
  3. Click Add and enter: MAC-Device address (can be found in its settings or in the router's list of connected clients). IP (for example, 192.168.31.100).

Save the settings and restart the router.

Make sure the device is connected to the router|Write it down. MAC-address|Choose a free one IP in the range 192.168.31.2-192.168.31.254|Check that the allocated IP It does not conflict with other devices.-->

Step 3: Port Forwarding (Port Forwarding)

Now, to the main stage, in the router control panel:

  1. Open Settings โ†’ Redirect โ†’ Port Flip (or Advanced โ†’ NAT Forwarding โ†’ Port Forwarding in firmware in English).
  2. Click Add rule and fill in fields: Field Value Example Rule Name Random name (e.g., "Camera") Minecraft Server Protocol TCP, UDP or both (depending on application requirements) TCP/UDP External Port Port Port that will be opened "out" 25565 Internal Port Port Port Port on a local device (often the same as an external one) 25565 Internal IP Local IP Device (the one we pinned earlier) 192.168.31.100
  3. Save the rule and apply the settings.

Critical detail: if you open a port for a game server (e.g. Minecraft), make sure that the server settings have the same port as the roll rule. For example, if server.properties has a server-port=25565 and you open 25566 on the router, you wonโ€™t be able to connect.

๐Ÿ’ก

If you want to open a range of ports (for example, for a torrent client), in the fields "External / Inland port" specify them in dash: 50000-50010.

Step 4: Checking the Open Port

After setting up, make sure to check if the port is open, and you can do this in several ways:

  • ๐ŸŒ Online services: 2ip.ru/check-port Or YouGetSignal. Enter your external IP port number.
  • ๐Ÿ’ป telnet command: On another device on the network, execute: telnet [your external_IP] [port ] If the connection is established, the port is open.
  • ๐ŸŽฎ In-game/app test: Try connecting to the server from an external device (e.g., from a phone over the mobile internet).

โš ๏ธ Warning: If the port doesn't open, check: Is the firewall blocking the target device (turn it off temporarily for the test) is the port conflicting with other services (e.g. 80 is often occupied by the router's web interface). Is the provider using the router's web interface? CGNAT (in this case, externally IP will coincide IP other subscribers).

Alternative methods: DMZ and UPnP

If port port port transfer is not working or many ports are required to be opened (for example, for the purpose of port port port port transfer). P2P-Networks, consider alternatives:

1. DMZ (Demilitarized Zone)

DMZ redirects all external ports to one device on the LAN, which is convenient but insecure, and makes the device vulnerable to attack, and only use it when you are sure of protecting it (updated antivirus, disabled unnecessary services).

How to set up:

  1. Go to Settings โ†’ Redirect โ†’ DMZ.
  2. Enable the function and specify the local IP device.
  3. Save the settings.

2. UPnP (Universal Plug and Play)

UPnP allows devices to automatically open ports without manually configuring.comfortable for gaming (like Call of Duty or GTA Online), but can create security holes.

How to turn on:

  1. Go to Settings โ†’ Redirect โ†’ UPnP.
  2. Activate the function and save the changes.

๐Ÿ’ก

UPnP is convenient, but not all applications support it, such as Minecraft servers that don't automatically open ports, but you need manual diffuse.

Typical errors and their solutions

Even after you set the port up properly, you might not open it, and let's look at the most common reasons.

Problem.Reason.Decision
The port is not open, although the rule is created.The provider blocks incoming connections (CGNAT)Buy a dedicated IP or use Ngrok
Port open, but no connection is establishedFirewall on target device blocks portDisable the firewall temporarily or add an exception
The rule of throwing disappears after rebootingRouter firmware reset or rule not savedUpdate the firmware or create the rule again
You canโ€™t save the rule (button is inactive)Incorrectly filled fields (e.g., IP out of range)Check the entered data for errors

If youโ€™re using the Mi Router AX6000 or other models with MiWiFi ROM firmware, note the bug: sometimes the rollover rules donโ€™t apply until the router is rebooted via the web interface (rather than through the button on the case).

FAQ: Frequent questions about opening ports on Xiaomi

Can I open a port to access the router from the Internet?
Technically, but it's extremely insecure. Opening port 80 or 443 for remote router management makes it vulnerable to hacking: VPN-server on router (if supported by firmware) Cloud access via Mi WiFi app (requires a Xiaomi account).
How to open the port for IP-camera?
For most cameras (e.g. Xiaomi Mi Home Camera) you need to open: Port 80 (HTTP) 443 (HTTPS) Port 554 for web access (RTSP) Port 1935 for streaming video RTMP (If the camera is on YouTube, don't forget to attach it. IP camera-setting DHCP!
Why is the game not visible on the network after the port is dropped?
The reasons may be: The game uses the wrong port you opened (check the game documentation); the PC with the game has a Windows firewall or antivirus (add an exception to the game); the provider blocks the UDP protocol (try to open both TCP and UDP protocols); For Minecraft, also check the server.properties file - the online-mode parameter must be false if you use the pirated version.
How do you close an open port?
To delete the roll rule: Go to Settings โ†’ Redirect โ†’ Port Flip. Find the right rule in the list and click Delete. Save settings and restart the router. If the port is still open, check if UPnP is enabled, it could automatically create the rule.
Can I open a port on the Xiaomi router through a mobile application?
The official Mi WiFi app does not have port rollover functionality, but can only be configured via the web interface (192.168.31.1). However, some firmware (e.g. Padavan) does have advanced functionality, including port management from the application.