27

Unfortunately, there is no way to change the IP address range for the builtin tethering support, even in CyanogenMod. The Wi-Fi hotspot IP is hardcoded in android.net.wifi.WifiStateMachine.startTethering(); the USB tethering IP is hardcoded in com.android.server.connectivity.Tethering. However, if your phone is rooted, you can try using third-party apps for ...


21

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. Netd is not easy to change. It requires a socket to communicate with it, and that socket is taken when android starts tethering. But going through ...


7

just type netcfg it will lists the interface, and work on any terminal emulator. running on the phone itself, or remotely via adb.


6

You cannot simply edit the hosts file on Android, as it resides on a read-only file system: /system/etc/hosts, see: How to edit etc/hosts file How to change the hosts file on android Alternatives are: use a DNS server like DNSMasq in your local network to take care for that "centrally" use "root powers" to force-edit the system file as described above ...


6

The answer is this varies by carrier and can vary for any number of other circumstances such as market, locale, and traffic density... Both answers you referenced are correct for certain situations. I have also seen DHCP leases in crowded mobile network areas be under 4 hours... So does your IP address change every time you connect? Sometimes it will, ...


5

I know this is an old post, but thought I would provide an update. It appears some manufacturers and versions of Android now DO allow for the changing of the IP subnet range for the DHCP server through the UI when using WiFi hotspot feature. Here's where to find it on an HTC One M8 running Android 6.0. YMMV. From the Mobile Hotspot screen, click the 3 ...


4

You could always use the browser hit one of the many web pages that will tell you what your IP address is. WhatsMyIp being one such.


3

Under Settings, Wi-Fi, , Modify Network, Advanced Options, IP Settings, you should have a choice of Static or DHCP. Choosing Static adds input boxes for IP address, Gateway, Network prefix, and DNS. If you don't have this, I suggest trying a third-party app such as WiFi Manager. Finally, if you're really talking about where in the filesystem this is ...


3

No. To find out the IP addresses you'd have to be able to connect to the DHCP server that handles giving out the IP addresses for that subnet, get and IP address and a subnet mask, and then scan the subnet for active IPs. To do this, you'll have to be connected to the access point.


3

If you have USB debugging turned on, you can see the DHCP activity in the logcat. Unfortunately, without a working DHCP server, you're not going to see anything. And the logcat doesn't stick around long enough for you to see the previous day's successful negotiation. You can also see the currently-assigned IP address in Wi-Fi settings under the advanced ...


2

Have a look at this thread about using open VPN. Here you can give public IPs to devices using Open VPN, I think. Or you could find another tethering app which supports this such as PdaNet+ which may have more control.


2

Default DHCP IP address range is hard-coded, so you can't change it without rebuilding ROM with modified source code. Or use a little hack. Replace /system/bin/dnsmasq (the DHCP/DNS server up to Android 9) with a custom shell script which replaces old subnet with new one before executing actual dnsmasq binary. For detailed steps see How to change the ...


2

Keeping your IP address and using a VPN is the complete opposite of what VPNs are invented for. VPNs make you part of a network through a tunnel connection so that your phone is on the same level as locally connected devices. This means your IP address will be the one of the VPN. If you don't like this, then you should not use a VPN. Also check your IP on ...


2

Probably this is because the network you are on is using NAT. Because of the world shortage of IP addresses, most networks (mobile networks and Wi-Fi) don't issue you a globally routable IP address. They just give you an address that only works within that network. Network address translation (NAT) is a way of letting all those devices on the network talk to ...


2

As mentioned by lzzy, you can use DNSMasq server to achieve this. But Chrome uses own DNS resolving process and this method may not work. To start the server use the following command: sudo /usr/local/sbin/dnsmasq -d \ --no-hosts \ --no-resolv \ --conf-file=/dev/null \ ...


2

You should use OpenDNS Family shield which blocks porn and malicious websites. Dns1: 208.67.222.123 Dns2: 208.67.220.123 If your ISP blocks other DNS's, try a secure connection (use Port 443): Dns1: 208.67.222.123:443 Dns2: 208.67.220.123:443 If you're phone has root access I recommend using a paid app called OverrideDNS which encrypts your DNS queries ...


2

Note: Adding / removing IP address requires root access. METHOD 1: Before Android Pie, tethering IP (192.168.43.1) was hard-coded (1, 2). But now it's randomized on each session(3). You can use Android's builtin ip command to set an additional fixed IP address (within same subnet obviously): ~# ip address add 192.168.43.100/24 dev wlan0 * Replace add ...


1

SHORT ANSWER: You would be able to ping a local host by name only if your Wi-Fi router (or some other local host) is running a DHCP/DNS server which does know the name of the host you are trying to ping. This is a screenshot from my router: Also make sure your Android device is sending DNS queries to local server and not on internet. Android loves Google ...


1

Android's VPN uses TUN interface on OSI Layer 3. So you can find what IP is assigned to that interface using Android's built-in command ip. From any terminal app or adb shell: ~$ ip addr | awk '/inet.*tun/ {print $2}'


1

For running a SSH server on a Smartphone connected via mobile data to the Internet you need a public IP address on the mobile network interface. You can simple check if your IP is a public one: Enable mobile data and disable Wifi on your phone and check the IP address you have (Phone status in Android settings). If the IP address starts with 10.x.x.x or 192....


1

I have been through a similar struggle, but a Brother HL-2250DN networked printer and Android Pie. Printer is not showing up when searching in Default Print Service. I can see the Brother printer on the network using Fing, and can ping it by its IP address so it isn't a network problem. The Brother supports Internet Protocol Printing (IPP) which is ...


1

You can clear arp cache using this command in terminal: ip -s -s neigh flush all (or simply ip neigh flush 192.168.xx.0/yy if you know the network range) While not necessary, you may need to reboot the device, ping the hostname again and see if its resolved to new IP. Looking from the other side, you can try resetting winsock entries and TCP/IP stack ...


1

According to a post on SO, cat /proc/net/tcp will return it in the second column, with the heading "local_address", e.g. "CF00A8C0:0203". The part after ":" is a port number. From the rest use the last two (C0) as a hex number, e.g. C0 is 192, which is the start of the address in this example. Further: The IP address is ...


1

So reproducing the solution here for posterity: Need to change the default apn to either publicip.apn or vpn.com. All the other settings remain the same as the original default apn (which is fido-core.appl1.apn). Restart the device and voila!, the phone has a public ip. It can be discovered using adb and netcfg. @MartinSchröder, thanks a lot for pointing out ...


1

Typically your carrier will be using NAT so you will have either a private RFC1918 address or an already allocated public IP. A free app like Net Tools will tell you the IP assigned directly to your phone, so can you have IP communications with your carrier. (Net Tools will use netcfg as you have). If you go to whatismyip.com you will likely find a ...


Only top voted, non community-wiki answers of a minimum length are eligible