[Android Apps and Games] fddm:
USB Tether v0.8

Spoiler content hidden.

USB Tether is an application to automatically enable and restore RNDIS tethering when connected to a USB host. Supports SNAT and Masquerading for IPv6 in addition to modifying TTL/HL, given these options are supported by your kernel. This app never invokes tether provisioning checks and will never connect to a dun interface unless you tell it to. It's suggested to leave the interface on Auto when tethering mobile interfaces. If you are on a device with just root, you can only tether mobile internet through a VPN (unless you set the TTL on the client side or your provider does not check). Tethering WiFi networks also works with root alone.

When using a VPN or a line without video throttling, you might find that users playing video can consume all available bandwidth, increasing latancy to the point where it's unusable for others. QoS isn't really viable on mobile networks given that speeds can vary wildly. Instead we can set a per IP bandwidth limit to try and keep usage reasonable.

Settings:

Tether Interface - Select the interface to tether from. These can be real interfaces like your mobile network/wifi or virtual like VPNs/translation layers. Networks are currently filtered by the presence of an IPv4 address.

Enable Dnsmasq - Server to provide DHCP, DHCP6, and SLAAC. This gives clients ip and routing information. Only disable this if you use static addresses or run the server on OpenWRT downstream.

IPv4 Address - Sets the phone's IPv4 address/prefix. Lets you set the local network to 10.0.0.1 or 192.168.1.1, for example.

IPv6 NAT - Select IPv6 NAT type (SNAT, Masquerading, or None). Masquerading just needs the interface while SNAT also requires the IPv6 address, so Masquerading is usually preferred. One of these needs to be supported for IPv6 to work.

IPv6 Prefix - Allows you to set ULA or GUA for private or public address. Selecting GUA will make IPv6 the default.

Modify TTL/HL - Modify the IP packets leaving your device to have a time-to-live/hoplimit of 64. Masks the life of packets to make it look like they originated from your mobile device.

DPI Circumvention - Redirect traffic on ports 80 and 443 to a local proxy that applies anti-dpi techniques. This works around things like video throttling without the need for a VPN.

Autostart VPN - Allows you to auto start a VPN before tethering. For this to work with WireGuard, you will want to enable "Allow remote control apps" in your WireGuard settings, exclude WireGuard from battery optimizations, and set WireGuard as an always-on VPN.

WireGuard Profile - The name of the WireGuard profile you would like to be toggled.

Max Client Bandwidth (kBps) - Sets maximum allowed download speed per IP. This only effects TCP traffic as it relies on dropping packets to slow packet flow. Setting to 0 disables this feature.

Kernel Prerequisites:

Some features require your kernel to be compiled with specific options to be usable. This is up to you or your kernel maintainer to enable them at compile time. Distros Like Lineage OS will have none of these enabled by default, requiring you to obtain the sources and recompile the kernel yourself.

For Modify TTL/HL:

CONFIG_NETFILTER_XT_TARGET_HL - modify TTL and HL hoplimit

For IPv6 SNAT:

CONFIG_NF_NAT_IPV6 - IPv6 NAT support

CONFIG_IP6_NF_NAT - IPv6 NAT iptables support

For IPv6 Masquerading:

(The options required for SNAT)

CONFIG_NF_NAT_MASQUERADE_IPV6 - IPv6 MASQUERADE support

CONFIG_IP6_NF_TARGET_MASQUERADE - IPv6 MASQUERADE target support

Note: CONFIG_NF_NAT_MASQUERADE_IPV6 cannot be built as a module since kernel 4.18. The entire kernel must be rebuilt for masquerade support.

NOTES:

-Make sure you have no default action set for USB to avoid conflicts. It is expected that ADB be enabled, though it is not used or required.

-Android only supports one tethering operation at a time. You must first disable USB Tether before enabling your wifi hotspot.

-USB Tether keeps a CPU wakelock while enabled. It is suggested to disable it when not in use if battery drain is an issue.

-Some providers default to IPv4 only in their APN configuration. Set 'APN protocol' to enable IPv6 for your mobile network if needed.

SOURCE:

GitHub - worstperson/USBTether

Contribute to worstperson/USBTether development by creating an account on GitHub.

github.com

CHANGELOG:

0.0 - 4ae142c - add support for usb_gadget to control USB state with an option to force legacy behavior, add iptables check for TTL/NAT6/TPROXY and hide/disable unsupported features, add DMZ support, TPROXY support for IPv6, process watchdog, mobile network watchdog, VPN watchdog

0.8 - 134e625 - support CLAT "v4-" interfaces in Auto mode, support for per IP bandwidth throttling, support DPI circumvention, configure tether through a callback

0.7 - 95ff013 - make IPv4 address/subnet configurable, fix problems introduced with v0.6

0.6 - cd848d0 - restore connection on network change, VPN autostart/restart/stop

0.5 - 9c0b84f - improve USB state handling, restore connection on USB reset, fix for <= Oreo

0.4 - 1b0e162 - add prefix ULA/GUA selection(using GUA will make IPv6 preferred)

0.3 - dd7695f - fix USB detection, fix IPv6 hoplimit rule, apply MSS Clamping to IPv6, update dnsmasq

0.2 - 9b38cd1 - automatic interface selection, dnsmasq(with dhcp, dhcp6, and slaac), IPv6 SNAT support

0.1 - 660e197 - initial commit

DOWNLOADS:

USB Tether v0.8 (12/26/21)

USB Tether Snapshot (2/28/23)