Wifi client problem reconnecting with a new router

Hi. I need a wifi client to reconnect to an AP wifi router after it is turned off and on. There was no problem until now, but I replaced the router with a new one and now the client is having problems reconnecting or working.

This is what I see, after turning the router off and on:

The client does not respond to ping but appears connected on Luci wireless stations. If you disconnect the client in luci, after a few seconds it reconnects and works fine. (But I can't be doing this forever)

Curiously, If instead of turning off the router I reboot it, the client reconnected without problems.

I need some clue as to what may have changed in the configuration of the new router.

NOTE: I cannot manipulate the wifi client. It is an IoT device.

There is no useful information in this post....

What router is it? What version of OpenWrt are you running? Let's see your configs to make sure that there's nothing obviously wrong...

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
2 Likes
root@OpenWrt:~# ubus call system board
{
        "kernel": "4.14.221",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7620A ver:2 eco:6",
        "model": "ZBT-WE826 (16M)",
        "board_name": "zbt-we826-16M",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.7",
                "revision": "r11306-c4a6851c72",
                "target": "ramips/mt7620",
                "description": "OpenWrt 19.07.7 r11306-c4a6851c72"
        }
}
root@OpenWrt:~# cat /etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd8b:93cb:e386::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.2.1'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'f8:5e:3c:17:f1:e6'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'f8:5e:3c:17:f1:e7'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 6t'

config interface 'WifiWAN'
        option proto 'dhcp'

config interface 'wwan'
        option ifname 'wwan0'
        option proto 'qmi'
        option pincode 'XXXX'
        option apn 'orangeworld'
        option device '/dev/cdc-wdm0'
        option 'autoconnect'    1
        option pdptype 'ipv4'
        option auth 'none'

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

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/10180000.wmac'
        option htmode 'HT20'
        option channel '4'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option key 'XXXXXXXX'
        option encryption 'psk2'
        option ifname 'wlan1'
        option ssid 'wolfwl_3G'

config wifi-iface 'wifinet1'
        option ssid 'wolfwl_e'
        option device 'radio0'
        option mode 'sta'
        option key 'XXXXXXXX'
        option encryption 'psk2'
        option ifname 'wlan0'
        option network 'WifiWAN'
        option disabled '1'

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 authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option ra_management '1'

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'

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

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

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'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        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'

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'

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'

config include
        option path '/etc/firewall.user'

I don't see anything that would immediately explain why your device is sometimes unable to connect, but a few things that I would suggest you deal with:

This version is old... it is EOL and unsupported. you should upgrade to 23.05. You'll need to reset to defaults because the config will not be compatible from your current version to the latest, so it will give you an opportunity to rebuild the config.
https://firmware-selector.openwrt.org/?version=23.05.0&target=ramips%2Fmt7620&id=zbtlink_zbt-we826-16m

For 2.4G, you should usually stick to channels 1, 6, or 11. channel 4 may experience interference from other neighboring APs and could potentially explain why your client device isn't always connecting.

There is also no country code -- you need to specify the country to ensure proper operation.

Start with the upgrade, though... that's important.

1 Like

On top of that, especially when jumping between different routers/ OEM versions and OpenWrt, there might be subtle differences in the stored encryption settings of your clients. Often it does help to reconfigured the wireless configuration on the clients as well.

1 Like

Hi. After a lot of work, upgrading openwrt, installing packages and reconfiguring, the problem is solved. The wifi client reconnects without problems after a power cycle. Thank you. The only thing left is the mystery of knowing what happened before.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.