How to configure ports on the Xiaomi router: full instructions

Modern home networks require flexible traffic management, especially if you are using Xiaomi hardware. IP-Port Forwarding is a mechanism that allows you to redirect incoming traffic from a particular router port to a particular device within the local network.

Without the right NAT (Network Address Translation) configuration, your router acts as a strict filter, blocking unsolicited incoming connections, providing basic security, but creating problems for peer-to-peer gaming, torrenting, or remote video surveillance. In this article, we will discuss how to correctly open access to the necessary services on Mi WiFi routers.

The setup process doesn’t require a deep knowledge of programming, but attention to detail is critical. A mistake in one digital sense can lead to the service simply not working. We’ll look at the standard algorithm of actions that is relevant for most current models, including the Mi Router 4A, Mi Router Pro and AX series.

Preparation for network interface configuration

Before making changes to the router configuration, you must reserve static IP-Address for target device. Dynamic addressing DHCP alter IP-The address of your computer or camera after restarting, which will render the previously created rules of the pass inoperability.

For this you need to know the current MAC-The address of the device you're opening the ports to, and you can find it in your Windows network settings, or macOS, or in the router's interface in your list of connected clients.

💡

Use addresses in the 192.168.31.x range (standard for Xiaomi) to avoid conflicts with other network devices.

Then you need to log in to the web management interface. Open any browser and enter in the address bar 192.168.31.1 or the domain name miwifi.com. After authorization (password is usually indicated on the sticker at the bottom of the device or set at the first setting), you will be taken to the main menu of the system.

Admin panel entrance and navigation

Xiaomi routers can be presented in Chinese or English, depending on the firmware version (Global or CN), and navigation is similar in both cases. You need to find the section responsible for advanced network settings. In the Chinese version, look for the tab (Advanced Settings), and then (Port Forwarding).

In global versions of firmware, the path may look like Advanced -> Port Forwarding. If you use the Mi Home mobile application, the functionality may be limited, so it is highly recommended to use the browser version of the interface on a PC or smartphone to fully configure the ports.

What to do if the interface is in Chinese?
Use the built-in browser translator (Google Chrome offers this automatically) or navigate by icons. The port-slip section is often denoted by the symbol of a gear or arrows pointing inward and outward.

Make sure your control device (computer) is connected to the same Wi-Fi network or LAN-port, as well as router. Remote port configuration via mobile Internet (4G/5G) This is not possible at this point, as you must be inside the local network.

Reservations IP-device-address

The key to stable operation of the pass is static IP-Addressing: In Xiaomi routers, this feature is often built directly into the menu. DHCP Or a list of customers. Go to the Settings section -> LAN Settings or Connected Devices.

Find your device by name or MAC-Next to it should be the address fixation option, often referred to as Static. IP Activate this function. Now the router will always give this gadget the same thing. IP, for example 192.168.31.150.

☑️ Pre-drift check

Done: 0 / 4

An alternative is to manually configure static IP in the network properties of the computer or camera itself, but centralized management via the Mi WiFi router is more convenient, since it eliminates the risk of human error when entering a subnet mask or gateway on the client device.

Establishment of port pass rules

After preparation, proceed to the direct creation of the rule. In the Port Forwarding section, click the add-on button for the new rule (usually a plus). + Or the Add Rule button, and you'll see the form you need to fill in the service information.

In the Protocol field, select the protocol type. Most tasks (web servers, games, torrents) use TCP or UDP. If you don't know exactly what protocol the application requires, select TCP/UDP or BOTH to cover both options.

The Internal Port and External Port fields often require the same values unless you are a specific routing user. For example, for a web server, it is port 80, for Minecraft, it is port 25565. In the IP Address field, specify the same reserved device address that we set up earlier.

💡

The rule takes effect immediately after saving, but may require rebooting the target application to apply the changes.

Don’t forget to give the rule a clear name in the Service Name or Description field, for example,"Camera_Living" or"PS5_Game". This will help you quickly navigate the list of rules in the future, especially if there are many of them.

To make it easier to set up, we’ll give you a helpline with the ports of the most popular services that often require a pass on Xiaomi routers, which will help you fill out the configuration fields faster.

Service/ApplicationProtocolPort portAppointment
Web Server (HTTP)TCP80Websites, control panels
Minecraft ServerTCP/UDP25565Minecraft Game Server
BitTorrent / uTPTCP/UDP6881-6889Torrent clients
IP Camera (ONVIF)TCP80, 554Remote camera viewing
Steam / PSN / XboxTCP/UDP27015-27030Online games and downloads

Using port ranges (as with BitTorrent) allows you to increase the speed of connections with more peers, but opening too wide ranges without needing to be for security reasons.

If you’re setting up a game console, note that some platforms (like PlayStation or Xbox) may need to flip multiple ports separately or enable the UPnP feature, which we’ll talk about below.

DMZ and UPnP: Alternative Methods

If manually configuring each port seems too complicated, or the application requires opening many random ports, you can use the mode. DMZ (Demilitarized Zone: In this mode, selected IP-The address is completely removed from the firewall router, and all incoming ports that are not occupied by other rules are redirected to this device.

⚠️ Attention: Inclusion DMZ The device becomes completely vulnerable to attacks from the Internet. Use this method only for game consoles or dedicated servers without confidential information.

The second option is to activate the UPnP (Universal Plug and Play) protocol, which allows applications to request port opening from the router without user intervention. In Xiaomi routers, this feature is usually enabled by default, but you can check its status in the Advanced -> UPnP section.

📊 Which method of setting you prefer?
Hand-drawn port
Automatic UPnP
DMZ mode
NAT Provider

While UPnP is convenient, it carries certain security risks, as any malware on a computer can open a port to communicate with the hackers’ command center.

Diagnostics and problem-solving

Once you have the settings, you need to check if they work. There are many online services, such as: 2ip.ru portchecker.co, which allows you to scan the ports of your external IP-Enter the port number you just opened and run the check.

If the service shows that the port is closed, there may be several reasons. First, check if the connection is blocked by the built-in Windows firewall or antivirus on the target computer. Often the rule on the router works, but the OS sifts out the packet.

Second, the critical factor is the presence of gray» IP-If your Xiaomi router is connected to the provider’s network through NAT (double NAT), You can't just drop the ports directly, and then you can't just get outside. IP-The router’s address will be different from the real public address. IP.

⚠️ Note: If you have a "grey» IP, You don't need to set up ports on the router. You need to call the provider and order the static service. IP» or switching to a tariff with a public address.

It's also worth trying to reboot the router after making all the changes. Some Mi Router models only apply routing rules after a full turn on cycle. Make sure the firmware version is up to date, as older versions may have had NAT table bugs.

Why is the port port port port port port port on the Xiaomi router not working?
The most common reason is a double. NAT - I'll check with the provider. WAN IP-Router status address: if it starts with 10.x.x.x, 100.x.x.x or 172.x.x.x, So you're in favor of NAT Also check if the "Security" or "Protection" mode is enabled in the Mi Home app, which can block external connections.
Is it safe to open ports on a router?
Opening specific ports for specific applications (Port Forwarding) is relatively safe if the software on the target device is updated. The risk arises when using DMZ mode or opening ports for unverified services. Always use complex passwords on services available from the outside.
How to reset port settings to factory ones?
To remove all the rules, just go to the Port Forwarding section and delete the created entries. If the interface is not available, you can completely reset the Xiaomi router by holding the Reset button on the case for 10 seconds, but this will also remove the Wi-Fi settings.