bt-tether: add DHCP support for Android#442
Conversation
Added ip-method config option for DHCP vs static IP configuration. Android 11+ randomizes tethering subnets, breaking static IP configs. Changes: - Add ip-method config: "auto" (DHCP) or "manual" (static) - Android defaults to DHCP, iOS to static - DNS validation relaxed for DHCP mode Signed-off-by: cVeqT2vkiSX5kJVJxcVmz7rKHKbu9M9FNixoPNC <cVeqT2vkiSX5kJVJxcVmz7rKHKbu9M9FNixoPNC@users.noreply.github.com>
|
Great work, will test soon as i can. |
|
@wpa-2 is testing bt-tether functionalities. If he says it works I trust him and I will accept the PR. |
|
I don't have an iPhone or other Android device for available testing WIth DHCP I use IPDisplay to get the IP |
Sadly didn't work for me, any settings i need to adjust on the config? The issue seems to be with android16 not 11 EDIT |
|
For the changes I added the config item Maybe the better mode is to use Static mode when For discovering the IP address, maybe there is a way to get hostname resolution working for Bluetooth PAN? |
Sadly i couldnt find a way to even set a static IP, it seems every time you turn BT on its always random now, which sucks. |
|
So what options do we need on the config now then ? this is the current options? |
|
This is the configuration with This is the current flow to decide which mode to take. For existing configuration this should not change behaviour.
Stale static IP in network connection |
The dynamic IP stayed the same during reboots of the pwnagotchi. How to address this:
|
|
There is one thing consistent with my android build I found recently: it always starts with a 10.x.x.x/24. So depending on what build and model, the BT-pan is confirmed to always keep that consistent depending on the driver and the manufacture as long as it's android 13+ |
Tested static option>? bnep0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 Connects to phone but IP isnt working in the UI or pwnlog and after reboot I get Even when it does connect IP isnt working |
|
Marked this PR as Draft, while we try to sort this out. The log For testing I removed the BT-PAN, followed the BT-Tethering process and used the following two configurations bt-tether w/ static IPsbt-tether w/ DHCPRemove BT-PAN$ sudo bluetoothctl
devices
untrust 08:8B:C8:CO:FF:EE
remove 08:8B:C8:CO:FF:EE
exit
$ nmcli connection show
$ sudo nmcli connection delete $(nmcli -g connection.uuid connection show 'Pixel9Pro Network') |
Let me test again now ? So to confirm after moving the bt-pan redo the pairing process again. |
This is the edit im using? Not tested dhcp yet as I think static IP's is the best approach for thew wider use. oddly when clicking It does show all the BT information as if it's connected. |
|
Hi Devs, Thanks for making this nice project possible! I am on 2.9.5.4 and tried all possible config combinations found here and elsewhere, with empty ip/gateway with ip-method set to 'auto' or to 'dhcp', bt-tether always shows '-' and there is no tethering working/no internet. If I manually bring 'nmcli connection up "Phone"' it works but I would prefer it it worked as it should. For the time being I ended up setting up the Phone connection in network manager to auto, that way I get internet and connectivity from my phone while on the go. But I would prefer the 'proper' setup. So, what is the drill to get this working? Regards, |
|
Nevermind, I realized that this is not released and downloaded the bt-tether.pl from @cVeqT2vkiSX5kJVJxcVmz7rKHKbu9M9FNixoPNC 's commit. |
Description
Added DHCP support to bt-tether plugin for modern Android devices that randomize tethering subnets.
Key changes:
ip-methodconfig option ("auto" for DHCP, "manual" for static)Motivation and Context
Android 11+ randomizes the Bluetooth tethering subnet prefix on each connection (e.g.,
192.168.X.Ywhere X changes). This breaks static IP configurations that assume192.168.44.x.Fixes #441
How Has This Been Tested?
Types of changes
Checklist:
git commit -s