I use Afwall+ (under Android 9) as a firewall in a fairly restrictive configuration.
If I grant the rights to Syncthing (data mobile) … it doesn’t work.
If I disable the firewall, everything is OK.
So no problems with Syncthing
My question is just to know, if you know, the services or dependencies to open for Syncthing in the firewall.
The problem with this issue mainly was a missing verbose log of Syncthing Android (wrapper) and SyncthingNative (binary). We cannot investigate this problem and make a sensible decision if it’s AFWall’s or our thing to fix when detailed info is missing.
It’s nothing todo with logs.
The rules you have to add are listed in the docs page listed, if it still does not work there is nothing we can do, the logs will tell you connection refused, why the firewall decided to refuse it is not syncthings business, you are better of going and talking to people behind the firewall, as the firewall is causing this problem, not syncthing.
So the native where you got the log from seems to start fine but it doesn’t get a relay server connected… At first glance, I don’t know what’s wrong if you say you’ve allowed mobile data. Doesn’t seem to be caused by Syncthing. It’s also different from the linked issue because the issue creator reported the native had problems to start up at all.
Also, remember that syncthing does not use android APIs, so there is no “mobile data” in syncthing, there is either internet, or not internet, syncthing does not care or distinguish which medium it comes from.
It could be that the firewall is fundamentally incompatible with syncthing as it acts at the android level, and expects syncthing to be an android app that respects various android connection particularities.
I had a similar problem with Android Firewall (based on DroidWall, as is AFWall+) when running Syncthing as root. Are you running it as root? If yes, then you need to grant Internet access for root applications separately. Granting it to Syncthing only will not work.
If you are not running as root, then please ignore this post.
With the permissions above Syncthing didn’t work.
I’m not really skilled in iptables, so didn’t try to create custom Syncthing specific rules.
Then I just removed permissions for VPN and Tor(I don’t use them too often) , and that fixed the issue.
So, now it looks like below: