DIR-853 R1 - android phone cannot connect to WiFi

Please excuse my poor English, I'm using a translator.

I am using
firmware

When I have MAC filtering and Hidden SSID set, the phone cannot connect. If I turn off either MAC filtering or Hidden SSID, the phone connects normally.
I looked on the Internet for possible problems, but I couldn't find anything that would work.
Can you please help me with this?
Well thank you.

are you sure it's not a phone issue ?

It worked flawlessly for me with the original firmware.
No android phone will connect, not just one. If only one, then there could be a problem with the phone. That all the phones that connect at home are bad?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
login as: root
root@192.168.1.1's password:


BusyBox v1.36.1 (2023-10-09 21:45:35 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 23.05.0, r23497-6637af95aa
 -----------------------------------------------------
root@OpenWrt:~# ubus call system board
{
        "kernel": "5.15.134",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "D-Link DIR-853 R1",
        "board_name": "dlink,dir-853-r1",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ramips/mt7621",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }
}
root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd61:c5f0:********::/48'
        option packet_steering '1'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'wan'
        option proto 'pppoe'
        option username '********'
        option password '********'
        option ipv6 'auto'
        option type 'bridge'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option country 'SK'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan wan'
        option mode 'ap'
        option ssid 'eMZet'
        option encryption 'sae-mixed'
        option key '********'

config wifi-device 'radio1'
        option type 'mac80211'
        option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0+1'
        option channel '40'
        option band '5g'
        option htmode 'VHT80'
        option cell_density '0'
        option country 'SK'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan wan'
        option mode 'ap'
        option ssid 'eMZet5'
        option encryption 'sae-mixed'
        option key '********'
        list maclist '14:85:7F:********'
        list maclist '20:DF:B9:********'
        list maclist '30:F6:EF:********'
        list maclist '60:35:73:********'
        list maclist '68:9C:5E:********'
        list maclist '76:8C:36:********'
        list maclist '84:E3:42:********'
        list maclist 'E0:DC:FF:********'
        list maclist 'A8:9C:ED:********'
        option macfilter 'allow'

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config relay

config host
        option name 'MojNbDell'
        option dns '1'
        option mac '04:BF:1B:********'
        option ip '192.168.1.2'

config host
        option name 'MojNbWifi'
        option dns '1'
        option mac '30:f6:ef:********'
        option ip '192.168.1.3'

config host
        option name 'MajkaNbDell'
        option dns '1'
        option mac '7C:67:A2:********'
        option ip '192.168.1.4'

config host
        option name 'SamkoWiFiZasuvka'
        option dns '1'
        option mac '84:E3:42:********'
        option ip '192.168.1.5'

config host
        option name 'MiTvStick'
        option dns '1'
        option mac '60:35:73:********'
        option ip '192.168.1.6'

config host
        option name 'SamkoNbDell'
        option dns '1'
        option mac '14:85:7F:********'
        option ip '192.168.1.7'

config host
        option name 'SamkoMobil'
        option dns '1'
        option mac '76:8C:36:********'
        option ip '192.168.1.9'

config host
        option name 'TalciarenSamsung'
        option dns '1'
        option mac '00:15:99:********'
        option ip '192.168.1.10'

config host
        option name 'MajkaMobilNote7'
        option dns '1'
        option mac 'E0:DC:FF:********'
        option ip '192.168.1.12'

config host
        option name 'SamkoHodinky'
        option dns '1'
        option mac '68:9C:5E:********'
        option ip '192.168.1.18'

config host
        option name 'GoogleKrabicka'
        option dns '1'
        option mac '20:DF:B9:********'
        option ip '192.168.1.19'

config host
        option name 'Mi9T'
        option dns '1'
        option mac 'A8:9C:ED:********'
        option ip '192.168.1.8'

root@OpenWrt:~# cat /etc/config/firewall
config defaults
        option syn_flood        1
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80::/10
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPT


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.*.*
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00:11:22:********
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.*.*
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.*.*
#       option src_mac  00:11:22:********
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.*.*
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.*.*
#       option src_mac  00:11:22:********
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.*.*
#       option dest_port        120
#       option proto    tcp
root@OpenWrt:~#

Two things to fix in the wireless SSID stanzas:

  1. the network should only be lan. Remove wan from that lst. There must only be a single network in that field.
  2. change the encryption to either WPA2 or WPA3. Don't use mixed mode as it tends to cause problems with many devices.

The same problems are found for both your 2.4 and 5G SSIDs, so be sure to fix them all.

Then reboot and try again.

1 Like

I did 2.4 and 5 Ghz on both wifi:
Encryption WPA2-PSK
Cipher Force TKIP and CCMP (AES)
and I canceled the WAN
Unfortunately it didn't help. As soon as I hide the SSID and turn on MAC filtering, it disconnects the mobile phone. Just turn off one of them and the phone will connect. When these two settings are turned on together, the phone will not connect.

What do you mean hide? Are you using a hidden SSID? If so, there are two things to know:

  1. It doesn't actually improve security in any real way. It may prevent super casual attempts by others to connect, but anybody determined will still be able to discover it. In fact, some OS's present warnings about this because in some situations, it can actually become more of a vulnerability than an asset.

  2. If you have a hidden SSID, the devices will not auto-connect unless you've gone into the "other networks" (or whatever it is labeled on your phone) where you have the ability to manually enter the SSID and passphrase.

Also, looks like you're also talking about MAC filtering... again, not a terribly useful tool for security... marginal improvement, maybe, but a massive amount of extra work to maintain, and easy for an attacker to circumvent.

I'd recommend against hiding the SSID and against using MAC filtering for all of the reasons above...

But let's see what you've got in your wireless config file now.

2 Likes

Something new for me?

Did you read @psherman's last post ?

Sorry, my English is weak. But yes, I read. Do you want to know from me what my wifi settings are?
Because he probably mistranslates the last sentence "But let's see what you've got in your wireless config file now."

Bluntly spoken, don't hide your SSID (there're enough tools out there who can see it anyway) and go without the MAC filtering (which can be spoofed).
As both of them are no security measures and easy to overcome.

Just use a really strong passphrase on your wifi.

Okay, but I still think it should work. It worked with the original firmware from D-Link.
So I'll stick with what I have now that it's working and give a stronger password.
well thank you