ukanth / afwall

AFWall+ (Android Firewall +) - iptables based firewall for Android
GNU General Public License v3.0
2.79k stars 456 forks source link

No Internet after switching connection type (wifi - > mobile and around) #852

Closed Friday13th87 closed 5 years ago

Friday13th87 commented 6 years ago

I am using afwall donate on my Mi8, running Miui 10 under Android 8.1 rooted with Magisk 16.0 stable. Init.d is working and fix boot data leak is working as well (I think so - made the test with 00test) For logging I am using Busybox.

Afwall+ is not working great at this time. If I am switching from wifi to mobile data (or the way around) everything is blocked and I need to reboot my phone, than it is working. By applying the rules by hand (even turning firewall off and on again) there is still no connection.

I don't know if I should write it here - the logs are stopping all the time, I need to turn logs off and on for having logs again.

And one side question: by choosing to apply the rules after a certain amount of time after start, within this time everything is blocked, right? I didn't find any description for this feature

IPv4rules.log

Friday13th87 commented 6 years ago

I tried out a lot. i tried different ROMs, used startup delay, tried with startup leak and without, made afwall+ to a system app, tried it with magisk 16.0 16.4 and 16.7, used system iptables and integrated iptables. tried to kill afwall, cleard cache and restarted it after switching the connection type.

nothing worked, i still need to restart my phone to get an internet connection after leaving wifi, entering wifi, switching from LTE to 3G, EDGE etc.

any ideas?

EDIT: Some other details: i downloaded afwall+ from fdroid with my pc and installed it through a filemanager on my phone, after settingup everything i installed the donation key from google play store.

Friday13th87 commented 6 years ago

Today I gave it another try and found out that the iptables flushing in my custom script is responsible for the behavior. as in the custom script section mentioned I wrote in my script

$IPTABLES -F INPUT $IPTABLES -F FORWARD $IPTABLES -t nat -F $IPTABLES -t mangle -F $IP6TABLES -F INPUT $IP6TABLES -F FORWARD $IP6TABLES -t nat -F $IP6TABLES -t mangle -F

How can this happen?

Friday13th87 commented 6 years ago

probably here is not the place for an answer or for help. if i look at all the other issues and the responses, the so called "developer" is giving a sh** about it

ukanth commented 6 years ago

Read the bug submission rules. I can't help without looking at what's happening with iptables. Kindly post the iptables rules ( from menu -> Show rules -> export or send error report ) and attach it here. I will look into it.

Friday13th87 commented 6 years ago

I posted my rules in the first post.

shellshocker commented 6 years ago

I can confirm this. Using Xiaomi Mi6 with LineageOS 15.1 (Android 8.1) - latest nightly.

Same problem here. After commenting these lines, it's working:

# Flush/Purge all rules except OUTPUT
$IPTABLES -F INPUT
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
$IPTABLES -t mangle -F
$IP6TABLES -F INPUT
$IP6TABLES -F FORWARD
$IP6TABLES -t nat -F
$IP6TABLES -t mangle -F

But then I'm facing OS restarts. :-1:

I also have to remove these:

# Flush/Purge all chains  
$IPTABLES -X   
$IPTABLES -t nat -X  
$IPTABLES -t mangle -X  
$IP6TABLES -X   
$IP6TABLES -t nat -X  
$IP6TABLES -t mangle -X

After that it's working fine.

MidyatMaster commented 1 year ago

Try to premit access to the application called " (root) Application as root"