Score:1

Mikrotik Wifi on Android keep on disconnecting

cn flag

My company recently purchased a few Mikrotik hAP Mini. These units are used for Site to Site VPN. The first unit I setup manually worked flawlessly. I then exported the configuration to the second, third and fourth units.

On these 3 units, when my Pixel 3a is connected, it receive an IP address, proclaming "no internet connection" and after one second it disconnect and reconnect to the WiFi over and over. The phone is literally on top of the AP unit and the surrounding area has at most 15 other APs. Another user who received a unit also reported the same problem on his Xiaomi phone.

On Mikrotik, the log shows "macaddr@wlan1: disconnected, received deauth: sending station leaving (3)". I believe this is just normal "user disconnected" message.

Surprisingly, if I set the DHCP server to not providing any DNS servers then the Pixel stays connected, asking what it should do when this wifi has no internet. The DNS server combination I tried are:

  • Providing remote DNS server IP to the client (this server is over VPN)
  • Providing 1.1.1.1 to the client
  • Providing router's IP as DNS server, and
    • Set the router's upstream to 1.1.1.1, 1.0.0.1
    • Set the router's upstream to remote DNS server
    • Set the router's upstream to remote DNS server AND 1.1.1.1 as secondary

It seems like this mysterious feature of Android at blame here. Also, if I use the exact same IP configuration as DHCP (with remote DNS server), but as static IP, then I stay connected and internet is also working

In summary:

  1. Two Android phones from different brands can't stay connected to 3 Mikrotik devices over 5 seconds, each AP has the exact same setup and tested at point blank range.
  2. Providing no DNS server in DHCP does make it stay connected, but of course, no internet
  3. Providing any DNS server in DHCP give the same result as 1
  4. Using the exact same IP information provided by DHCP provide the expected result, but is a bad user experience
  5. Factory default config also work
  6. My Linux laptop works for all configuration in 1-5 except 2

The relevant Mikrotik configuration are:

/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
    country=thailand disabled=no distance=indoors frequency=auto \
    installation=indoor mode=ap-bridge ssid=ssid station-roaming=enabled \
    wireless-protocol=802.11
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=\
    dynamic-keys supplicant-identity=MikroTik
/ip dns
set allow-remote-requests=yes servers=10.0.0.1,1.1.1.1,1.0.0.1 use-doh-server=\
    https://cloudflare-dns.com/dns-query
/ip pool
add name=dhcp ranges=10.1.0.0/29
/ip address
set [ find comment=defconf ] address=10.1.0.1/29 interface=bridge network=10.1.0.0
/ip dhcp-server network
set [ find comment=defconf ] address=10.1.0.0/29 dns-server=10.1.0.1 gateway=10.1.0.1 netmask=29

Other settings are mostly factory default, including all default firewall configuration and DHCP optionset. The RouterOS version is 6.47.10 (longterm)

Benoit PHILIPPON avatar
hk flag
How did you "export the configuration" ? Was it with a "export file=xxx.rsc" command on terminal or the backup button in the file screen?
cn flag
It was /export, I found file backup doesn't really work. I then modified the output file to remove the default values that are left in
Benoit PHILIPPON avatar
hk flag
Did you remove the MAC addresses as well in the exported file?
cn flag
Yeah the import file has no mac address listed
Score:0
se flag

I posting this there if someone will google it and found this thread. In my case that occurs when target AP are empty (no wireless clients connected to it). And thats mean wireless interface not in up state. When first client connects to it - interface become up, and this activate RSTP algoritms (count costs and roles of ports) that take some time and this time are too long for some smartfones. So disabling any STP protocol on AP bridge solve issue for me.

Score:0
cn flag

After a few months I figured out that the DHCP server was handling out the last IP in the subnet (i.e. the broadcast address). After removing that IP from circulation the everything work as expected

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.