Related
Hi,
i am currenty developing an application for location based services. Therefore it's needed to receive wifi broadcast on device. I'm using UDP-Socket for receiving Packets. The strange thing is that not every custom ROM (all 2.1 roms) is receiving the broadcast. The stock rom also doesn't receive the broadcasts
As the application is for a project of my university it would be nice to stay on a stock rom.
Does anyone if there is a option / tweak (pehaps security related issue) to enable/disable broadcast receiving?
Best,
Mst
No ideas ?
Mst_x, you ever find out any more about this?
My HTC Hero was receiving UDP broadcast traffic fine with various 2.6.27 kernels. Have tried two different 2.6.29 based custom roms, as well as rebuilding the 2.6.29 kernel with as close as possible the same network options to the working 2.6.27 kernel, but no love - UDP broadcast traffic seems broken on my Hero with 2.6.29 kernel...
- jc
Decided to test FroydVillain 1.1.0 (also has 2.6.29 kernel) and found broadcast traffic works! After more messing about, decided to try the /system/bin/wpa_supplicant from Froyd on my phone running the broadcast-problematic** (see below) VillainRom12: broadcast traffic was suddenly visible again.
Both wpa_supplicant binaries report the same version - v0.5.11.
Code:
# md5sum wpa_supplicant*
66f2774a5dbd0afe65cf7963f55728e0 wpa_supplicant_FroydVillain110
7db83d60c6376dd87541f6749b561c4a wpa_supplicant_VR12
Update: This issue seems to affect several HTC Android phones, I subsequently found it reported as Android Issue 8407: HTC Desire Android 2.1-update1 does not receive udp broadcasts
- jc
** The real problem for me here is the 'wpa_supplicant' build from HTC. VillainRom12 is rock-n-roll good - it just inhereted the problem from the Stock HTC Android 2.1 update.
Hi Devs,
I'm trying to get my android to transparently forward certain domains/IPs to a proxy server automatically.
For this I am trying to use IPTABLES, however the compiled version I can find on the device is not compiled with glibc, but with a reduced version. When trying to use any commands that refers to a specific protocol (TCP) then I get a similar error to:
FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:366
I been searching a lot for a binary of iptables, that doesn't have this problem but haven't been successful. However applications like wireless tether, droidwall, TOR client seem to work with the reduced iptables, looks like they are issuing simpler commands, I want to run something like:
iptables -t nat -A PREROUTING -i eth0 -s ! 192.168.10.16 -p tcp --dport 80 -j DNAT --to 192.168.10.16:8080
I am on a 2.1 ROM btw. Any suggestions on how to achieve selective transparent proxy forwarding o a full version of iptables for android?
Many thanks,
Edited:
BTW, I've just found out that the current iptables version works, it just prints the errors...
any one any clue?
fulanito108 said:
Hi Devs,
I'm trying to get my android to transparently forward certain domains/IPs to a proxy server automatically.
For this I am trying to use IPTABLES, however the compiled version I can find on the device is not compiled with glibc, but with a reduced version. When trying to use any commands that refers to a specific protocol (TCP) then I get a similar error to:
FIX ME! implement getnetbyaddr() bionic/libc/bionic/stubs.c:366
I been searching a lot for a binary of iptables, that doesn't have this problem but haven't been successful. However applications like wireless tether, droidwall, TOR client seem to work with the reduced iptables, looks like they are issuing simpler commands, I want to run something like:
iptables -t nat -A PREROUTING -i eth0 -s ! 192.168.10.16 -p tcp --dport 80 -j DNAT --to 192.168.10.16:8080
I am on a 2.1 ROM btw. Any suggestions on how to achieve selective transparent proxy forwarding o a full version of iptables for android?
Many thanks,
Click to expand...
Click to collapse
You tried VillainROM 10.2 with ninpo or kendon's kernel? I think they added iptables. Dunno any more than that
Thanks Pulser, I'm on VillainROM 5.5, I will update to 10 when I can, but is not the problem that I can't find iptables, the problem all the versions I find are not complete, they are compiled with bionic C library.
fulanito108 said:
Thanks Pulser, I'm on VillainROM 5.5, I will update to 10 when I can, but is not the problem that I can't find iptables, the problem all the versions I find are not complete, they are compiled with bionic C library.
Click to expand...
Click to collapse
Talk to ninpo about this, he can maybe help
The bionic library that iptables (and your android setup) was built against is missing getnetbyaddr, it hasn't been implemented yet, neither has getprotobyname, so iptables is very limited right now. I ran into this issue when enabling TOS for my build. It's in bionic/libc/include/netdb.h but needs a stub entry.
I guess that you can still compile iptables against glibc and link it statically. I am trying to find out if any one might have done this, or knows a workarround
Was there ever an update on this? I am working with someone on trying to get a "full" version of iptables going so we can try and implement qos....
spiicytuna said:
Was there ever an update on this? I am working with someone on trying to get a "full" version of iptables going so we can try and implement qos....
Click to expand...
Click to collapse
sorry haven't found it yet, and need it... if you get your hands around it please reply to this post
It's not the iptables full version you need, it's the underlying libc that is missing that particular resolver function, as kernelzilla already pointed out above.
Statically linking glibc would probably be an overkill - uclibc or dietlibc would probably be better choice. No idea if any of them implements these particular resolver functions, though.
EDIT: Shiny, after quick check of source code of both, they both *do* implement getnetbyaddr().
ticho said:
EDIT: Shiny, after quick check of source code of both, they both *do* implement getnetbyaddr().
Click to expand...
Click to collapse
Thanks Ticho, when I have some time I'll try to setup the dev enviroment to play compiling it...
fulanito108 said:
Thanks Ticho, when I have some time I'll try to setup the dev enviroment to play compiling it...
Click to expand...
Click to collapse
This would be awesome!!
BTW, I've just found out that the current iptables version works, it just prints the errors...
Disclaimer: I am not responsible for any damage you do to yourself or your device by following this guide (Although it seems very unlikely to happen).
USB Tether Phone to XOOM Guide.
I could not find a guide for this anywhere and it took me quite a while to figure out how it works so I thought I'll post a guide for other noobs like me, who want to share their phones data plan with their XOOM via USB tethering.
Since I only got a Wifi XOOM because I didn't want to spend money on a second data plan I used to wifi-tether my phone to my XOOM for internet connection. Unfortunately, Wifi-tethering drains the battery of my phone quite fast and the battery gets extremely hot so I was looking for an alternative.
Finally, I managed to share my phones internet connection with my XOOM via USB tether. Here is how it goes:
What you need:
* USB OTG cable (micro! not mini) - can be found at amazon, ebay, etc. for $5
* Phone that is capable of USB tethering (e.g. Xperia X8 \w miniCM7 / nAa kernel)
* XOOM running Team EOS ICS
* Tegra Development Overlay Rev 4 [link]
* Terminal Emulator (can be found in the play store)
I wont cover how to install Team EOS ICS since this can be found elsewhere.
What to do:
Step One - Install and Load the Drivers Needed
After you downloaded the Tegra Development overlay, flash it using eg. CMW over your existing Team EOS ICS. This will ad a whole bunch of extra modules (drivers) and a couple of init files to your system. Including the modules needed to USB tether your phone to the XOOM.
I don't know what would happen if you flashed the Development Overlay over any other ROM/Kernel than the one provided by Team EOS. But I would not recommend it!
[ADDITIONAL REMARK]
Note: If you really dont know anything about working with adb just ignore the following lines and go straight to Step Two. This is not necessary to get USB tethering working.
The Tegra Development Overlay contains the modules (drivers) needed for USB tethering a phone to the XOOM (and loads of others). The modules needed are: rndis_wlan.ko and rndis_host.ko.
After you flash the Dev Overlay, there will be a file called 06modules at /system/etc/init.d/. This file loads all 99 modules found at /system/lib/modules/. Since you actually just need 1 of those modules you might want to delete the "06modules" file and load the module needed manually by typing the following into your terminal emulator:
Code:
[STRIKE]modprobe rndis_wlan[/STRIKE]
modprobe rndis_host
This should load the module. You can check if the module was loaded successfully by using the following command:
Code:
lsmod
This will list all currently loaded modules.
Step Two - Connecting Your Phone
Switch on USB tethering on your phone and connect it to your XOOM via the OTG cable.
In the Terminal Emulator type:
Code:
dmesg
the output should look something like this:
Code:
[...]
<6>[ 150.829115] usb 2-1: new high speed USB device number 2 using tegra-ehci
<3>[ 154.608633] usb 2-1: device not accepting address 2, error -71
<3>[ 154.667257] hub 2-0:1.0: unable to enumerate USB device on port 1
<6>[ 154.945974] usb 2-1: new high speed USB device number 4 using tegra-ehci
<6>[ 155.002843] usb 2-1: New USB device found, idVendor=0fce, idProduct=812e
<6>[ 155.003359] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 155.004103] usb 2-1: Product: SEMC HSUSB Device
<6>[ 155.004388] usb 2-1: Manufacturer: SEMC
<6>[ 155.004658] usb 2-1: SerialNumber: CB511N60A1
<6>[ 155.066353] rndis_host 2-1:1.0: [B]usb0[/B]: register 'rndis_host' at usb-tegra-ehci.0-1, RNDIS device, 4e:7e:5d:7e:b9:1d
This indicates that your phone was successfully connected to your XOOM and the respective modules were loaded. Note the last line, right where it says rndis_host 2-1:1.0: usb0. Don't worry if it does not say "usb0" but e.g. "usb1" just keep it in mind for later.
Step Three - Assigning an IP Adress and Setting up the DNS server
Now that your phone is connected and registered the xoom needs to get an ip adress and a DNS server. This is done by typing the following into the Terminal Emulator:
Code:
su
dhcpcd [B]usb0[/B]
setprop net.dns1 8.8.8.8
"su" grants the terminal emulator SuperUser rights which are needed for the next step.
"dhcpcd usb0" starts an DHCP client for the interface "usb0" and asks for an IP adress. Now if you did not get "usb0" in step two but e.g. "usb1" then change the command accordingly.
"setprop net.dns1 8.8.8.8" sets the DNS server to Google's DNS Server (8.8.8.8), but you can, of course, use any DNS server you like.
If you write "ifconfig" in the Terminal Emulator you now should get an output like
Code:
usb0 Link encap:Ethernet HWaddr 4E:7E:5D:7E:B9:1D
[B]inet addr:192.168.42.187 [/B] Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::4c7e:5dff:fe7e:b91d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:295 errors:0 dropped:0 overruns:0 frame:0
TX packets:420 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:108787 (106.2 KiB) TX bytes:81153 (79.2 KiB)
Indicating that an IP adress has been successfully assigned to your XOOM.
And voilĂ . Now you have a working internet connection via USB tethering from your phone to your XOOM.
Unfortunately there are a couple of downsides:
* There seems to be a glitch in the rndis_wlan.ko or rndis_host.ko module causing a reboot of the XOOM whenever you disconnect your phone from your XOOM after USB tether or force unload the module after you tethered your phone. This issue is known and I hope it will be fixed in the future.
* The procedure described will only enable internet for your Browser, not for your mail apps (confirmed) and possibly not for any other app (did not try yet). Apparently you need to alter some settings (like adding the DNS server for the Browser) to make those apps work properly. Now, this might be very easy but since I'm a linux/android noob I did not yet figure out how.
TO DO
* The modules need to be fixed to solve the reboot issue. However, I am likely not skilled enough to do so, so this is up to Team EOS.
* Settings need to be passed to mail apps. Now this should be fairly easy and I'll try to figure that out.
* A one click app to configure the internet connection would be great. I never did any linux/android coding, but I'll give it a shot.
Thanks a lot to bigrushdog for helping with the rndis_host.ko bugs!!!
Any suggestions or thanks are welcome!
I'm gonna grab this spot cause you are gonna need some help on this one. Good post.
I have a lot of info on this, and will post what I got shortly. LTE devices use usb0 to facilitate radio operations. So rndis host assigns usb1 in this case. I'm not sure about the other builds. Also, ill take a fresh look at the hard reboot issue. I know something causes a kernel panic, but I'm not sure where the fail lies.
modprobe rndis_host
The rndis_wlan is not needed. That's for a rare build of wireless dongles.
I just tried to use USB tethering a couple days ago and had an issue... Thanks for this I was hoping it would be implemented in an updated kernel...
playya said:
I just tried to use USB tethering a couple days ago and had an issue... Thanks for this I was hoping it would be implemented in an updated kernel...
Click to expand...
Click to collapse
I'm about 100% sure it won't be in the release versions of the tiamat kernel. Rndis is just too unstable and wonky to be in a distro kernel. We need the distro kernel to be as stable as possible. That's why I do the overlay. Also, I use overlay users a guinea pigs to see what works and what don't. My test build with a new rndis driver doesn't work. Ill keep at it.
bigrushdog said:
I'm gonna grab this spot cause you are gonna need some help on this one. Good post.
I have a lot of info on this, and will post what I got shortly. LTE devices use usb0 to facilitate radio operations. So rndis host assigns usb1 in this case. I'm not sure about the other builds. Also, ill take a fresh look at the hard reboot issue. I know something causes a kernel panic, but I'm not sure where the fail lies.
modprobe rndis_host
The rndis_wlan is not needed. That's for a rare build of wireless dongles.
Click to expand...
Click to collapse
Thanks a lot for your help on this!
Wow! Awesome this really works , thanks for sharing this mate, and I hope the reboot problem will be fix.
just curious, if your phone have support by cm7, you can also use bluetooth tethering which is less of a work. My wife's htc hero doesn't support infrastructure mode but her phone run cm7 and in there I can bluetooh tether to the xoom without a single problem. Just thought I'd ask.
dumb question. why use usb tether. wifi tether works just fine on my tbolt using opengarden wi-tether. dont think the battery drains any different since data pull is more. Also what device do you have that the battery is getting hot?
I got an Xperia X8 running MiniCM7. The X8 doesnt offer any kinder of tethering from stock and miniCM7/nAa kernel only offers usb or wifi tether. So bluetooth tether is no option for me.
And my phone is draining a large amount of battery when wifi AP and 3G is enabled. This also results in the phone getting hot. It needs excessive amounts of power and this heats up the battery.
Using USB tethering has a couple of advantages. First it is safer since you dont use wireless connections apart from 3G, second you consume less battery (wifi AP does need a lot of power) and third I actually charge my battery while sharing my internet connection with my XOOM.
Also I really just like the idea of USB tethering my phone to my XOOM...
MagicVie said:
I got an Xperia X8 running MiniCM7. The X8 doesnt offer any kinder of tethering from stock and miniCM7/nAa kernel only offers usb or wifi tether. So bluetooth tether is no option for me.
And my phone is draining a large amount of battery when wifi AP and 3G is enabled. This also results in the phone getting hot. It needs excessive amounts of power and this heats up the battery.
Using USB tethering has a couple of advantages. First it is safer since you dont use wireless connections apart from 3G, second you consume less battery (wifi AP does need a lot of power) and third I actually charge my battery while sharing my internet connection with my XOOM.
Also I really just like the idea of USB tethering my phone to my XOOM...
Click to expand...
Click to collapse
Fair enough but according to Cyanogenmod site your x8 can run cm7.1. In CM7.1 when you paired the xoom and your x8, and going into the xoom bluetooth properties there's an option to share internet from your paired phone (x8).
Just thought I'd give you an alternative option from usb tether that's all. Take care!
I'm running the Team EOS wingray "nightly build 90" and can't seem to get past "modprobe rndis_host" (the lsmod output does not include rndis_host - when I execute "modprobe rndis_host" without "su" first, I get "modprobe: 'rndis_host.ko': Operation not permitted" - if I execute after su, I get "modprobe: 'rndis_host.ko': invalid module format") - any suggestions?
Tom
tadiv said:
I'm running the Team EOS wingray "nightly build 90" and can't seem to get past "modprobe rndis_host" (the lsmod output does not include rndis_host - when I execute "modprobe rndis_host" without "su" first, I get "modprobe: 'rndis_host.ko': Operation not permitted" - if I execute after su, I get "modprobe: 'rndis_host.ko': invalid module format") - any suggestions?
Tom
Click to expand...
Click to collapse
I fell back to build 84 and got the same results...
Sent from my Xoom using XDA
I think I understand
tadiv said:
I fell back to build 84 and got the same results...
Sent from my Xoom using XDA
Click to expand...
Click to collapse
Other related posts (such as http://forum.xda-developers.com/showthread.php?t=1513490 ) suggest that this overlay is for version 3.0.5 of the kernel - both of the builds I noted above have later versions of the kernel...
Tom
---------- Post added at 10:30 AM ---------- Previous post was at 09:44 AM ----------
tadiv said:
Other related posts (such as http://forum.xda-developers.com/showthread.php?t=1513490 ) suggest that this overlay is for version 3.0.5 of the kernel - both of the builds I noted above have later versions of the kernel...
Tom
Click to expand...
Click to collapse
Yup, I loaded the Team EOS 1.0.0 and it works - in fact, this post is via usb tethering from my Xoom!
Tom
---------- Post added at 10:52 AM ---------- Previous post was at 10:30 AM ----------
MagicVie said:
.
TO DO
* The modules need to be fixed to solve the reboot issue. However, I am likely not skilled enough to do so, so this is up to Team EOS.
* Settings need to be passed to mail apps. Now this should be fairly easy and I'll try to figure that out.
* A one click app to configure the internet connection would be great. I never did any linux/android coding, but I'll give it a shot.
Thanks a lot to bigrushdog for helping with the rndis_host.ko bugs!!!
Any suggestions or thanks are welcome!
Click to expand...
Click to collapse
I have successfully used the 'scripter' app to set this up -
My script is as follows:
modprobe rndis_host
dhcpcd usb0
setprop net.dns1 8.8.8.8
Scripter reports errors, but it works...
Tom
The latest overlay contains our 3.0.9 version kernel. And the overlay works with any eos build and likely any rom. We continue to research the reboot issue .
I do show the 3.0.9 kernel now with the overlay on the 1.0.0 ROM - but I assure you, I could not load the module with the nightly builds I mentioned above...
Tom
tadiv said:
I do show the 3.0.9 kernel now with the overlay on the 1.0.0 ROM - but I assure you, I could not load the module with the nightly builds I mentioned above...
Tom
Click to expand...
Click to collapse
With the overlay, there is no need to load any modules. They load automatically on boot.
bigrushdog said:
With the overlay, there is no need to load any modules. They load automatically on boot.
Click to expand...
Click to collapse
Sure enough - I don't know what I was doing wrong before, but now I have rndis_host in the lsmod output like it should be on the nightly build 90 and the overlay... As a point of detail, I restored my nandroid of nightly 90 then applied the overlay and it just worked.
Thanks!!
Tom
P.S. The working scripter script is now:
dhcpcd usb0
setprop net.dns1 8.8.8.8
Modified 06modules
Instead of deleting the 06modules file, I edited it to look like:
--------------------------------
#!/system/bin/sh
#
# Load any extra modules
#
#MODPATH=/system/lib/modules/
#
#for i in `ls $MODPATH`
#do
#modprobe `basename $i .ko` >/dev/null 2>&1
#done
#exit 0
modprobe rndis_host
--------------------------------
commenting out everything but the last line that I added. This way I keep the original code, but only load the module I want to use... The editor I used created a 06modules.bak and that file had to be deleted, because it was also executed with the result of loading all the modules... Once it was deleted, only the rndis_host module is being loaded.
Tom
For the adventurous type look here
http://forum.xda-developers.com/showthread.php?t=1494891
This is a thread on using 3g dongles. However, there is a.wealth of information on IP routing that should apply here as well.
I have installed 4.4 rom latest, also using kernels suitable. My problem is that when I use VPN apps like OpenVPN connect, the connection speed gets very slow. I checked the logcat and find errors like:
exec() res=0, status=256 for /system/bin/iptables -t mangle -D st_mangle_POSTROUTING -p tcp -o tun0 --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
12-26 16:04:17.561: I/ip6tables(131): ip6tables: No chain/target/match by that name.
12-26 16:04:17.568: I/ip6tables(131): ip6tables terminated by exit(1)
I have searched this problem and found something useful (prevent spam):
android.googlesource.com/platform/system/netd/+/ca5b4e8%5E!/
it says:
SecondaryTableController: force the MSS to match pmtu on TCP SYN
Without this change, the VPN sets up a tun/ppp that needs a small
MTU, and during TCP SYN the MSS will end up matching the outgoing iface
MTU which is potentially too big.
This leads to connection flakiness. The wrong MSS is visible by
tcpdump-ing on the tun/ppp device.
With this change, the MSS now is correct.
It requires the kernel to be configured with
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
If kernel is not configured, it silently fails.
Click to expand...
Click to collapse
So I did look for a 4.4 kernel with this config enabled, I have checked config source of all current 4.4 kernels including franko,Mpokang,ASKP,Fancy, etc, but sadly I did not find one. I guess the reason is it's not included is because the code change happened not a long time ago, and for the same time the Galaxy Nexus kernel stood unupdated.
If kernel developers see this thread, thanks for all of your hard work and I wish you can check if the config is the reason of my problem. It will be better if I can post this thread in the development section, but it seems it's forbidden.
--Archie
You can try to get their attention by mentioning @nameofdeveloper in here to get them to notice the thread, or send a PM to them directly. I think XDA will not allow you to post in developer sections until 10 or more posts.
Have you tried a 4.4 kernel with that patch to see if it works?
Getting VPNs to work flawlessly has always been tricky issue with the custom kernels, hopefully yours can be addressed soon.
kaijura said:
You can try to get their attention by mentioning @nameofdeveloper in here to get them to notice the thread, or send a PM to them directly. I think XDA will not allow you to post in developer sections until 10 or more posts.
Have you tried a 4.4 kernel with that patch to see if it works?
Getting VPNs to work flawlessly has always been tricky issue with the custom kernels, hopefully yours can be addressed soon.
Click to expand...
Click to collapse
Thanks for your reply, since many custom kernels are based on the CM kernel, I think the most efficient way is to let CM team know this bug and fix it. Unfortunately CM team dose not accept a bug report of a nightly build version. Now I have resolved this issue by patching a kernel and building myself. I have built a patched kernel based on CM 11.0 source code and the VPN issue is gone. People have this issue may use this kernel(source from CM, patched by me)
[kernel_tuna_4.4.2_CM_MSS_fixed_Archie_20131227] pan.baidu.com/s/1bnzP2GJ (to prevent link spam)
longkas said:
Thanks for your reply, since many custom kernels are based on the CM kernel, I think the most efficient way is to let CM team know this bug and fix it. Unfortunately CM team dose not accept a bug report of a nightly build version. Now I have resolved this issue by patching a kernel and building myself. I have built a patched kernel based on CM 11.0 source code and the VPN issue is gone. People have this issue may use this kernel(source from CM, patched by me)
Click to expand...
Click to collapse
Good to know the build worked. You can submit your patch information to the Cyanogenmod JIRA: http://jira.cyanogenmod.org as a feature or improvement, but you want to get the attention of @dhacker29 since he currently maintains the Maguro kernel on Cyanogenmod. You can make a pull request on github or send him a PM here directly.
http://www.github.com/dhacker29
Has someone put this bug to jira.cyanogenmod.org ???
Ive the same bug with my htc phone...
Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
Confirmed OS's that work: LineageOS18.1, LineageOS19.1
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App: (Shouldn't be necessary if running latest script since that does this step for you on every boot)
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Updates:
* I updated the thread title since no one reporting the Android 12 kernel mod is working (only 11 works this far)
* I added "ttl_magisk_L19.zip" script which runs the iptables command for you on every boot. I just tested this on LineageOS19.1 and it works good. I'm working on testing it on LineageOS20.0...
Based on what @fddm said though, it sounds like a Magisk module like this will not work on stock AOSP because it "enforces signatures on modules". If anyone can confirm that, or a workaround that would be helpful. Also https://forum.xda-developers.com/t/...l-tether-lineageos-18-1.4295601/post-86173703 indicates we'll want to disable IP6 via these commands:
ndc interface ipv6 rndis0 disable
ndc interface ipv6 wlan0 disable
If anyone wants to test & get back that'll be great. With Tmobile I didn't need to do that (yet), but again feedback would be great.
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
fddm said:
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
Click to expand...
Click to collapse
So you think this should work on stock? Thanks man! I need my phone for work so can't put it offline for hours atm, but maybe over the weekend I can. I'd like to reflash android 12 stock & see if this works. I'd have to assume there's some interest in this... Someone else to test...who knows
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
creezalird said:
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
Click to expand...
Click to collapse
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
kevin71246 said:
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
Click to expand...
Click to collapse
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
kevin71246 said:
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
Click to expand...
Click to collapse
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
creezalird said:
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
Click to expand...
Click to collapse
Mind going into your phone settings & post your kernel version? Thx
kevin71246 said:
Mind going into your phone settings & post your kernel version? Thx
Click to expand...
Click to collapse
sure, here you go
kevin71246 said:
Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App:
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Click to expand...
Click to collapse
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
ankur414 said:
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
Click to expand...
Click to collapse
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
kevin71246 said:
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
Click to expand...
Click to collapse
Hi, thanks for the response. I am using a Pixel 4a 5G:
LineageOS 18.1-20220116
Build: lineage_bramble-userdebug 11 RQ3A.211001.00110038514
Kernel: 4.19.160-ge469934bead0
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Sorry.
tested the ttl A12 zip
Termux commands in op gave no error.
also ran #ndc interface ipv6 wlan0 disable (accepted)
#ndc interface ipv6 rndis0 disable would not take
noT Mobile buy metropolitition
if anyone could give me some advice for my quest2 multiplayer problem would have much love ... its the main reason I run hotspot.
OnePlus 6T
Model: A6013
Android 12
Sec. patch 1/5/2022
ProtronExtended version
12.2.1
[ROM][12L][fajita] ProtonXtended (PXOSP) [AOSP]
ProtonXtended (PXOSP) Android 12 based ROM About Project PXOSP (Proton Xtended Open Source Project) is a fork based on ProtonAOSP to enhance the user experience with useful addition features. Screenshots Screenshots of the PXOSP Installation...
forum.xda-developers.com
Kernel ver.
4.9.227Syberia+-g44a024f66f1a
#1 Tue Jan 25 19:55:25 UTC 2022
Linux version 4.9.227Syberia+-g44a024f66f1a ([email protected]) (Android (7485623, based on r416183b1) clang version 12.0.7 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)) #1 SMP PREEMPT Tue Jan 25 19:55:25 UTC 2022
Magisk custom update channel
24.1 (24100)
@topjohnwu
kevin71246 said:
That iptables command should be persistent across a reboot.
Click to expand...
Click to collapse
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
everburn said:
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Click to expand...
Click to collapse
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
fddm said:
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
Click to expand...
Click to collapse
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
everburn said:
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
Click to expand...
Click to collapse
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
kevin71246 said:
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
Click to expand...
Click to collapse
thats probably it right there thanks
Have tried both on Pixel 4a 5G, Android 11 stock, rooted, RQ1C.210205.006
"unknown option --ttl-set" on both