0

Intro

I have a custom hardware that create a Wifi network and allow users to connect to it (mobile devices). There is no cellular SIM card, only wifi.
Once connected, through sockets, I'm able to exchange data between HW and Phone.


Problem

  • Using an Apple iPhone (whatever version), when connecting to this Wifi, the phone show me "No connection" but still connected and the phone is able to redirect automatically 4G traffic through the cellular network and the socket/wifi communication through the HW without problems.

  • Using an Android (Samsung in particular), when connecting to this Wifi, the phone automatically drops any other connections to the 4G network. No one app is able to use internet.


Question

There is something in the hostapd.conf or in the routing-tables that i need to configure in order avoid dropping connection automatically through my HW instead of using the phone configuration?

Would anyone have a similar issue and be able to help me?


Here an extract of the hostapd.conf:

interface=wlan0

driver=nl80211

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=CustomWifi

hw_mode=g
channel=11
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1

ieee80211n=1
eapol_key_index_workaround=0
eap_server=0

own_ip_addr=127.0.0.1
wpa=2
wpa_passphrase=Password12345
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

This an content of the file hosts:

127.0.0.1   localhost.localdomain       localhost

Thanks a lot

5
  • How are you assigning IP addresses to the phones when they connect to your AP?
    – hardillb
    Dec 2 '20 at 13:26
  • I use the local 10.0.0.1 address to communicate with sockets: "ifconfig wlan0 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255 up"
    – elp
    Dec 2 '20 at 14:54
  • No not how you configure the device, I asked how you assign addresses to the phone.
    – hardillb
    Dec 2 '20 at 14:57
  • I don't assign IP to the phone, is automatically managed by phone itself.
    – elp
    Dec 2 '20 at 15:11
  • No it's not (at best you might get a 169.254.x.x Link Local address, but you can't use this to connect to the 10.0.0.1 IP address).
    – hardillb
    Dec 2 '20 at 15:13
1

It sounds like you need to run a DHCP server on your AP to hand out addresses in the 10.0.0.0/24 range.

This should make sure it sends an empty Option 3 value so no default gateway is sent to the phone. This will let the phone know it can only reach devices in the 10.0.0.0/24 range via this network and it should keep it's current default route.

E.g. to do this with DNSMasq you would use a config file like:

dhcp-authoritative
dhcp-rapid-commit
no-ping
interface=wlan0
dhcp-range=10.0.0.2,10.55.0.254,255.255.255.0,1h
dhcp-option=3
leasefile-ro

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.