Hello,
I noticed that with the latest /eOS release, 1.5, the IP mask assigned to an external device connected via USB tethering is not constant, so that the IP of that device changes everytime the USB tethering is reconnected.
This wasn’t happening with previous versions of the system and it’s causing me some troubles, as I’d like the IP to be static and to survive across reconnection.
did you change major Android versions at the same time? I use the usb-tether feature seldomly so can’t say if Android R was different. But yes, I see what you describe (in 1.5 S)… but can’t find an option to make the usb tethering static. Read the docs on the wifi mac-randomization, but no mention of usb
Hi,
for me, tethering not runs on linux , but ok with windows : i work on linux , so disturbing … This, until the 1.0 version , approximately: it was ok before .
I don’t think this is up to /e/ but is just a default with newer Androids. The tethering code changed between Android 10->11 and again 11->12. Before 10 it was static, then it it was stable mac+ip via dhcp in 10 (e, then stable mac, dynamic dhcp ip in 11, in 12 you get random mac and dynamic ip.
not sure how to set it though - either via “adb shell settings put global tether_enable_legacy_dhcp_server 1” or some "adb shell content query --uri content://settings/ … " (then use update instead of query)
As part of my tasks in my job position, I need to demo an Android application that connects to a service installed locally in the laptop. So, I need to have a shared local network in which the Android application sees that service and I achieved that with USB tethering + bridging in the laptop-
Access must happen via a FQDN, not just IP, so I need to define the corresponding records in the DNS zone. This is why I need the IP to be the same after a switch off / switch on of USB tethering.
I hope that this clarify the scenario.
Is the command ./adb shell settings put global tether_enable_legacy_dhcp_server 1 supposed to switch back to the previous behaviour?
no fqdn but very easy: adb reverse <laptop> <android> as in … tcp:8000 tcp:8000 and connect through http://localhost:8000 on the Android
a dhcp you control: let the laptop act as AP via wifi - you’ll have full control on dns and ip address of the AP, phone connects to Laptop AP. Downside: if you need an internet uplink at the same time, but there are solutions too (ap+sta mode combined, ethernet uplink + masquerading etc)
there are usb reverse-tethering utils: GitHub - Genymobile/gnirehtet: Gnirehtet provides reverse tethering for Android is very neat and uses a VPN to offer a stable IP ( 10.0.2.2 ). To control fqdn you’d need offer a little dns server of your own. I liked this alot but as “gnirehtet” hasn’t an option to specify an alternative dns port it’s a little hassle to free udp 53 on the hostmachine - but: as you said you already have a dns somewhere which Zones you can edit you’re not deterred - gnirehtet has this as “-d” option if it’s not a authorative dns
Another option would be to change your connection method.
For example, if you can disable WiFi MAC address randomization on your phone (some devices don’t …), you could activate a WiFi access point on your laptop, or use a cheap boxed one.
This way you could manage the IP address for your phone, using a DHCP static lease.