Rootless, VpnService-free Android userspace USB Ethernet tether (ngo.xnet.ethbridge).
EthBridge claims a USB Ethernet adapter in Android USB Host Mode—driving Realtek RTL8152/8153 adapters directly on Config 1 via USBDEVFS_CONTROL / USBDEVFS_SUBMITURB (falling back to CDC-ECM when available)—and forwards dual-stack IPv4 and IPv6 traffic through an embedded hev-socks5-tunnel + lwIP userspace stack pinned to the cellular network (android_setsocknetwork()).
- No root, no
VpnService, noTetheringManager/DUN — operates purely in app userspace overUsbDeviceConnectionfile descriptors. - Native RTL8152/8153/8156 Config 1 driver (
r8152-usb.c) — avoids Config 2 USB resets andr8152-cfgselectorsnap-back on Pixel devices, with automatic CDC-ECM fallback. - Dual-stack IPv4 + IPv6 with dynamic upstream DNS:
- IPv4:
10.200.0.1/24gateway, built-in ARP + DHCPv4 server (10.200.0.2–10.200.0.250, Option 6 populated from active upstreamLinkPropertiesDNS with1.1.1.1/8.8.8.8fallback), unprivilegedIPPROTO_ICMPecho relay, and TCP/UDP forwarding. - IPv6: EUI-64 link-local gateway +
fd00:c800::1/64ULA, SLAAC Router Advertisements (prefixfd00:c800::/64, MTU1428, RDNSS populated from active upstream DNS with2606:4700:4700::1111/2001:4860:4860::8888fallback), NDP NS/NA, unprivilegedIPPROTO_ICMPV6echo relay, and IPv6 TCP/UDP forwarding.
- IPv4:
- Edge-to-edge Android 15+ UI & strict native build:
enableEdgeToEdge()+WindowInsetsCompatpadding,-Wall -Wextra -Werrorenforced on custom C sources (ethbridge_custom), and 16 KB (0x4000) ELF alignment verification inscripts/build-native.sh. - Integrated line-speed test server (
eth-speedtest.c): Built-in HTTP/1.1 (:5201) and raw TCP (:5202DL /:5203UL) benchmark endpoints on10.200.0.1and[fd00:c800::1](zero cellular traffic) plus live Mbps & benchmark readouts in the app UI.
With the bridge active, run from the tethered host (zero cellular data used):
# Web UI (browser)
http://10.200.0.1:5201/
# HTTP Download / Upload (IPv4)
curl -o /dev/null -w '%{speed_download} B/s\n' 'http://10.200.0.1:5201/down?bytes=50000000'
dd if=/dev/zero bs=1M count=50 status=none | curl -T - http://10.200.0.1:5201/up
# HTTP Download / Upload (IPv6)
curl -6 -o /dev/null -w '%{speed_download} B/s\n' 'http://[fd00:c800::1]:5201/down?bytes=50000000'
dd if=/dev/zero bs=1M count=50 status=none | curl -6 -T - 'http://[fd00:c800::1]:5201/up'
# Raw TCP streams & JSON stats
nc 10.200.0.1 5202 >/dev/null
dd if=/dev/zero bs=1M count=50 status=none | nc -N 10.200.0.1 5203
curl -s http://10.200.0.1:5201/statsNotes:
- The server is LAN-local only (listens only on
10.200.0.1/fd00:c800::1) and deliberately constrained: at most 8 concurrent sessions and 30 s per test, so a tethered client can't hold resources indefinitely. Raw-TCP downloads run for up to 30 s regardless of?bytes=; HTTP downloads honor?bytes=or?sec=(capped at 1 GB / 30 s). - Benchmark readouts (
/statslast_dl_mbps/last_ul_mbpsand the app's "Bench" line) are only updated for transfers of at least 64 KB; short?bytes=probes count toward the live counters but not the recorded benchmark.
app/— Android Kotlin application (MainActivity,EthTetherService,CdcEcmUsbHelper,EthBridgeNative, XML resources & adaptive icons).native/tunnel/— Native C/NDK sources (eth-bridge.c,r8152-usb.c,hev-jni.c,hev-socks5-session.c,hev-socks5-tunnel,lwip,hev-task-system,yaml).scripts/build-native.sh— Buildslibethbridge.so(arm64-v8a), checks 16 KB ELFLOADalignment, and copies it intoapp/src/main/jniLibs/arm64-v8a/.
# 1. Build native library (requires Android NDK)
./scripts/build-native.sh
# 2. Build debug APK (requires JDK 21 and Android SDK)
JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 ANDROID_HOME=~/android-sdk ./gradlew assembleDebug --no-daemon