Opening ports on Xiaomi devices is a challenge that both experienced users and beginners face. Without the right port configuration, you will not be able to run a home server, remote access to Mi Home cameras, organize torrent downloads or set up online games. The problem is that the interfaces of routers Mi Router, phones Redmi/POCO Smart devices differ, and official documentation is often silent about the nuances of the.
In this article, we will analyze three key scenarios: 1) Port rollover on Xiaomi routers (including models with MiWiFi and Padavan firmware), 2) Port configuration on phones for developers or remote access, 3) Features of working with ports on smart devices (cameras, NAS).
You will learn how to avoid common errors (such as conflicts with UPnP), which ports are safe to open, and what to do if settings do not apply.
1.Why to open ports on Xiaomi and what risks it carries
Opening ports is about creating doors to the outside world for your local device.
- ๐ฎ Start a Game Server (Minecraft, CS:GO) friend;
- ๐ก Connect to Xiaomiโs home camera from another network;
- ๐ป Provide remote access to files through FTP or SSH;
- โก Accelerate torrent uploading (if the port is closed, the speed drops by a small amount) 30-50%).
But every open port is a potential vulnerability, and hackers scan networks for open ports (especially 22, 80, 445) and try to find passwords. In 2023, for example, the Mirai botnet infected Xiaomi routers through weak credentials on port 7547 (control). TR-069).
โ ๏ธ Warning: Never open port 37215 (used by the Death virus for DDoS attacks) and 1900 (a vulnerability in the protocol) SSDP, traffic-amplified).
Before setting up, check if the ports are already open: telnet is your external_IP port (if the connection is established, the port is open).
Or use online services like YouGetSignal.
2. Ports transfer on Xiaomi routers (Mi Router) 3/4/Pro, AX)
Xiaomi routers use MiWiFi (Chinese/global) or alternative (Padavan, OpenWRT) firmware. The instructions for these are different. 4A Gigabit.
Step 1: Preparing the router
Before setting up:
- ๐ Connect the device you open the port to the router via cable (Wi-Fi can block some functions).
- ๐ Set it up locally. IP customized DHCP (So it doesn't change. Go to Settings for that. โ Local area network โ DHCP โ Reservation of addresses.
- ๐ Restart the router after reservation IP.
Step 2: Set up port port rollover
Open the router control panel (192.168.31.1) and do:
- Go to the Supplementary โ Redirection โ Port transfer.
- Press Add the rule.
- Fill in the fields: Rule name: Any (e.g., "Minecraft Server: TCP, UDP or TCP/UDP. External port: Port that will be visible from the Internet (for example, the port of the Internet, 25565 Internal port: Port on a local device (may match an external device). IP: Local. IP devices, for example, 192.168.31.100).
Save the rule and restart the router.
โ๏ธ Checking port passage
Step 3: Checking and Resolving Errors
If the port does not open:
- ๐ Check if UPnP blocks it (disable it in Settings). โ Redirection โ UPnP).
- ๐ก๏ธ Make sure the firewall is in place. Windows/Antivirus does not block the connection.
- ๐ If you have a gray" IP (not white, the skid will not work โ contact the provider for static IP.
How do you know if you have white? IP grey?
| Mistake. | Reason. | Decision |
|---|---|---|
| The port is not open, although the rule is maintained. | Conflict with UPnP or Firewall | Disable UPnP and check for exceptions in the firewall |
| Outside IP pingo | Provider locks in ICMP or gray IP | Call the support provider and request white. IP |
| Port open, but no connection is established | Local device does not listen to port | Check if the service is running on the device (e.g. netstat) -ano | findstr 25565) |
3. Opening ports on Xiaomi phones (Redmi, POCO, Mi)
On Xiaomi smartphones, opening ports is relevant for:
- ๐ฑ ADB-Debugging (port 5555 for PC connection);
- ๐ง Remote access (e.g., via TeamViewer or VNC);
- ๐น๏ธ Game emulators (e.g, PPSSPP multiplayer).
Unlike routers, there's no "drift" here -- you just let an application use a network port. MIUI energy saving that can block connections.
Instructions for ADB (port 5555)
To open the port for ADB:
- Activate Developer Mode: Go to Settings โ About Phone โ MIUI version and tap 7 times.
- Enable USB debugging in Settings โ Additional โ For developers.
- Connect your phone to your PC and execute in the command line: adb tcpip 5555 adb connect IP_phone:5555
๐ก
If the adb connect command gives an error "cannot connect", check that the phone and PC are on the same network, and the firewall MIUI (Settings โ Annexes โ Permit management โ Auto-start) does not block ADB.
Setup for remote access (VNC/RDP)
For applications like TeamViewer or RealVNC:
- Install the app from Google Play.
- Run it and write it down. ID device.
- In the application settings, allow AutoRun and turn off Battery Optimization for it.
- If you use VNC, Open port 5900 on the router (see section 2).
โ ๏ธ Note: Remote access applications (TeamViewer, AnyDesk) use their own intermediary servers, so port port port rolling on the router is not required. IP:port (e.g. through RDP or VNC).
4.Ports for Xiaomi smart devices (cameras, NAS, lamps)
Smart devices Xiaomi (Mi Home cameras, routers Mi WiFi, NAS Mi Storage often requires port openings to:
- ๐น Viewing cameras from the outside (ports 80, 443, 554 for the RTSP);
- ๐พ Access to NAS (port 21 FTP, 22 for SSH);
- ๐ Smart home management via Mi Home (port 8080).
Xiaomi cameras (e.g. Mi Home Security Camera 360)ยฐ) By default, they use the cloud service for remote access, but if you want to connect directly to the Internet, IP, You will need to open port 554 for the protocol. RTSP. However, this only works with alternative firmware (such as Hack Mi Home Cameras), as standard Xiaomi software blocks local access.
Setup for Mi Home cameras
For direct connection to the camera:
- Install alternative software (e.g. iSpy or TinyCam Pro).
- Find the local. IP cameras in the Mi Home app (Device settings) โ General information).
- On the router, flip port 554 (or another if you changed the camera settings) to IP camera.
- Use it for viewing. URL: rtsp://IP_camera:554/stream1
๐ก
Xiaomiโs standard cameras do not support direct access. RTSP For a legal solution, use the Mi Home cloud service or buy cameras with support ONVIF (For example, Xiaomi Mi Home Camera 2K Pro).
Ports for Xiaomi NAS
For devices like Mi Storage or a hard drive connected to a router:
| Service | Port port | Protocol | Appointment |
|---|---|---|---|
| FTP | 21 | TCP | File transfer |
| SSH | 22 | TCP | Remote control |
| Samba | 445 | TCP/UDP | Network folders (Windows) |
| HTTP | 80 | TCP | Web interface |
For security: 1 Always change standard ports (e.g, SSH 22 to 2222); 2) Use complex passwords (generator: passphrase.ru); 3 IP router-setting.
5. Typical errors and their solutions
Even after you set up the ports correctly, here are the most common problems and ways to fix them:
Error 1: The port is open, but the connection is not established
Reasons:
- ๐ Local device does not listen to the port (service is not running).
- ๐ก๏ธ Firewall on the device blocks incoming connections.
- ๐ The provider blocks the port (especially for ports 80, 443, 25).
Decision: netstat -ano | findstr "port" (Windows) or ss -tulnp | grep port (Linux) โ checks whether the host port is listening.
If not, run a service (e.g., a game server or a game server). FTP-demon).
Mistake 2: External IP pingo
If your external IP It doesn't respond to ping, it could mean:
- Provider locks in ICMP-Packages (normal practice for safety).
- You're gray. IP (see spoiler in section 2).
- The router does not let ping into the external network (turn off Settings). โ Security โ Protection against DoS attacks).
Error 3: Port is running, but speed is low
A common problem with torrents or game servers.
- ๐ถ The provider trotts traffic on certain ports (try changing the port, for example, from 6881 to 51413).
- ๐ Conflict with QoS on the router (disable in Settings) โ Redirection โ QoS).
- ๐ก Wi-Fi signal weak (connect the device via cable).
๐ก
For torrents, use ports above 49152 (dynamic range). These are less likely to be blocked by providers. Example: 51413 (used in qBittorrent by default).
6. Alternatives to port opening
If the port port port port is not working (for example, due to gray IP) Or you donโt want to risk security, consider alternatives:
1. Cloud services
For Xiaomi cameras: Mi Home Cloud is the official solution for remote viewing without opening ports. TinyCam Pro supports cloud connection to the cameras through the developer server.
2. VPN
Set up OpenVPN or WireGuard on Xiaomi router: Pros:
โ More secure than open ports;
โ He works with the grays. IP.
Cons
โ Requires server configuration (can be rented for a 3-5$/moss).
Instructions for Mi Router:
Settings โ VPN โ OpenVPN โ Create a server
3. Services like Ngrok or Cloudflare Tunnel
These tools create a โtunnelโ from the Internet to your local device without port-dropping.
Example for Ngrok:
- Download Ngrok from the official website.
- Register and get a token.
- Execute the command: ngrok authtoken your token ngrok tcp 25565
- Connect to the address. 0.tcp.ngrok.io:XXXX (where XXXX โ port).
๐ก
Ngrok and Cloudflare Tunnel are the best solutions for temporary access (for example, for project demonstration). VPS tune in VPN.
7.Security: How to Protect Open Ports
An open port is like an unlocked door, to minimize the risks of:
Basic protection measures
- ๐ Change the standard ports: For example, SSH 22 to 2222, RDP 3389 to 3390.
- ๐ก๏ธ Use it. fail2ban: Utility locks in IP after several failed login attempts (install on a server or router with OpenWRT).
- ๐ Turn off password authentication in favor of keys SSH.
- ๐ Restrict access by IP In the router settings (let only your own) IP).
Advanced protection
For critical services (e.g, RDP or FTP):
- ๐ Port knocking โ the port opens only after a series of connections to closed ports.
- ๐ก๏ธ Use a reverse proxy (such as Nginx) with authentication.
- ๐ Enable two-factor authentication (e.g., through Google Authenticator).
โ ๏ธ Attention: Port 3389 (RDP) โ One of the most attacked. If you want remote access to Windows, be sure to: 1) Change port to non-standard; 2) Set up Network Level Authentication (NLA); 3) Restrict access to IP Windows firewall.