1

Is it possible to allow devices connected to a hotspot to communicate with each other?

I have a Ulefone Power Armor 13 rolling Android 11 and WiFi hotspot. Multiple devices can connect to the hotspot simultaneously, but it seems the phone is blocking these devices from communicating with each other. Everyone can communicate with the phone itself but not with other devices connected to the same hotspot. Pinging another device from Windows yields

>ping 192.168.90.77
Pinging 192.168.90.77 with 32 bytes of data:
Reply from 192.168.90.241: Destination host unreachable.
Reply from 192.168.90.241: Destination host unreachable.

This was not the case on my old Cat S60 phone rolling Android 6. There, all devices connected to the hotspot could communicate with each other directly (I am guessing that Android 11 is to blame, not the phone, but I don't actually know).

6
  • 1
    If it's due to AP Client Isolation, you need a rooted device to change ap_isolate in hostapd.conf. And that too may not be straightforward because Android usually creates configuration file dynamically. Nov 28, 2022 at 11:45
  • This has just started happening to me on a Sony Xperia XZ1. What's really weird is it has not had updates for years. I have been able to connect both a laptop and a raspberry to it and access the rpi from the laptop on many occasions in the past, and now it just doesnt work. Only difference I can think of is it no longer has a SIM card in as I have a new phone. Jul 14, 2023 at 19:58
  • @Mangodan2003 check the "security patch level", was probably a new security patch, silently installed, that broke it
    – hanshenrik
    Jul 17, 2023 at 7:16
  • @IrfanLatif at least on my Samsung Galaxy S22 Ultra updated to Android 13 and rooted, there are no results for sudo find / -iname "*hostapd.conf*" - hostapd.conf does not seem to exist
    – hanshenrik
    Oct 26, 2023 at 12:55
  • @hanshenrik already stated: "And that too may not be straightforward because Android usually creates configuration file dynamically." Oct 26, 2023 at 18:33

1 Answer 1

1

I do not know how to do this on a non-rooted phone, but for rooted phones: Install Termux and run

pkg install tsu php

then run

sudo php -r '$confFiles=glob("/data/vendor/wifi/hostapd/hostapd*.conf"); foreach($confFiles as$confFile){var_dump($confFile);$conf=file_get_contents($confFile);$conf2=preg_replace('\''/\\#?ap_isolate\\=?\\d?/'\'','\''ap_isolate=0'\'',$conf); if($conf2 !==$conf){} else{$conf2=rtrim($conf)."\nap_isolate=0\n";}file_put_contents($confFile,$conf2,LOCK_EX);}'

and reboot.

Alternatively add this code to a foo.php

<?php

$confFiles = glob("/data/vendor/wifi/hostapd/hostapd*.conf");
foreach($confFiles as $confFile){
    var_dump($confFile);
    $conf = file_get_contents($confFile);
    $conf2 = preg_replace('/\\#?ap_isolate\\=?\\d?/', 'ap_isolate=0', $conf);
    if($conf2 !== $conf){
        //
    } else{
        $conf2 = rtrim($conf) . "\nap_isolate=0\n";
    }
    file_put_contents($confFile, $conf2, LOCK_EX);
}

and run

sudo php foo.php

and reboot.

Thanks to @Irfan Latif for pointing me in the right direction 👍

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .