afwall icon indicating copy to clipboard operation
afwall copied to clipboard

Wi-Fi tethering: --match owner for Android Pie/9 on Google Pixel 2, incorrect uid

Open michaelbarrientos opened this issue 5 years ago • 5 comments

Android version 9, build taimen-pq2a.190305.002 (Google Pixel 2) dnsmasq running as UID 1052

Added the following custom script to match uid 1052: ` #!/system/bin/sh

IPTABLES=/system/bin/iptables IP6TABLES=/system/bin/ip6tables

$IPTABLES -I afwall-wifi-tether -p udp -m owner --uid-owner 1052 -m udp --sport 67 --dport 68 -j RETURN $IPTABLES -I afwall-wifi-tether -p udp -m owner --uid-owner 1052 -m udp --sport 53 -j RETURN
$IPTABLES -I afwall-wifi-tether -p tcp -m owner --uid-owner 1052 -m tcp --sport 53 -j RETURN

$IP6TABLES -I afwall-wifi-tether -p udp -m owner --uid-owner 1052 -m udp --sport 67 --dport 68 -j RETURN $IP6TABLES -I afwall-wifi-tether -p udp -m owner --uid-owner 1052 -m udp --sport 53 -j RETURN
$IP6TABLES -I afwall-wifi-tether -p tcp -m owner --uid-owner 1052 -m tcp --sport 53 -j RETURN `

michaelbarrientos avatar Mar 21 '19 17:03 michaelbarrientos

+1. Same issue for me (on andoird 9 / lineageos 16.1). Thanks for the iptables rules

OhSoGood avatar Apr 19 '19 06:04 OhSoGood

Thank you! This solved my persistent tethering issue. I have Android 9, Lineage OS running on OnePlus One. Your iptables rules fixed the tethering issue!

takiainen avatar Apr 26 '19 13:04 takiainen

I just spent two hours troubleshooting this to come to the same conclusion. I googled "android dnsmasq 1052" when I finally figured out what to do and this came up. I'm also on Lineage 16(Android 9/P).

My solution was:

iptables -I afwall-wifi-tether 1 -p udp -m owner --uid-owner 1052 -m udp --sport 53 -j RETURN
iptables -I afwall-wifi-tether 1 -p tcp -m owner --uid-owner 1052 -m tcp --sport 53 -j RETURN

You may also want to see https://github.com/ukanth/afwall/issues/964

This is a trivial fix. Suggest someone fork. AFW has seemed kinda dead for awhile now. This product is ripe for a replacement or takeover.

BlessDeix92 avatar Feb 05 '20 10:02 BlessDeix92

Just to confirm, the AFWALL tethering problem still exists on android 10 (One Plus 8 Pro). It is solved for me by BlessDeix92's version of the script (must add the #!/system/b)in/sh and iptables==/system/bin/iptables lines).

michaelbarrientos's version of the script caused an error - I did not debug further.

ln13ln13 avatar Jul 11 '20 22:07 ln13ln13