AdguardTeam / AdguardForAndroid

Open bug tracker for Android version of AdGuard.
https://adguard.com/
1.32k stars 90 forks source link

Add an option to block CIDR range #4770

Open smexyy opened 1 year ago

smexyy commented 1 year ago

Issue Details

I need to block this CIDR range in adguard android.how to implemnt this in user rules?

CIDR 104.16.0.0/12

I need this feature in adguard android so, any plain user can implement it like Rethink firewall.

Proposed solution

Add an easy and convenient option to block the desired CIDR range.

Alternative solution

No response

smexyy commented 1 year ago

?

Versty commented 1 year ago

@smexyy Hi! Currently, you can block a CIDR range by converting it to a regular expression. Then this expression should be added to the blocking rule.

The final rule in your case should be /(104\.(?:1[6-9]|2[0-9]|3[0-1])\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5]))\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5])))/$network

We would also recommend to learn more about the network type rules in our knowledge base.

Let's see if other users will upvote this feature request.

smexyy commented 1 year ago

@smexyy Hi! Currently, you can block a CIDR range by converting it to a regular expression. Then this expression should be added to the blocking rule.

The final rule in your case should be /(104\.(?:1[6-9]|2[0-9]|3[0-1])\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5]))\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5])))/$network

We would also recommend to learn more about the network type rules in our knowledge base.

Let's see if other users will upvote this feature request.

smexyy commented 1 year ago

Thank you.

smexyy commented 1 year ago

@Versty Could you please explain why this syntax block the ip, the syntax rule should block other CIDR. Screenshot_20230810-040351

Versty commented 1 year ago

@smexyy You can use this tool to check if the regular expression matches the CIDR range.

Please keep this request open if you wish a more convenient CIDR range blocking option to be added in the application.