Android 12.0 system Internet access restriction series iptables uses IOemNetd to implement app Internet access whitelist function

1 Introduction

In the customized development of the 12.0 system rom, regarding the use of the system's restricted network, the product requirements for the netd network in the system will require the function of setting the app's Internet whitelist. The iptables command in liunx is also relatively important. Next
, Let’s implement the related functions of app Internet whitelist in IOemNetd, that is, only
a certain app can be allowed to access the Internet in the system, that is, except for this app, other apps cannot access the Internet. Finally, the interface call is implemented in the framework custom service.

2. System Internet Restriction Series: iptables uses IOemNetd to implement the core class of the app Internet access whitelist function.

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

3. Analysis and implementation of the core functions of iptables in the system restricted Internet access series using IOemNetd to realize the app Internet access whitelist function

In the series of system restricted Internet access, iptables uses IOemNetd to realize the app Internet access whitelist function. In the
native Android system, iptables is very important in the network filtering packet module. Iptabels is a packet filtering firewall system integrated with the Linux kernel. Linux and Android All will include the functionality of Iptables.
Iptables facilitates better control over IP packet filtering and firewall configuration on Linux systems if they are connected to the Internet or LAN, a server, or a proxy server connecting a LAN and 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

Commonly used commands of iptables are as follows:

Guess you like

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