Sample Header Ad - 728x90

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

Latest Questions

1 votes
0 answers
54 views
Android 10 hotspot static ip routing issue
I am running LineageOS 20 (Android 10) on my Xiaomi Redmi 9 (lancelot) rooted using Magisk. I started a WiFi-hotspot and based on https://android.stackexchange.com/a/213626/521733, I used the following commands from a root shell: ``` lancelot:/ # ip a show ap0 35: ap0: mtu 1500 qdisc mq state UP gro...
I am running LineageOS 20 (Android 10) on my Xiaomi Redmi 9 (lancelot) rooted using Magisk. I started a WiFi-hotspot and based on https://android.stackexchange.com/a/213626/521733 , I used the following commands from a root shell:
lancelot:/ # ip a show ap0
35: ap0:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether c2:98:90:46:b0:dc brd ff:ff:ff:ff:ff:ff
    inet 192.168.233.181/24 brd 192.168.233.255 scope global ap0
       valid_lft forever preferred_lft forever
    inet6 fe80::c098:90ff:fe46:b0dc/64 scope link 
       valid_lft forever preferred_lft forever
lancelot:/ # ip a add 192.168.100.1/24 dev ap0
Then, I connected to the hotspot using three methods: 1. DHCP Client received an IP: 192.168.233.81/24 Obviously, I was able to ping the Android gateway, as expected. 2. Static IP withing the 233 subnet Client IP: 192.168.233.10/24 Gateway and DNS: 192.168.233.81 Once again, I was able to ping the Android gateway, as expected. 3. Static IP within the 100 subnet Client IP: 192.168.100.10/24 Gateway and DNS: 192.168.100.1 **I was not able to ping the Android gateway.** There aren't any iptables rules that would drop this traffic:
lancelot:/ # iptables-save | grep tether                                                                                                                                
:tetherctrl_raw_PREROUTING - [0:0]
-A PREROUTING -j tetherctrl_raw_PREROUTING
-A tetherctrl_raw_PREROUTING -i ap0 -p tcp -m tcp --dport 21 -j CT --helper ftp
-A tetherctrl_raw_PREROUTING -i ap0 -p tcp -m tcp --dport 1723 -j CT --helper pptp
:tetherctrl_nat_POSTROUTING - [0:0]
-A POSTROUTING -j tetherctrl_nat_POSTROUTING
-A tetherctrl_nat_POSTROUTING -o wlan0 -j MASQUERADE
:tetherctrl_mangle_FORWARD - [0:0]
-A FORWARD -j tetherctrl_mangle_FORWARD
-A tetherctrl_mangle_FORWARD -p tcp -m tcp --tcp-flags SYN SYN -j TCPMSS --clamp-mss-to-pmtu
:tetherctrl_FORWARD - [0:0]
:tetherctrl_counters - [0:0]
-A FORWARD -j tetherctrl_FORWARD
-A tetherctrl_FORWARD -j bw_global_alert
-A tetherctrl_FORWARD -i wlan0 -o ap0 -m state --state RELATED,ESTABLISHED -g tetherctrl_counters
-A tetherctrl_FORWARD -i ap0 -o wlan0 -m state --state INVALID -j DROP
-A tetherctrl_FORWARD -i ap0 -o wlan0 -g tetherctrl_counters
-A tetherctrl_FORWARD -j DROP
-A tetherctrl_counters -i ap0 -o ccmni1 -j RETURN
-A tetherctrl_counters -i ccmni1 -o ap0 -j RETURN
-A tetherctrl_counters -i ap0 -o wlan0 -j RETURN
-A tetherctrl_counters -i wlan0 -o ap0 -j RETURN
Why is it not working? What is dropping the traffic? How do I fix it? My use case is as follows: I need to connect a Raspberry Pi to the hotspot and access it from my phone. Unfortunately Android hotspot subnet is set randomly, so I don't know the IP address that the client got assigned. mDNS does not seem to work, so the only other option I can think of is a static IP on a different, non-random subnet.
mopalinski (11 rep)
Mar 2, 2025, 03:40 AM • Last activity: Mar 2, 2025, 03:52 AM
1 votes
2 answers
2426 views
How to see the default gateway of mobile network?
Android version 13\ One UI Core version 5.1\ Model code SM-A045FZKGXID\ Kernel version 4.19.191-26097594-abA045FXXU3cWG1 After hours of googling and ChatGPT I randomly found my IP address, instead of being among network-related settings, was among "status information" (why?) I have no Android experi...
Android version 13\ One UI Core version 5.1\ Model code SM-A045FZKGXID\ Kernel version 4.19.191-26097594-abA045FXXU3cWG1 After hours of googling and ChatGPT I randomly found my IP address, instead of being among network-related settings, was among "status information" (why?) I have no Android experience, but I am a Linux enthusiast and therefore thought about checking the network configuration files in /etc; I downloaded terminals but I couldn't go anywhere: almost all commands are unusable. I understood that Android did some kind of restriction on the file system, even reading files is a hassle. ip and netstat yielded errors. I decided to unlock the "developer options", connect my phone to the PC, and try to navigate it from there. Unfortunately, I couldn't find the root folder / all I could find was 'Internal Storage' with its DCIM, Documents... subfolders. I read that through some apps, the default gateway can be obtained. I think though that if apps can do it I should be able to do it as well.
Andsewal (11 rep)
Nov 16, 2023, 01:51 PM • Last activity: Jan 31, 2025, 04:54 PM
5 votes
0 answers
6634 views
Set up an automated SMS server with Android (and a computer)?
I'm looking for a way to set up an SMS server (I don't know if there is better terminology for this, but probably). What I want: - use the phone as an SMS gateway for an automated server - let the phone send and receive messages - use a computer to command the phone what to do Specific example use c...
I'm looking for a way to set up an SMS server (I don't know if there is better terminology for this, but probably). What I want: - use the phone as an SMS gateway for an automated server - let the phone send and receive messages - use a computer to command the phone what to do Specific example use case: The phone gets an SMS message [family] The party today will start at 2pm. Which the computer will interpret and will order the phone to send the message over to all the numbers the computer has in the family list. Or f.e. [add]family,0123456789 to let it add numbers to lists. So what do I exactly need? An app that can send all it's incoming messages to an HTTP server and can receive orders from that same server. Of course USB would be a better method than HTTP because it's safer.
Steven Roose (477 rep)
Aug 11, 2012, 03:15 PM • Last activity: May 1, 2023, 09:37 AM
3 votes
1 answers
4807 views
Set android as internet gateway to local router (Not mobile hotspot)
**Background** I have a local network and I want to have my mobile serve as an internet gateway when entering the network. What I'm asking is asked [here][1], [here][2] and [here][3]. An advanced version has also been asked [here][4] but all of them have no answers leading me to a conclusion this mi...
**Background** I have a local network and I want to have my mobile serve as an internet gateway when entering the network. What I'm asking is asked here , here and here . An advanced version has also been asked here but all of them have no answers leading me to a conclusion this might not be possible. With this post, trying to list down what I tried, problems faced so as to open a discussion for a possible solution to this problem. Have tried this with relatively recent android 9, 10 and 11. **Some obvious steps** - Have static IP for the mobile which will serve as a gateway. - Setup router to use the gateway. **Problems** - Android connects to wifi and gives a warning that access point doesn't have internet access. We can switch to mobile data but the local network is inaccessible as wifi is disconnected. Changing to always use mobile data in developer options also behaves the same. - Let's suppose android is used as gateway and other devices are able to access internet, how will the device access local network? A probable solution is to make a middleware that decides to send packets to internet or intranet, or perhaps use internet as a fallback. I'm pretty sure mobile will need to be rooted for this kind of control. Is there anything developed which can be used directly?
Nautatava Navlakha (131 rep)
May 6, 2021, 07:29 PM • Last activity: May 7, 2022, 11:11 AM
2 votes
0 answers
2485 views
gateway and dns in android
How to setup gateway and dns on android emulator correctly if my eth1 on emulator is connected to tap on host via: emulator -dns-server 8.8.8.8 -selinux permissive -qemu -device virtio-net-pci,netdev=hn0 -netdev tap,id=hn0,ifname=tap0,script=no,downscript=no and tap is connected to docker bridge on...
How to setup gateway and dns on android emulator correctly if my eth1 on emulator is connected to tap on host via: emulator -dns-server 8.8.8.8 -selinux permissive -qemu -device virtio-net-pci,netdev=hn0 -netdev tap,id=hn0,ifname=tap0,script=no,downscript=no and tap is connected to docker bridge on host : bridge name bridge id STP enabled interfaces br-bf01bc4d9244 8000.0242c51c8c31 no tap0 veth7b9d706 ip is brought up via link here for now i have : generic_car_x86_64:/ # getprop net.dns1 8.8.8.8 generic_car_x86_64:/ # getprop net.dns2 1.1.1.1 generic_car_x86_64:/ # ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=24.2 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=62.3 ms ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 24.216/43.299/62.382/19.083 ms generic_car_x86_64:/ # ping 1.1.1.1 PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=11.0 ms 64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=10.2 ms ^C --- 1.1.1.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 10.234/10.627/11.020/0.393 ms generic_car_x86_64:/ # ping google.com ping: unknown host google.com 2|generic_car_x86_64:/ # how this is working????
ice (21 rep)
Apr 19, 2022, 09:51 AM • Last activity: Apr 19, 2022, 10:30 AM
1 votes
1 answers
644 views
I want to make static IP on my tablet using usb-c to ethernet port
I have Huawei Meta Pad t10s tablet & usb-c to pd rj45 adapter to connect it to ethernet not WIFI and it connect to internet automatically but I want to connect to server with another Gateway and need to enter static IP but can't find the way in the software of the tablet. can any one help me to find...
I have Huawei Meta Pad t10s tablet & usb-c to pd rj45 adapter to connect it to ethernet not WIFI and it connect to internet automatically but I want to connect to server with another Gateway and need to enter static IP but can't find the way in the software of the tablet. can any one help me to find solution to this situation?
Mohamed Abd El Khalek
May 22, 2021, 04:46 PM • Last activity: May 22, 2021, 05:29 PM
3 votes
0 answers
933 views
How to call and SMS from Android smartphone with SIM via internet remotely?
I want to use my phone number when traveling abroad and there is no possibility to setup roaming, etc. So the idea is: I have Android smartphone. I have my SIM inserted in the phone. The phone works as usual phone - it is turned on and connected to charger. I need software that is capable to answer...
I want to use my phone number when traveling abroad and there is no possibility to setup roaming, etc. So the idea is: I have Android smartphone. I have my SIM inserted in the phone. The phone works as usual phone - it is turned on and connected to charger. I need software that is capable to answer for incoming phone calls and relay the call via internet to some other phone or PC with corresponding software that runs on it. That is when somebody calls me, my phone that is turned on in my home answers to call, transfer the call/voice via internet to another country where I obtain some signal to my second phone or PC and can have a conversation. I have VOIP phone number but this doesn't solve the issue - I need exactly the phone number bound to my physical SIM - some services verify that number is virtual and do not work with such numbers. Could you please suggest Android application that solve the issue. **Updated:** I've fount following article related to question. What do you think about it? Using Android phone as GSM Gateway for VoIP
Vlad (141 rep)
Jul 2, 2020, 08:47 PM • Last activity: Jul 4, 2020, 01:23 AM
6 votes
1 answers
18961 views
How can I permanently change my hotspot tethering IP address?
IP address is `192.168.43.1` by default and there is no option to change it permanently. Is it possible to change it without root access? My phone is Huawei Android 5.1.
IP address is 192.168.43.1 by default and there is no option to change it permanently. Is it possible to change it without root access? My phone is Huawei Android 5.1.
mina nageh (249 rep)
Jun 11, 2019, 10:08 AM • Last activity: Feb 22, 2020, 10:37 PM
1 votes
2 answers
3046 views
What values to set in Static IP Settings of Wi-Fi when changing DNS?
I have nearly the same problem as [Set Open DNS in Android 5.0.1][1] and the answer helped me. [1]: https://android.stackexchange.com/questions/109844/set-open-dns-in-android-5-0-1?newreg=08ac8fdfbb7341fea7e27f4f64642016 Although I just want to change the DNS for blocking porn, what values for the f...
I have nearly the same problem as Set Open DNS in Android 5.0.1 and the answer helped me. Although I just want to change the DNS for blocking porn, what values for the following fields should I enter? - IP Address - Gateway - Network Prefix Length I have HTC mobile with 5.1 Android version.
Taha Abd El Moniem (11 rep)
Sep 14, 2018, 04:14 AM • Last activity: Nov 6, 2019, 09:11 PM
0 votes
0 answers
112 views
Is it possible to change the ip settings for ap0?
I was wondering if it's possible to change the gateway IP of ap0 to like 192.168.43.2 so while the device is working as a hotspot some other apps on your network would detect your device. but also it would work if I can sort of link both 192.168.43.1 and 192.168.43.2 with each other.
I was wondering if it's possible to change the gateway IP of ap0 to like 192.168.43.2 so while the device is working as a hotspot some other apps on your network would detect your device. but also it would work if I can sort of link both 192.168.43.1 and 192.168.43.2 with each other.
poqdavid (1433 rep)
Apr 20, 2019, 05:58 PM
0 votes
0 answers
790 views
How to maintain the gateway IP of the Android access point?
I realized that the IP address of the access point router changes every time (Android 9). I have to change the routing table of my device connected to the AP every time How to freeze the IP of the AP gateway ? Thx EDIT: I use my android phone as hotspot. I connect to it from my PC equipped with a wi...
I realized that the IP address of the access point router changes every time (Android 9). I have to change the routing table of my device connected to the AP every time How to freeze the IP of the AP gateway ? Thx EDIT: I use my android phone as hotspot. I connect to it from my PC equipped with a wifi key. From my PC, my routing table for this network interface is: Net. Dest Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.43.166 192.168.43.102 600 192.168.43.102: Is the IP address of the wifi key of the PC connected to my Android hotspot. 192.168.43.166: The gateway changes, it's never the same with each new connection to the Android Hotspot
West (3 rep)
Jan 8, 2019, 11:13 AM • Last activity: Jan 16, 2019, 06:59 PM
2 votes
1 answers
354 views
Use mobile internet though connected to WLAN
On an Linux based system I created a WLAN Hotspot. I want to provide a single webpage via a webserver on this system. When I connect my Android devices to it they expect to get internet over this connection. But since the Linux host is offline the Android devices are able to see only the webpage and...
On an Linux based system I created a WLAN Hotspot. I want to provide a single webpage via a webserver on this system. When I connect my Android devices to it they expect to get internet over this connection. But since the Linux host is offline the Android devices are able to see only the webpage and can't reach the internet any longer. I don't want the connected Smartphones to lose their normal connectivity. Is it technically possible (for example by using any special WLAN settings or Hotspot configuration) to tell Android devices anyhow to use the WLAN connection only for accessing the single hosted webpage and to use their own mobile Internet (cell net) for any other internet access? This question implies the question if it is possible to use mobile internet via cell network while beeing connected to a WLAN network on Android devices. The Linux system currently is a Ubuntu Desktop machine and will be a Raspbian (Debian) on a Pi later on.
Sebastian Barth (281 rep)
May 18, 2016, 03:54 PM • Last activity: May 18, 2016, 08:08 PM
1 votes
0 answers
134 views
Android tablet as 3G gateway - Limit tethering device 3G bandwidth
Scenario: An Android tablet computer acts as 3G gateway for multiple devices connecting to it via WiFi; everything happens in a moving vehicle. How can I limit the 3G/GPRS bandwidth of the devices connecting to the tablet, and secure a certain bandwidth for the tablet itself ? Also is there a limit...

Scenario:
An Android tablet computer acts as 3G gateway for multiple devices connecting to it via WiFi; everything happens in a moving vehicle.

How can I limit the 3G/GPRS bandwidth of the devices connecting to the tablet, and secure a certain bandwidth for the tablet itself ?
Also is there a limit in the number of connecting devices ? Thanks!

Ivan Matavulj (11 rep)
Apr 17, 2015, 12:08 PM
2 votes
1 answers
5992 views
How to query/change the default gateway via bash on CM12?
When i do a 'busybox route' on CM12 i get this: localhost / # busybox route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.0 * 255.255.255.0 U 0 0 0 wlan0 There is no default gateway defined. Practically there must be one as internet connection works prope...
When i do a 'busybox route' on CM12 i get this: localhost / # busybox route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.0 * 255.255.255.0 U 0 0 0 wlan0 There is no default gateway defined. Practically there must be one as internet connection works properly (it is also set in Android WiFi settings). Other users seem to have the same routing table behavior (like here ). It seems that this behavior started with Android5 as i can see standard "linux style" routing tables (with default gateway) on previous Android versions (like KitKat) on several places on the net. Anyone know how to query/set/change the default gateway on CM12/Android 5 via shell/bash (not just adding another route with 'route add' - it's more about the specific one that is already set)?
Maniaxx (88 rep)
Feb 22, 2015, 01:51 AM • Last activity: Mar 30, 2015, 10:34 AM
1 votes
2 answers
1979 views
Galaxy S3 Wifi no internet on Comcast/xfinity router
Brand new stock Samsung Galaxy S3 will connect to Comcast-provided wireless router (Arris brand), but cannot get out of local network - I can ping other devices on the network, and I can even browse the admin page of the router, but cannot get on the internet. Other devices work fine. I've tried tur...
Brand new stock Samsung Galaxy S3 will connect to Comcast-provided wireless router (Arris brand), but cannot get out of local network - I can ping other devices on the network, and I can even browse the admin page of the router, but cannot get on the internet. Other devices work fine. I've tried turning off security. I don't seem to have the disconnect problems others have reported - the connection is consistent. Oddly, I don't see the S3 listed in the "connected devices". If I run ifconfig wlan0, it shows the IP address, netmask but no gateway. I can set a static IP, but I still am unable to get internet. I can connect to other wireless networks without problems. Any ideas? Yes, other devices can connect - couple of laptops, kindle, wife's phone, my old phone (both androids) and ipad..
Chip (121 rep)
Sep 5, 2013, 06:14 AM • Last activity: Dec 11, 2014, 11:02 AM
2 votes
0 answers
2129 views
Use Android phone as Internet gateway (Not WiFi hotspot)
Just wondering if it is possible to setup Android 4 phone as internet gateway without enabling WiFi tethering? Use case: 1. Connect the phone to my WiFi home network. 2. Set phone in gateway mode (ipv4 forwarding?) 3. On any other PC in my home network set default gateway to phone IP In theory Andro...
Just wondering if it is possible to setup Android 4 phone as internet gateway without enabling WiFi tethering? Use case: 1. Connect the phone to my WiFi home network. 2. Set phone in gateway mode (ipv4 forwarding?) 3. On any other PC in my home network set default gateway to phone IP In theory Android at this stage would handle outgoing connections for that particular PC. On the grand scale what I'm thinking about is this: I have multiple phones that have unlimited 4g plans on them, every time I come back home, phone joins the WiFi network and starts acting as gateway. On my main routing box (pfSense) I setup multiple gateways (for each phone) and a load balancer. So every time phone appears, gateway changes to UP state in pfSense -> Load Balancing via that phone as well. When I leave my house, pfSense detects that gateway is unreachable -> removes it from list of load balancers.
Vitaly (121 rep)
Oct 9, 2014, 11:05 AM
5 votes
0 answers
5457 views
How to set android as internet gateway for my home network
Title should say all, but here's some network topology: Laptop(s), desktop(s) ** ** router ** ** android ** ** So I'd walk into the reach of my wifi and my android would connect to the wlan automatically and voila, internet for the rest of the network. I think this is a good approach https://help.ub...
Title should say all, but here's some network topology: Laptop(s), desktop(s) **** router **** android **** So I'd walk into the reach of my wifi and my android would connect to the wlan automatically and voila, internet for the rest of the network. I think this is a good approach https://help.ubuntu.com/community/Internet/ConnectionSharing and I'll probably figure the rest out myself before long, but if someone who knows what they are talking about could create a better guide or even an app for android for this, it would be much appreciated. As for the use of this. e.g. range, network resilience (when used in mesh networking). Thank you
Otto (51 rep)
Aug 26, 2012, 09:15 AM
Showing page 1 of 17 total questions