How to open ports on the Xiaomi router: full instructions with pictures and tips

Opening ports on a Xiaomi router is a necessary procedure for gamers, server administrators or users who need to remotely connect to home devices. Without properly configuring port forwarding, many network applications โ€” from Minecraft server to video surveillance system โ€” simply wonโ€™t work outside the local network. However, the interface of Mi Router routers (especially the 4A Gigabit, AX3600 or Redmi Router AC2100 models) often raises questions even among experienced users.

In this article, we'll look at not only the basic steps of opening ports, but also the common mistakes that lead to the overlay not working, how to check if the port is open, what DMZ and UPnP settings might interfere with, and why you sometimes have to manually write rules in iptables. And for those who are afraid of breaking something, we've prepared a unique safe port table for popular services that can be opened without risk to security.

Why open ports on the Xiaomi router?

By default, all external connections to your home network are blocked by the router's firewall, which protects devices from hacker attacks, but also limits the functionality of many programs.

  • ๐ŸŽฎ Online Games: for hosting the Minecraft server, CS:GO Valheim needs open ports 25565, 27015 and others.
  • ๐Ÿ“ก Remote Access: Connecting to a Home PC via RDP (port 3389) or SSH (port).
  • ๐Ÿ“น Video surveillance: Xiaomi or TP-Link cameras often require port rollovers to view over the internet.
  • ๐Ÿ’พ File servers: FTP (Port 21, Nextcloud or Samba to access data from anywhere in the world.
  • ๐ŸŒ Web servers: If you have a website on your home PC, you will need to open 80 ports (HTTP) 443 (HTTPS).

Without port rollover, these services will only be available on your local network, such as friends will not be able to connect to your Minecraft server, and you will not be able to remotely control your computer through TeamViewer unless you set up rules on the router.

โš ๏ธ Warning: Opening ports reduces network security. Always use strong passwords for the services you access and limit your range whenever possible. IP-addresses that are allowed to connect.

Preparation for port transfer: what do you need to know?

Before opening ports, make sure all the preconditions are met:

  1. Static IP-Address: If your PC or server receives IP down DHCP, It can change after the router restarts, and port overhead will stop working. IP locally.
  2. The right external IP: Check that you are white (public) IP-address, not gray (private) if your provider uses CGNAT, Port transfer may not work.
  3. Access to the router admin panel: by default, login is at 192.168.31.1 (or miwifi.com) with the login and password specified on the device sticker.

To check if you have white IP, go to 2ip.ru and compare the address shown to what is displayed in the router settings (Status โ†’ Network Card). If they are different, you have CGNAT, and you will need to contact the provider to pass the ports.

๐Ÿ“Š What kind of Xiaomi router do you have?
Mi Router 4A
Mi Router 4C
Mi Router 5/Pro
Redmi Router AX6
Other

Step-by-step: how to open a port on Xiaomi

Consider the process with the MiWiFi firmware (relevant to most models, including the Mi Router 4A Gigabit and AX3600). If you have an alternative firmware (Padavan or OpenWRT), the steps may differ.

Step 1: Entrance to the admin panel

Open your browser and type in 192.168.31.1 or miwifi.com. Sign in with your login and password (the default is admin and password from the sticker on the router). If you changed the login data but forgot it, you will have to reset the router with the Reset button.

Step 2: Go to the port port port forwarding section

From the router menu, select:

Additional settings โ†’ Redirection โ†’ Port Forwarding

Step 3: Creating a pass rule

Click Add the rule and fill in the fields:

  • Rule name: An arbitrary name (e.g., Minecraft Server).
  • Protocol: Select TCP, UDP, or TCP/UDP (if you are not sure, choose the latter option).
  • External port: A port that will be open to the Internet (e.g. 25565 for Minecraft).
  • Internal port: Usually the same as the external port, but may differ (e.g. if you redirect the 8080 to the internal 80).
  • Internal IP-address: static IP devices on a local network (e.g. 192.168.31.100).

Example of filling for RDP:

Field.Meaning
Name of the ruleRemote Desktop
ProtocolTCP
Outer port3389
Inland port3389
Internal IP192.168.31.50

Step 4: Preservation and verification

Click Save and restart the router, and then check if the port is open using services like YouGetSignal or PortChecker.

Checked static. IP device|The correct protocol was chosen (TCP/UDP)|The external and internal ports are the same (unless you redirect)|Correct internal information IP|The router is not in "Guest Network" mode"-->

To avoid guessing which ports to open, use our table. Note that some services require multiple ports to be opened (e.g., FTP needs 20-21 for data and commands).

ServicePorts (TCP/UDP)Note
Minecraft (server)25565 (TCP/UDP)For mods, 25566-25570 may be required.
RDP (Remote Desktop)3389 (TCP)It is recommended to change the standard port in the Windows registry.
SSH22 (TCP)Always change the default port for security.
FTP20-21 (TCP)Passive mode requires ports. 50000-51000.
HTTP/HTTPS80 (TCP), 443 (TCP)For the web server, be sure to set up HTTPS.

โš ๏ธ Note: Ports 80 and 443 are often blocked by ISPs. If the web server is not working, try redirecting the external port 8080 to the internal 80.

Common mistakes and their solutions

If the port does not open after the drop, check the following points:

  • ๐Ÿ”Œ Router is not rebooted: after saving the rules, be sure to restart the device.
  • ๐Ÿ›ก๏ธ firewall Windows/macOS: Even if the port is open on the router, the local firewall can block the connection.
  • ๐Ÿ”„ UPnP conflict: If UPnP is enabled, it can automatically close ports. Try turning it off in Additional Settings โ†’ UPnP.
  • ๐ŸŒ CGNAT The provider: if you have a gray IP, port transfer is not possible without additional services from the provider (for example, dedicated IP).
  • ๐Ÿ”— Incorrect internal IP: Make sure that the device you are opening the port for is the one you are using. IP, rule-listed.

If you are using dual NAT (for example, the router is connected to another router), you need to configure port rollover on both devices, and check if DMZ mode is on, as it may conflict with manual rules.

How to check if the port is open without third-party services?
In Windows, open the command line and type: telnet [your external IP] [port] If the screen clears or the cursor appears, the port is open. If the connection fails, the port is closed. On macOS/Linux, use the command: nc -zv [your external IP] [port]

How to open ports without risk?

Opening ports makes your network more vulnerable to attacks, and follow these tips to minimize the risks:

  • ๐Ÿ”’ Change the standard ports: for example, instead of 3389 for RDP use 3390 ox-port 10000-60000.
  • ๐Ÿ›ก๏ธ Set the limit to IP: In the squash rule, specify the permitted IP-addresses (if they are static).
  • ๐Ÿ”„ Turn off the airdrop when it is not needed: for example, if the Minecraft server works only on weekends, close the port on weekdays.
  • ๐Ÿ”‘ Use it. VPN: Instead of opening ports for the entire Internet, set up WireGuard or OpenVPN on the router.

For maximum security, consider alternatives to port port port port transfer:

  • Cloud Proxies: Services like Cloudflare Tunnel or Ngrok allow you to access local services without opening ports.
  • Reverse SSH: If you need access to a home PC, set up the reverse. SSH-connection via intermediate server.

๐Ÿ’ก

Before opening an FTP port, be sure to set up SFTP (port 22) instead of standard FTP (port 21) โ€“ this will protect your data from being intercepted.

Features of port port port transfer on different models Xiaomi

The interface and port port port port port port capabilities may vary depending on the router model and firmware version.

Model routerFeatures of port port transferFirmware
Mi Router 4A GigabitSupports up to 32 rules of thumbing, no TCP/UDP separation in some firmware versions.MiWiFi (stack)
Mi Router AX3600There is a separate section for DMZ. Supports port ranges (e.g., port ranges, 30000-30010).MiWiFi / OpenWRT
Redmi Router AC2100In some firmware, port port port forwarding is called Virtual Servers.MiWiFi
Mi Router ProSupports Port Triggering for complex scenarios.Padavan (castom)

If you have custom firmware (Padavan or OpenWRT), the port rolling process will be different, for example, in OpenWRT, the rules are configured via LuCI or /etc/config/firewall configuration.

๐Ÿ’ก

On routers with Padavan firmware, port port rollover is configured in the NAT โ†’ Port Forwarding section, and for OpenWRT you will need to edit the /etc/config/firewall file.

FAQ: Frequent questions about opening ports on Xiaomi

โ“ Why is the port closed after the transfer?
There are several reasons: the provider uses CGNAT (you have a gray IP). Local firewall (on a PC or router) blocks the connection. Incorrectly specified internal IP of the device. The router did not restart after saving the rules. Check each item in order. If there is a problem in CGNAT, contact the provider for a dedicated IP.
โ“ Can I open the port for the entire range? IP?
Yes, but it's not safe. If the pass rule doesn't specify a specific IP, the port will be open to anyone who knows your external address, and it's better to restrict access to only trusted IPs (like your desktop PC).
โ“ How to open a port for Xiaomi camera?
Xiaomi cameras (e.g. Mi Home Security Camera) typically require: Open port 80 (HTTP) or 443 (HTTPS). Set up a static IP for the camera on the LAN. Enable RTSP in the camera settings (if video stream is needed). Note: many Xiaomi cameras work through the cloud, and port rollover may not be necessary.
โ“ What is it? DMZ and when to use it?
DMZ (Demilitarized Zone is a mode in which one device on the LAN is fully open to incoming connections from the Internet. DMZ You have to open many ports for one device. You're testing the server, and you don't want to manually configure each port. You have an old device that doesn't support port-overloading. โš ๏ธ Dangerous: device in DMZ It becomes vulnerable to attack. Use only temporarily!
โ“ How to close the port after use?
To close the port, go to Portsdrop, find the rule you want, and click Delete. Then reboot the router. If the port was opened through UPnP, it will close automatically after the session is over (for example, after you quit the game).