Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android tethering, how to disable dhcp

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?

like image 876
russell Avatar asked May 26 '11 11:05

russell


People also ask

How do I enable DHCP on my mobile hotspot?

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.

How do I disable DHCP?

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.

How do I change Tethering settings?

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.

How do I unblock tethering on my Android phone?

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.

How do I set up a tethering enabler?

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.

Is there a way to disable DHCP on Pixel C?

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)?

What is the DNS range for WiFi tethering on Android?

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.


1 Answers

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.

like image 115
inazaruk Avatar answered Sep 27 '22 19:09

inazaruk