2

Currently, I am running a hotspot from an Android phone as my home network. The cellular plan for this phone has unlimited data.

When I host the hotspot, connected devices detect that this hotspot has a cellular connection behind it, and treats it as a cellular connection. This, for example, limits connected Android phones to not back up photos via Google Photos if the "back up over cellular data" option isn't enabled.

Can I somehow edit the way the hotspot is being run, so that it doesn't signal to connected devices that there is a cellular connection in the background?

The hosting phone is rooted, and I have no trouble using a terminal-based setup (with hostapd or similar)

EDIT: Additional information:

 raphael:/ # netstat -lntup | grep -E ':53|:67'
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      22525/dnsmasq
tcp        0      0 192.168.166.70:53       0.0.0.0:*               LISTEN      22525/dnsmasq
tcp6       0      0 2a00:801:237:80f8::c:53 :::*                    LISTEN      22525/dnsmasq
tcp6       0      0 ::1:53                  :::*                    LISTEN      22525/dnsmasq
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           17668/mdnsd
udp        0      0 127.0.0.1:53            0.0.0.0:*                           22525/dnsmasq
udp        0      0 192.168.166.70:53       0.0.0.0:*                           22525/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           2243/com.android.networkstack.process
udp6       0      0 :::5353                 :::*                                17668/mdnsd
udp6       0      0 :::5353                 :::*                                17668/mdnsd
udp6       0      0 2a00:801:237:80f8::c:53 :::*                                22525/dnsmasq
udp6       0      0 ::1:53                  :::*                                22525/dnsmasq

raphael:/ # cat /proc/22525/cmdline                                                                                      
/system/bin/dnsmasq--keep-in-foreground--no-resolv--no-poll--dhcp-authoritative--dhcp-option-force=43,ANDROID_METERED--pid
13
  • 1
    It's because Android's DHCP server sends ANDROID_METERED DHCP option to connected clients. You can set connection unmetered on connected hosts, see screenshot in this answer: android.stackexchange.com/a/215528/218526 Commented Dec 17, 2020 at 10:17
  • Thank you! I was looking to implement it from the hotspot side (to avoid having to change every connected device), but this is a step along the way! Commented Dec 17, 2020 at 10:48
  • Which Androis version your hotspot device is running? If it's Android 9 or earlier you can edit dnsmasq commandline arguments. I can write a bit detailed answer. What does netstat -lntup | grep -E ':53|:67' and pgrep -a dmsmasq return when hotspot is on? Commented Dec 17, 2020 at 13:23
  • The hotspot phone is running Android 11, so that might be a problem. I edited my original post with output of the commands you wrote. Commented Dec 17, 2020 at 15:17
  • 1
    I see. Thanks for the tip about injecting dhcp options, I'll check it out! Commented Dec 18, 2020 at 8:58

0

You must log in to answer this question.

Browse other questions tagged .