[Google Pixel 4a 5G Themes, Apps, and Mods] kevin71246:
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://xdaforums.com/t/kernel-pixe...-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