Android 11.0 system restricts Internet access series iptables uses IOemNetd to realize the function of banning Internet access for a certain period of time in the app

1 Introduction

In the customized development of the 11.0 system rom, the system restricts the use of the network. In the product requirements of the netd network in the system, it is required to set the function of prohibiting the Internet for a certain period of time in the app. The iptables command in liunx is also more
important , Next, I will implement the related functions of banning the Internet for a certain period of time in IOemNetd, that is, only
one app can be prohibited from surfing the Internet for a certain period of time in the system, that is, this app can access the Internet at other time periods. Finally, implement the interface call in the framework custom service

2. The iptables of the system restricting the Internet access series uses IOemNetd to realize the core class of the realization of the function of prohibiting the Internet access for a certain period of time in the app

    system\netd\server\binder\com\android\internal\net\IOemNetd.aidl
    system\netd\server\OemNetdListener.cpp
    system\netd\server\OemNetdListener.h

3. The core function analysis and implementation of the iptables of the system restricting Internet access series using IOemNetd to realize the function of prohibiting Internet access for a certain period of time in the app


In the android native system, iptables is very important in the network filtering packet module. Iptabels is a packet filtering firewall system integrated with the Linux kernel. Both linux and android include the function of Iptables.
Iptables facilitate better control of IP packet filtering and firewall configuration on a Linux system if the Linux system is connected to the Internet or a LAN, a server, or a proxy server that connects the LAN to the Internet.
Another important advantage of netfilter/iptables is that it gives the user complete control over firewall configuration and packet filtering. You can customize your own rules to meet your specific needs

The commonly used commands of iptables are as follows:
Command Description

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132072401