ukanth / afwall

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

LAN connections blocked after a while when AFWall in background very annoying #1320

Open githubuser181226 opened 1 year ago

githubuser181226 commented 1 year ago

Hi.

I've got this very annoying issue.

I use my phone as a document scanner only and rely heavily on having transparent LAN connection from and into the phone. I use Xyplorer and SMBSync2 to transfer data and the issue is that despite allowing LAN connections for ALL apps in AFWall+ (and denying internet for ALL) and also enabling the option to allow inbound LAN connections after a while (I don't know how long) when AFWall+ is working in the background it then starts to block my apps from accessing any other LAN host.

To fix this problem all I need to do (but I do it every single time, and many times a scanning session) is to open AFWall+ UI and then go back to the app and retry connecting (usually 1-2 times).

I can't add no logs, because AFWall+ crashes when I enable logging.

For the iptables rules they are simple: block internet for every single app/service, and enable LAN access for every single app/service Also as I said, I enabled "allow inbound LAN connections" in the options.

Running LineageOS 14.1 osprey on Motorola Gen3 (2015).

Please advise.

githubuser181226 commented 1 year ago

Hello again.

I have disabled battery optimization for AFWall+ and and re-checked, but alas, the issue persists.

After some short amount of time of me not doing anything with the phone, whenever I try to run any app requireing LAN connection, AFWall blocks it.

I have to then open AFWall UI, and then go back to the app, and retry and after 1, sometimes 2 attempts it regains LAN connectivity.

I don't know what to do anymore, and AFWall is the only firewall I can actually trust.

Can someone replicate my set up and confirm if it isn't just my device acting up?

Cheers.

1-eric commented 1 year ago

Yes, happens to me too. I use my phone to control the smart tv. Both devices are on the same local network. Sometimes the phone can not connect to the tv. When this happens, reapplying the firewall rules will solve the problem.

resolutecake commented 1 year ago

I do not know your specific cases, but if applying rules fails for any reason, such as the buggy parallelism in 3.5.3, then AFWall+ blocks almost everything. This is shown by toaster “Error applying iptables rules”

after one of those, you must see “Rules applied with success” or the firewall state is corrupt