Opening ports on the Xiaomi router: full instructions for beginners and advanced

Why Open Ports on Xiaomi and When to Do It

Opening ports on Xiaomi routers is a procedure that is not required by all users, but becomes critical in several scenarios. For example, if you configure a home media server (Plex, Jellyfin), connect to the Internet. IP-Remote viewing camera or optimizing online games (CS2, Minecraft, GTA Without the right port configuration, these services will either fail or remain unavailable from the outside.

Modern Xiaomi routers (Mi Router 4A/4C, AX3600, AX6000, BE7000) block incoming connections from the Internet by default, which is a standard security measure. However, many users face problems when trying to skip the port: the settings are not saved, the external IP is dynamic, the providerโ€™s firewall interferes. In this article, we will analyze all the nuances from basic settings to solving typical errors.

It is important to understand the difference between Port Forwarding and DMZ. The first method points opens specific ports for a particular device on the LAN, and the second method sends ALL incoming connections to one device, which is less secure, and we recommend using DMZ only in extreme cases, for example, for testing.

Port Opening Preparations: What to Do Before Changes

Before you get into the settings of the router, follow a few mandatory steps, otherwise you risk wasting time or even disrupting the network.

  • ๐Ÿ”Œ Check the type WAN-If you have PPPoE, L2TP or PPTP, Ports may not work due to double-dip NAT (Especially important for providers such as Rostelecom or Beeline).
  • ๐Ÿ“ก Find out the external IP-Go to the website. 2ip.ru โ€” if IP Starts with 10., 172.16.-172.31. or 192.168., you have a gray (private) IP, The port transfer will not work without additional actions.
  • ๐Ÿ–ฅ๏ธ Set up a static. IP Port rollout only works for fixed local addresses, if your PC or camera receives IP down DHCP, After restarting the router settings will fly.
  • ๐Ÿ”’ Temporarily shut down the firewall Windows/macOS. Sometimes the problem is not the router, but the local firewall that blocks the ports.

If your ISP uses CGNAT (this is when multiple users are sitting at one external IP), port rollover is fundamentally impossible without buying white IP (usually a paid option).

๐Ÿ“Š What kind of Xiaomi router do you have?
Mi Router 4A/4C
AX3600
AX6000
BE7000
Another Xiaomi
Not Xiaomi.

Step-by-step: how to open a port on Xiaomi through the web interface

The most reliable way is to manually configure via the router admin panel, and the instructions are suitable for all modern Xiaomi models with MiWiFi firmware (including international versions).

  1. Connect to the router via cable or Wi-Fi. Open the browser and type in the address bar 192.168.31.1 (for most models) or miwifi.com. Sign in under the administrator (login and password are usually listed on the sticker below the router).
  2. Go to the section Additional โ†’ Redirect โ†’ Ports rollover (in English firmware: Advanced โ†’ NAT Forwarding โ†’ Port Forwarding).
  3. Click Add Rule and fill in the fields: Rule name: arbitrary (e.g., "Minecraft Server"). Protocol: select TCP, UDP or TCP/UDP (If you are not sure, put the last option. External port: the port that will be open from the outside (for example, the port that will be open from the outside, 25565 Internal port: usually the same as the external port, but may differ (for example, if you redirect) 8080 internal 80). IP-host address: local IP The device you open the port for (for example, 192.168.31.100).

Save the rule and restart the router through System Tools โ†’ Reboot.

Make sure the rule is kept in the list |Reboot router | Check the port via online service | Turn off the firewall on the target device | Try to connect from an external network (for example, from the mobile Internet)

-->

If the port does not open after setting up, check:

  • ๐Ÿ”„ Is the local area correctly indicated? IP The device (whether it has changed after the reboot).
  • ๐Ÿšซ Does the port block an antivirus (for example, Kaspersky or Kaspersky) ESET).
  • ๐ŸŒ Does the provider not use the NAT (check the outside IP before and after reconnecting to the Internet โ€“ if it changes, you have a dynamic IP).

Setup DMZ on Xiaomi: when it is justified and how to enable

DMZ (Demilitarized Zone) is a mode in which ALL external connections are redirected to a single device on the LAN, which is convenient for testing or if you need to open multiple ports (for example, for a game console), but using DMZ significantly reduces network security, since the device becomes completely vulnerable to attacks from the Internet.

To enable DMZ on Xiaomi:

  1. Come to the extra. โ†’ Redirection โ†’ DMZ.
  2. In the field IP-Host address, please indicate local IP devices (e.g. 192.168.31.100).
  3. Activate the switch Enable DMZ and save the settings.

DMZ is recommended to be used temporarily, for example:

  • ๐ŸŽฎ For game consoles (PlayStation, Xbox), if port rollover does not help.
  • ๐Ÿ–ฅ๏ธ For servers that need non-standard ports (e.g. TeamSpeak or Discord bots).
  • ๐Ÿ“น For IP-cameras with proprietary protocols (e.g. Hikvision or Dahua).

โš ๏ธ Attention: Never turn on DMZ for devices with vulnerable software (old versions of Windows, unupdated routers, smart devices with default passwords) this can lead to hacking your network.

UPnP on Xiaomi: Automatic Port Opening

UPnP (Universal Plug and Play) is a technology that allows devices on a local network to automatically open ports on a router, which is convenient for games, torrent clients or programs like Skype, but has serious security flaws.

To enable UPnP on Xiaomi:

  1. Go to the Supplementary โ†’ UPnP.
  2. Activate the switch Enable UPnP.
  3. Set up the Port Range (usually 1024-65535 by default).
  4. Save the settings.

The benefits of UPnP are:

  • โšก Automation: No need to manually roll ports for each program.
  • ๐ŸŽฎ Gamer-friendly: Most games (like Call of Duty or Fortnite) request port openings themselves.

The disadvantages of UPnP:

  • ๐Ÿ›ก๏ธ Security Vulnerabilities: Attackers can exploit UPnP to attack your network.
  • ๐Ÿ”„ Unpredictability: Software can open ports without your knowledge.

๐Ÿ’ก

If you only need UPnP for one program (like a torrent client), itโ€™s best to manually flip the necessary ports and disable UPnP globally.

Below is a table of ports that you most often need to open on Xiaomi routers. Note that some services use dynamic ports โ€“ in this case, you may need a range (for example, a range of ports, 30000-32000 Minecraft Bedrock).

Service/GamePorts (TCP/UDP)Appointment
Minecraft Java Edition25565 (TCP/UDP)The main port for connecting to the server
Counter-Strike 227015-27020 (TCP/UDP)Game servers and matchmaking
Plex Media Server32400 (TCP), 1900 (UDP)Remote access and device detection
IP-camera (RTSP)554 (TCP), 1935 (TCP)Streaming video and management
BitTorrent/Transmission6881-6889 (TCP)Incoming peering connections

If your service is not in the table, specify the required ports in the official documentation, for example, Valheim needs ports 2456-2458 (UDP), and Rust needs ports 28015-28016 (TCP/UDP).

The problem is that the port is not open โ€“ what to do?

If you have set up everything, but the port is still closed, use this diagnostic manual:

  1. Check the outside. IP: As mentioned earlier, if you have a gray IP, Solution: Buy white. IP by the provider (usually) 100-300 โ‚ฝ/Use a cloud tunnel (e.g. Cloudflare Tunnel or Ngrok).

Make sure the port is listening: a program must be running on the target device that "listens" to that port.

netstat -ano | findstr "PORT"

(Replace the port with the number, such as 25565).

Check out the Windows Firewall:

  • Open Control Panel โ†’ Windows Firewall โ†’ Additional settings.
  • Go to the Inbound Connections Rules and make sure your port is allowed.
  • Test from an external network: connect to the mobile Internet (not through your Wi-Fi!) and try to connect to your external IP and port. For example, in your browser type: http:///your external IP:PORT

Ports 80 and 443 will be available for transfer.

Do I need to open ports for qBittorrent (uTorrent)?
Technically not โ€“ torrents will work without open ports, but with two limitations: ๐Ÿ“‰ Loading speeds may be lower (especially if you have few seats). ๐Ÿ”’ Your client won't be able to receive incoming connections, which makes it harder to get the message out. If you still decide to open a port for torrenting, use it. TCP and select a port in range 49152-65535 (This will reduce the likelihood of conflict).
How to check if the port is open from the Internet?
There are a number of ways: ๐ŸŒ Use online services: 2ip.ru/check-port or yougetsignal.com. ๐Ÿ’ป From a computer outside your network, execute the command: telnet your external_IP If the connection is established, the port is open. ๐Ÿ“ฑ From your mobile phone (connected to the mobile Internet, not your Wi-Fi), try connecting to the service that opened the port.
Can I open ports on Xiaomi without white IP?
Yes, but with reservations: ๐Ÿ”„ If you have dynamic white IP (Changes when you reconnect, use the service DDNS (For example, No-IP or built-in router Xiaomi DDNS). ๐ŸŒ If you have gray IP (CGNAT), Port rolling won't work. Alternatives: Buy white IP Use a reverse proxy (e.g. Cloudflare Tunnel or Ngrok). VPN-server on the router and connect to it.