I lose access to the router settings from my smartphone

Hi guys.

I have a TP-Link TL-WR840N v4 router with OpenWrt firmware 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.288.45147-96ec0cd

The router has a WireGuard VPN interface configured with a free CLOUDFLARE (WARP) config. With Policy Based Routing, this VPN is configured to only work with the internal IP of the smartphone and TV, to watch YouTube on SmartTV and Chromecast. The PC is connected by cable and its IP is not covered by VPN.

So two weeks ago the problems started. From time to time, when watching a video on a smartphone, the speed drops dramatically. After that, the speed drops to 0. At the same time, the smartphone does not swear that "this access point does not have Internet access." It's just that no sites open, including the router management site - 192.168.1.1. If I turn off and turn on Wi-Fi on my smartphone, then my access point will completely disappear from the list as if the router is turned off. At the same time, if you turn on the PC, then the Internet will work on the PC without problems. And the router's settings site will also open on a PC.

What could be the problem? As far as I understand, if the failure of the VPN was to blame, then the Internet would not work, but the router's website should open. He's on the local network. Only restarting the router helps, but this problem happens randomly sometimes even several times an hour. It is very inconvenient to run around the apartment and restart the router manually. I did not carry out any manipulations with the router before.

What could be the problem?

Screenshots of settings



Can you check whether restarting the wifi of the 841n is sufficient instead of rebooting it? The issue you are describing is basically identical to something I have observed with 841n v9, v10 and v11 devices that have been running for 5 or more years.

My understanding is that the wifi chip runs out of memory, crashes, disconnects all devices and needs a restart of wifi, a device reboot or a random amount of time to work as expected again.

The easy solution, which is not a real fix of the core issue of course, was to add the following cronjob:

*/2 * * * * iwinfo radio0 scan

This seems to free all memory and prevent the crash. It might be possible to lower the frequency of this. I haven't tried though since this cronjob worked in 100% of all cases (easily observable after only a couple of days).

2 Likes

Can you elaborate on where and how to write this command? I'm still new to OpenWRT

Sure, you can use the web interface, which you are using I think, remembering from previous threads, or the command line interface. Both ways are described here: https://openwrt.org/docs/guide-user/base-system/cron

It will then execute the radio0 scan command every 2 minutes.

3 Likes

It does not help

That's unfortunate, so the issue lies elsewhere or isn't the same as I have encountered. Do you have a device that can stay connected to LAN so that you can read the output of ´logread´ and ´dmesg´ when the wifi goes down?

2 Likes

have a computer. I wrote everything in detail in the first post.

There's nothing in the first post about watching the logs while the problem occurs.

Yes you should have tried that also. Log in on the wired PC and use the command wifi alone will only restart the radio.

1 Like

The first post says that I have a PC connected via cable

Cool, then post the logs.

1 Like

Yes, you did, but specified that you connected it/turned it on after the wifi went down. Could you keep a wired connection throughout and post log from when wifi goes down?

1 Like
Tue Jul  4 01:27:54 2023 daemon.notice netifd: wan (1827): udhcpc: sending renew to server 192.168.88.1
Tue Jul  4 01:27:55 2023 daemon.notice netifd: wan (1827): udhcpc: lease of 192.168.91.123 obtained from 192.168.88.1, lease time 10800
Tue Jul  4 02:09:41 2023 user.info : luci: accepted login on / for root from 192.168.1.11
Tue Jul  4 02:11:52 2023 kern.info kernel: [ 8081.689412] rt3050-esw 10110000.esw: port 1 link down
Tue Jul  4 02:11:54 2023 kern.info kernel: [ 8083.808964] rt3050-esw 10110000.esw: port 1 link up
Tue Jul  4 02:11:57 2023 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Tue Jul  4 02:11:57 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Tue Jul  4 02:11:57 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 0 addresses
Tue Jul  4 02:11:57 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Tue Jul  4 02:12:00 2023 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.10 b4:2e:99:97:0c:23
Tue Jul  4 02:12:00 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.10 b4:2e:99:97:0c:23 K14M-PC
Tue Jul  4 02:12:01 2023 daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
Tue Jul  4 02:12:01 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 8 addresses
Tue Jul  4 02:12:01 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 1 addresses
Tue Jul  4 02:12:01 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Tue Jul  4 02:12:35 2023 user.info : luci: accepted login on / for root from 192.168.1.10

Here. At about 2 o'clock, the Internet on the smartphone disappeared again and I could not enter the router settings from the phone. No problem on PC

Please 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:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
1 Like

I don't know where to enter commands in the browser

Which device is this, the phone? Are there no log entries regarding the phone disconnecting from wifi? The configs psherman has asked for will be really helpful trying to determine the issue.

Yes, this is a smartphone, but it did not disconnect from Wi-Fi. The Internet disappeared on the smartphone, I tried to go into the router settings from the smartphone to check if the IP was allocated to me from the Internet provider, but I could not go into the router settings. On the PC - 192.168.1.10, no problems were noticed, and the Internet is there and it went into the router settings.

1 Like

These commands to enter in putty?

login as: root
root@192.168.1.1's password:


BusyBox v1.35.0 (2022-10-14 22:44:41 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 22.03.2, r19803-9a599fee93
 -----------------------------------------------------
root@K14M:~# 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 'fd25:90bd:b545::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

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 device
        option name 'eth0.2'
        option macaddr 'c0:25:**:d3:**:b1'

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

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

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

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

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

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/10300000.wmac'
        option band '2g'
        option cell_density '0'
        option htmode 'HT40'
        option country 'RU'
        option channel '13'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'K14M.ua'
        option encryption 'sae'
        option key '19941400'

root@K14M:~# 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.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 host
        option name 'K14M-PC'
        option dns '1'
        option mac 'B4:**:99:97:**:23'
        option leasetime 'infinite'
        option ip '192.168.1.10'

config host
        option name 'K14M-Android'
        option dns '1'
        option mac '**:1F:88:**:AB:F6'
        option ip '192.168.1.11'
        option leasetime 'infinite'

config host
        option dns '1'
        option mac 'A4:**:33:**:AE:70'
        option ip '192.168.1.20'
        option leasetime 'infinite'
        option name 'Chromecast-TV'

config host
        option name 'Chaika-TV'
        option dns '1'
        option mac '00:51:**:BA:E2:**'
        option ip '192.168.1.30'
        option leasetime 'infinite'

config host
        option name 'Vladimir-Android'
        option dns '1'
        option mac '58:**:59:6B:**:93'
        option leasetime 'infinite'
        option ip '192.168.1.101'

config host
        option name 'Leonid-Android'
        option dns '1'
        option mac '16:B4:**:46:89:**'
        option leasetime 'infinite'
        option ip '192.168.1.102'

root@K14M:~# 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'
        list network 'lan'

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

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 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'

root@K14M:~#

Standard advice for any suspected bug is to upgrade to the latest version and confirm whether the problem still exists.

Don't use HT40 on 2 GHz. Just don't. Set this to HT20.

Channel 13 may be an issue with clients that have their internal country code (likely established at the factory and not changeable) set to a country where channel 13 is not allowed. Suggest trying one of the other channels-- which in countries where channel 13 is allowed are 1, 5, and 9.

In a V4 only network, set these to 'disabled'.

The log doesn't show anything unusual except that dnsmasq spontaneously restarted, which is quite unusual. This could be a lack of RAM issue. What does free report? Are any large services running?

FYI, user has another thread - they never answered that question:

Perhaps a different device, but as you see the user discussed Channel 13 as well.

1 Like

Nothing works. I reset the router settings, nothing is installed on it.