How to completely disable firewall on Xiaomi devices: smartphones and routers

The built-in firewall in Xiaomi devices is a two-way sword: on the one hand, it protects your smartphone or router from unauthorized access and network attacks, on the other hand, it can block legitimate applications, slow down the Internet connection or interfere with the work of the device. VPN. If you’re facing compatibility issues, traffic restriction, or just want to test a network without protection, turning off a firewall can be a solution.

However, before you deactivate this function, it is important to understand: on devices with MIUI 14+ HyperOS and disabling a system firewall through standard settings often results in its automatic turn on after a software reboot or update. In this article, we will analyze all available methods – from basic settings to hidden commands for experienced users, and also consider the specifics of working with Xiaomi Mi Router and Redmi Router routers.

What is a firewall on Xiaomi and why turn it off

A firewall (or firewall) in the Xiaomi ecosystem performs several key functions:

  • πŸ›‘οΈ Blocking Inbound Connections – Protects against Port Scanning and Hacker Attacks.
  • πŸ“± Control of application traffic – restricts background activity of programs (for example, advertising) SDK).
  • 🌐 Filtering Network Packets – Blocks Suspicious Packets IP-address and domain.
  • πŸ”„ Port forwarding management – relevant for routers when configuring servers or torrent clients.

The reasons for disconnection can be different:

  • 🚫 Applications (such as Torrent clients or Termux) cannot connect to the network.
  • ⚑ Slowing Internet connection due to excessive traffic filtering.
  • πŸ”§ Necessity to test network services (e.g., a local web server).
  • πŸ”„ Conflict with VPN Proxy servers (especially on HyperOS).

⚠️ Warning: Turning off firewalls on a permanent basis increases the risk of malware infection, especially if you connect to public Wi-Fi networks.

πŸ“Š Why you want to turn off firewall on Xiaomi?
Solving the app problem
Testing the network.
Speeding up the Internet
Other

How to turn off firewall on Xiaomi smartphones (MIUI/HyperOS)

The way you shut down depends on the firmware version. MIUI 12 and HyperOS, the settings interface has changed, and some options have become hidden.

Method 1: Through standard security settings

This is the easiest method, but it doesn’t work on all models (for example, on Xiaomi 13 Pro with HyperOS, the option may not be available):

  1. Open Settings β†’ Applications β†’ Application Management.
  2. Slip on the three dots in the upper right corner and select Special Access.
  3. Go to Network Access (or Firewall on older versions) MIUI).
  4. Turn off the switch for the right app or globally for everyone.

If there is no Firewall, try an alternative route:

Settings β†’ Memory β†’ Three points β†’ Special access β†’ Network access

Check the version. MIUI/HyperOS In Settings β†’ The phone.

Make a backup copy of important data

Make sure there are no active network attacks on your device (check out Google Play Protect)

Remember the current network settings (screenshot Settings) β†’ Wi-Fi)

-->

Method 2: Developer settings (for power users)

If the standard method didn't work, you can try turning off the firewall through the developer mode, which requires activating the hidden menu:

  1. Go to Settings. β†’ The phone.
  2. Tap 7 times on the MIUI version (or HyperOS version).
  3. Return to the main settings and open additionally β†’ For developers.
  4. Find the USB debugging option and turn it on.
  5. Connect your phone to your PC and use the command ADB: adb shell settings put global firewall_enabled 0

⚠️ Note: On some devices (e.g., Redmi Note 12 with HyperOS), this command may reset after rebooting.

What to do if ADB is not working?
If the adb shell command returns the permission denied error, do: 1. Reconnect the device with the debugging enabled by USB. 2.On the phone in the permission window USB-Check the check box Always allow from this computer. 3. Repeat the command. If the problem persists, update the drivers ADB on a PC or use an alternative cable (some USB-type C cables do not support data transfer).

Method 3: Disconnecting through the application "Security" (Mi Security)

On devices with MIUI 13 and below firewall can be controlled through the proprietary application Mi Security:

  1. Open the Security app (the shield icon).
  2. Go to Network or Network Protection.
  3. Slip on the firewall and turn off the protection for the desired applications.
  4. To completely disable, find the Global Firewall option and deactivate it.

On HyperOS, the Mi Security application may not be available, in which case use Method 1 or Method 2.

πŸ’‘

If after switching off the firewall the Internet began to work slower, check the settings DNS. Sometimes a firewall blocks unsafe systems. DNS-And when you shut it down, the traffic goes through the slow nodes. DNS from Google (8.8.8.8) or Cloudflare (1.1.1.1).

Disabling firewall on Xiaomi routers (Mi) Router/Redmi Router)

On Xiaomi routers, the firewall is integrated into the firmware and is turned on by default, and it may be necessary to turn off it to:

  • πŸ–₯️ Port settings for game servers (e.g. Minecraft or Minecraft) CS:GO).
  • πŸ“‘ Optimizing speed when using torrent clients.
  • πŸ”Œ Connecting devices with non-standard protocols (IP-cameras, smart home).

Instructions for standard firmware MiWiFi

To turn off the firewall on the router:

  1. Connect to the router network and open http://miwifi.com (or 192.168.31.1).
  2. Log in (the default login and password is often admin).
  3. Go to Additional Settings β†’ Security β†’ Firewall.
  4. Turn off the option to Enable Firewall and save settings.

On some models (for example, Xiaomi Mi Router) 4A Gigabit may be required:

Additional β†’ Network settings β†’ Firewall (SPI)

Shutdown through SSH (Telnet-enabled firmware)

If the web interface does not allow you to disable the firewall, you can use it. SSH-This method is suitable for OpenWRT firmware or modified versions:

  1. Set up the connection to SSH (For example, through PuTTY or Termux: ssh root@192.168.31.1 The default password is admin or blank.
  2. Execute the command to disable: uci set firewall.@defaults[0].syn_flood='0' uci set firewall.@defaults[0].drop_invalid='0' uci commit /etc/init.d/firewall restart

⚠️ Warning: Disabling firewall on router through SSH It can disrupt parental controls and guest networks if you have set up restrictions on the user experience. MAC-Addresses will also need to be reconfigured.

Model routerSupports disconnection through the web interface?Whether required SSH shutdown?Risk of losing stability
Xiaomi Mi Router 4CYes.No.Low.
Xiaomi Mi Router 4A GigabitPartially (only) SPI)Yes.Medium.
Xiaomi AX3600Yes.No.Low.
Redmi Router AC2100No.Yes.High-pitched

What to do if the firewall itself turns on after a reboot

One of the most common problems with Xiaomi is that it automatically turns on the firewall after restarting or updating the system. MIUI/HyperOS, which are set to the default values.

Smartphone solutions

  • πŸ”§ Use Tasker or MacroDroid to automatically shut down the firewall after booting. Create a task with the team ADB: settings put global firewall_enabled 0
  • πŸ“± Install an alternative firewall (such as NetGuard or AFWall)+), This will only block selected applications.
  • πŸ”„ Reverse to the old version MIUI, where the firewall was controlled more flexibly (e.g, MIUI 11).

Router solutions

  • πŸ–₯️ Sweeve alternative firmware (such as OpenWRT or Padavan) where the firewall is configured flexibly.
  • πŸ”„ Create a boot-up script in /etc/init.d/, which will turn off the firewall at each start.
  • πŸ”’ Turn off automatic firmware updates to avoid resetting settings.

πŸ’‘

If the firewall turns on spontaneously, it's not a bug, it's a feature of HyperOS. The system considers the firewall disabled a potential threat and returns settings to a "safe" state, the only reliable solution is root access or custom firmware.

Risks of firewall shutdown and how to minimize them

Disabling protection opens your device to a number of threats, and here are the main risks and ways to mitigate them:

RiskEffects of consequencesHow to minimize
Port scanningAttackers can detect vulnerable services on your device.Use it. VPN When Connecting to Public Networks.
DDoS attacks on routersNetwork overload and internet shutdown.Set up a speed limit for incoming connections.
MalwareTrojans and spyware can get into the system.Install an antivirus (such as Malwarebytes or Bitdefender).
Data breachApplications may send personal information without your knowledge.Regularly check the permissions of applications in Settings β†’ Annexes.

If you have disabled the firewall temporarily (for example, to set up a server), it is recommended that:

  • πŸ•’ Turn it back on immediately after completion of the work.
  • πŸ” Check for suspicious activity through Fing or Wireshark.
  • πŸ”„ Create a separate guest network on a router for unsafe devices.

Alternatives to a complete firewall shutdown

In most cases, you don't have to turn off the protection completely, you just have to adjust it to your own needs. Here are some alternatives:

1. Add exceptions for specific applications

Instead of a global shutdown, only the right programs can be allowed to access:

  1. Open Settings β†’ Applications β†’ Application Management.
  2. Select an app (such as uTorrent or Termux).
  3. Go to Permits. β†’ Network access.
  4. Allow background data transfer and disable firewall restrictions.

2. Set up port forwarding on the router

If the problem is blocking ports (for example, for a game server), instead of turning off the firewall:

  1. Open the router’s web interface (miwifi.com).
  2. Go to the Supplementary β†’ Port forwarding (port forwarding).
  3. Add a rule for the desired port (for example, TCP 25565 for Minecraft).
  4. Link the rule to the local IP-address.

3.Use VPN split-tunneled

Some of them VPN (For example, ProtonVPN or Windscribe allow you to choose which applications will use a secure connection and which will bypass it, which will help avoid conflicts with the firewall.

1. Energize the aircraft mode.

2 Manually turn on Wi-Fi or mobile data.

3. the firewall will be deactivated until the next restart or turn on / off the network.

-->

FAQ: Frequent questions about switching off firewall on Xiaomi

Can I turn off firewall on Xiaomi without root rights?
On most devices with MIUI 12+ And HyperOS, you can't shut down completely without rooting, and it automatically turns back the protection, but you can: Turn off the firewall for individual applications through settings. ADB-Install an alternative firewall (like NetGuard) that will block traffic selectively. Complete shutdown will require unlocking the bootloader and editing system files.
Why is the Internet not working after the firewall is turned off?
This can happen for several reasons: DNS-Firewall could block unsafe DNS-Try manually specifying servers. DNS Google (8.8.8.8) or Cloudflare (1.1.1.1) VPN: If you have it on. VPN, Disable it and check the connection. Operator lock: Some mobile operators (such as MegaFon or Beeline) restrict traffic when you detect "suspicious" activity. Restart your phone or change the network type (with the help of the network). 4G on 3G). Failure in network settings: Reset network settings in Settings β†’ System system β†’ Resetting settings β†’ Resetting Wi-Fi, Mobile Network and Bluetooth.
How to check if the firewall on Xiaomi is turned off?
To make sure the firewall is actually deactivated: On your smartphone: Open Settings β†’ Annexes β†’ Application management β†’ Three points. β†’ Special access β†’ Network access. If the firewall is grey or off, protection is disabled. Use the NetGuard app to check network activity - if traffic is not blocked, the firewall is not working. On router: Open miwifi.com and check the status of the firewall in Additional β†’ Safety: Command at terminal: ping 192.168.31.1 If the ping passes without loss, the firewall will not block ICMP-packet.
Is it safe to turn off firewall on Xiaomi router?
Disabling a firewall on a router significantly increases the risks, especially if: You use a standard password to access the web interface (admin/admin). You have remote access to your router over the Internet, you connect smart devices (cameras, speakers) to the network without firmware updates, and you minimize the risks by changing the standard password to a complex one (at least one). 12 Disable remote access to additional β†’ Management β†’ Remote access. Set up the system. MAC-Filtering to allow only known devices to connect. Regularly update the router firmware (even if the firewall is disabled, updates close other vulnerabilities). If you need to open ports for the server, it is better to configure the redirect than to turn off the firewall completely.
How to turn the firewall back on after shutdown?
To activate protection again: On your smartphone: Use the command ADB: adb shell settings put global firewall_enabled 1 Or reset your network settings in Settings. β†’ System system β†’ Reset settings. On the router: Log in to the web interface and turn on the firewall in Additional β†’ Security, or run a command through SSH: uci set firewall.@defaults[0].syn_flood='1' uci set firewall.@defaults[0].drop_invalid='1' uci commit /etc/init.d/firewall restart If the firewall does not turn on, try resetting the router to factory settings (Reset button on the back panel).