Have you noticed that some application on your smartphone suspiciously often “knocks” on the network, consumes traffic, or sends data to an unknown location? Or do you want to limit Internet access for games so that children do not waste mobile gigabytes? In Android, there are several ways to block network activity for individual apps - from standard tools to advanced solutions with root access.
In this article we will look at all current methodsincluding restrictions through system settings, the use of firewalls (for example, NetGuard or AFWall+), as well as manual edits configuration files for advanced users. We will pay special attention to the nuances: why some applications bypass blocking, how to check the effectiveness of restrictions and what to do if after changes the app stops working.
Important: not all methods are equally effective. For example, the standard mobile traffic limit in Android settings does not block access via Wi-Fi, and some system applications may ignore user rules. We will explain in detail which methods provide a 100% guarantee, and where additional actions are required.
1. Standard Android settings: limiting background traffic
The easiest way to partially limit an application's access to the Internet is to use the built-in Android tools. This method does not require the installation of additional apps, but has limitations: it only blocks background traffic (when the application is running in a minimized state) and does not affect active use.
To configure the restriction:
- 📱 Open
Settings → Applications(orSettings → Applications and notificationson some firmware). - 🔍 Find the desired application in the list and tap on it.
- 🌐 Select item
Mobile data(orData transfer). - 🔄 Move the slider
Background datato positionOff. - 📶 For complete restriction, also disable
Mobile dataandWi-Fi(if these options are available).
⚠️ Attention: On some devices (for example, Samsung or Xiaomi), the path to the settings may be different. If you do not find the item Background data, try going to Settings → Connections → Data usage → Mobile data and selecting the application from there.
This method is suitable for saving traffic, but does not provide complete blocking. The application will still be able to access the network when you are actively using it. To completely block it, you will need additional tools.
2. Firewall without root: NetGuard and analogs
If standard settings are not enough, use specialized firewalls. data-i="74">is an open source application that does not require superuser rights ( NetGuard is an open source application that does not require superuser rights (rootIt creates a local VPN tunnel and filters traffic through it.
How to set up NetGuard:
- Download and install NetGuard from Google Play or F-Droid.
- When you first start, allow the creation of a VPN connection (this is necessary to filter traffic).
- In the main window, find the application whose access you want to block, and uncheck the columns
Wi-FiandMobile data. - Activate protection using the button in the upper right corner (shield icon).
| Advantages of NetGuard | Disadvantages |
|---|---|
| Does not require root access | Creates a persistent VPN connection (may conflict with other VPNs) |
| Works on all versions of Android | Does not block system applications (for example, Google Play Services) |
| Supports rules for individual domains | May slightly increase battery consumption |
⚠️ Attention: If you use another VPN (for example, to bypass blocking), NetGuard will not be able to work simultaneously with it. In this case, you will have to choose one of the solutions or use a firewall with root access.
☑️ Setting up NetGuard
3. Firewall with root access: AFWall+ and iptables
For complete control over network traffic you will need superuser rights (root). With them you can block access to the Internet even for system applications that ignore standard restrictions. One of the best solutions is AFWall+ (Android Firewall).
Instructions settings AFWall+:
- 🔧 Install AFWall+ from Google Play or F-Droid.
- 🔑 Grant the application root access (if prompted).
- 📋 In the main window, select profiles
Wi-Fiand3G/4G/5G(orLAN/Roaming, if necessary). - 🔍 Find the application in the list and uncheck the boxes next to active profiles.
- 💾 Save the rules and apply them (button
Applyin the top menu).
For experienced users, manual configuration is available through iptables —a tool built into Android for managing network traffic. For example, to block access for an application com.example.app, you can use the command:
iptables -A OUTPUT -m owner --uid-owner $(dumpsys package com.example.app | grep userId= | cut -d= -f2) -j DROP
⚠️ Attention: Incorrect rules iptables can disrupt system operation, including Internet access for all applications. It is recommended to first test the commands in the emulator or create a backup copy of the current rules:
iptables-save > /sdcard/iptables_backup.rules
4. Using the “Traffic Saving” mode (Android). 9+)
Starting from Android 9 Pie, the system has a mode Traffic saving (Data Saver), which allows you to globally limit background traffic for all applications except selected ones. This is not a complete blocking, but will help reduce unnecessary data consumption.
How to enable:
- Go to
Settings → Network and Internet → Traffic saving. - Activate the slider
Save traffic. - Tap on
Unlimited access to dataand remove from the list the applications for which you want to block background traffic.
🔹 Method limitations:
- 🚫 Does not block traffic when actively using the application.
- 🌍 Does not work for Wi-Fi (mobile data only).
- 🔄 Some system applications (for example,
Google Play Services) may ignore restrictions.
If the “Traffic Saving” mode is not displayed, check whether it is disabled by the device policies (relevant for work phones with an MDM profile).
5. Blocking via DNS or host file (for experienced ones)
Another way to limit application access to the Internet is to redirect their requests to a “non-existent” address by editing the file hosts or using an alternative DNS. This method is suitable for blocking access to specific domains (for example, advertising networks or trackers).
To edit hosts:
- Get root access or use ADB (for some firmwares).
- Open the file
/system/etc/hostsin a text editor (for example, through Root Explorer or ADB Shell). - Add lines like:
127.0.0.1 site-address.com0.0.0.0 other-site.net - Save the file and reboot the device.
For blocking via DNS:
- 🌐 Install an application like DNS Changer or 1.1.1.1.
- 🔧 Set up a custom DNS (for example,
94.140.14.14for AdGuard DNS, which blocks trackers). - 🔒 Turn on the “Protection from trackers” or “Family filter” mode (depending on the service).
Important: editing the hosts file without root is only possible on some firmware via ADB, but the changes will be reset after a reboot. To permanently block, you will need superuser rights.
6. Checking the effectiveness of blocking
After using any of the methods, you need to make sure that the application has actually lost access to the network. To do this:
- 📊 Use the built-in traffic monitor:
- Go to
Settings → Network and Internet → Data usage. - Select the application and check if the data transfer counter is growing.
- Go to
- 🔍 Install a traffic analyzer, for example GlassWire or Network Monitor Mini.
- 🌍 Check the functionality of the application:
- If this is a messenger, try sending a message.
- If this is a game, check the download online content.
- If it is a browser, try opening a web page.
⚠️ Attention: Some applications can cache data and work offline for some time, creating the illusion of blocking. For example, YouTube can play previously downloaded videos, and Google Maps can show maps from the cache. For an accurate check, turn off Wi-Fi and mobile data for 5-10 minutes, then turn it back on and observe the behavior of the app.
What to do if an application bypasses the blocking?
Some applications (especially system ones) may use workarounds, for example:
- Connection via a proxy or VPN built into the application itself.
- Using alternative ports or protocols (for example, WebSockets instead of HTTP).
- Running background services under a different UID (user identifier).
In this case, only a firewall with root access or complete removal of the application.
7. Alternative methods: disabling notifications and background activity
If your goal is not so much to block the Internet, but reducing traffic and battery consumption, you can go the other way: limit the background activity of the application. This will not block access to the network completely, but will reduce its consumption.
How to disable background activity:
- 📱 Go to
Settings → Applicationsand select the target application. - 🔄 Tap on
Permissionsand disableBackground activity(orAutostarton Xiaomi/Huawei). - 🔔 Disable notifications for the application in the section
Notifications. - 🔋 On some devices (for example, Samsung) option available
Battery optimization—enable it for the application.
🔹 What it gives:
- ✅ The application will not update data in the background.
- ✅ Battery consumption will decrease.
- ❌ But access to the Internet will remain during active use.
To completely block the Internet, standard Android settings are not enough. Use firewalls (NetGuard, AFWall+) or root solutions.
Frequently asked questions
Is it possible to block Internet access for system applications (for example, Google Play Services) without root?
No, standard methods (including NetGuard without root) cannot completely block system applications. This will require superuser rights and a firewall like AFWall+. - disable updates for such applications via Settings → Applications → Google Play Services → Uninstall updates, but this may disrupt the system.
Why do some applications stop working after blocking?
Many apps (especially instant messengers, games with online mode or cloud services) require Internet access for basic functions. If, after blocking, the application displays errors like “No connection” or “Network error,” this means that it cannot work offline. Solutions:
- Allow Internet access only via Wi-Fi (if the goal is to save mobile traffic).
- Use alternative ones. applications with offline mode.
- Configure your firewall to block only specific domains (for example, advertising ones), and not all traffic.
How to block Internet access for all applications except selected ones?
This can be done using a rooted firewall (for example, AFWall+):
- Enable the Black List mode (
Blacklist mode). - Tick only those applications that are allowed access.
- Uncheck all others.
- Apply the rules.
Without root, this functionality is not available - standard Android tools do not support “white lists”.
Will the blocking work after rebooting the device?
Depends on the method:
- 🔄 Android standard settings (restricting background traffic) - saved.
- 🛡️ NetGuard without root —requires VPN to be re-enabled after reboot.
- 🔧 AFWall+ with root —rules are saved automatically.
- 📄 Editing hosts — is saved only with root, otherwise it is reset.
Is it possible to block Internet access for an application forever, even after updating it?
Yes, but with reservations:
- If you are using firewall with root (AFWall+), the rules are applied to the application UID, which usually does not change when updating.
- If blocking is configured through DNS or hosts, it will work until the application changes the domains to which contacts.
- Standard Android settings (
Background data) will be saved after the update, but do not guarantee complete blocking.
🔹 Exception: If the application is completely reinstalled (for example, after reset settings), its UID may change, and the firewall rules will have to be configured again.