Using WifiManger and reflection(to find the enablewifiap() method), I am able to enable wifi tethering to create a wifi hotspot.
However, I would like to disable DHCP for the other devices that will connect to the phone that is acting as the hotspot. I am not able to find any functions that would achieve this. Anyone has a solution?
From the Mobile Hotspot screen, click the 3 dots icon (more), go to Advanced, then LAN settings. Under "Local IP" change the IP address to your desired IP. Under "Local DHCP" change the starting IP to match the subnet of your IP address.
Return to Settings > Network & Internet, and click the Properties button for network connection. Click the Edit button in the the IP settings section for the connection. The Edit IP settings dialog will contain your prior configs. Click the drop-down at the top of the dialog and switch it from Manual back to Automatic.
Navigate to Settings > Wireless & networks >Tethering & portable hotspot > Portable Wi-Fi hotspot. Choose Configure Wi-Fi hotspot to set a name, security setting, and password for your hotspot, then tap Save.
Neither of these tweaks actually provide a user interface—they just unblock Android’s built-in tethering features. After the phone is finished rebooting, jump into Settings > More > Tethering & Portable Hotspot to verify that tethering is indeed working.
Open the Magisk Manager, slide open the menu, and then choose the “Downloads” option. Tap the magnifying glass in the upper right corner,and then search for “tethering enabler.” When you’ve found the “Tethering Enabler” module, go ahead and tap the arrow next to the name to start the download.
I was able to establish an ethernet connection with LAN (DHCP) but the Pixel C does not provide the capability to disable DHCP and modify ethernet settings.This appears to be changed for Marshmallow. My question is, is there a procedure to create a static IP address and also disable DHCP on the Pixel C (Marshmallow 6.0.1)?
The Android builtin wifi tethering is designed to use 192.168.43.1/24 as the server, with netd handling the tethering, using dnsmasq. First DNS range is 192.168.42.1-254 and and 2nd DNS range is 192.168.43.1-254.
There are no functions exposed via WifiManager
, WifiService
and NetworkManagementService
that can disable DHCP for Wi-Fi AP (as far as I can see from thecode). You can inspect NetworkManagementService
's code closer (especially setAccessPoint
function) if you interested in implementation details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With