Wifi interface goes down after no longer having active connection

Hi community,
I have a main router (TP-Link Archer C7 v2 - OpenWrt 22.03.2) and a secondary AP (TP-Link TL-WPA8631P v3 - OpenWrt 22.03.3). The secondary AP is used to have wifi in my office, for working from home.
On my secondary AP the wifi interfaces (2g and 5g) go down some time (I believe hours) after I shut down my laptop (no wifi connections made) My wifi interfaces remains up +- 90% if my lock my laptop but leave if on for the night (sleep mode). There is also a google nest connected via wifi, I don't shut it down/remove power but it loses connection to0. The secondary AP also has 2 wired connections (test server, NAS) I don't believe they loose connection ever.

I want my wifi to stay up even if there is no connection.

What I have done so far

  • use cron to reboot the device every 6 hours (30 0/6 * * * /sbin/reboot now)
  • use cron to ping my main router every 15 min. (0/15 * * * * /bin/ping -c2 191.168.1.1)
    The individual command work from the commandline, but not sure if these work via CRON, because I can't find evidence is the command are executed.

I believe the issue is related to the wifi-interface not remaining up, because I can SSH into the AP (although initial login is very very slow)

I cann't find anything in the log (kernel/system) that points to an error.

Does anyone have an idea on how I can troubleshoot further ?

Reading some forum posts, I believe following commandline outputs are useful:

ubus call system board

{
	"kernel": "5.10.161",
	"hostname": "Pan",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "TP-Link TL-WPA8631P v3",
	"board_name": "tplink,tl-wpa8631p-v3",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.3",
		"revision": "r20028-43d71ad93e",
		"target": "ramips/mt7621",
		"description": "OpenWrt 22.03.3 r20028-43d71ad93e"
	}
}

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 packet_steering '1'
	option ula_prefix 'fd9e:e96f:c8ef::/48'

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

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '191.168.1.2'
	option gateway '191.168.1.1'
	list dns '191.168.1.1'

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 band '2g'
	option htmode 'HT20'
	option cell_density '0'
	option channel '6'
	option disabled '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid '2G-Bureau'
	option encryption 'psk2'
	option key 'removed:-)'

config wifi-device 'radio1'
	option type 'mac80211'
	option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
	option channel '36'
	option band '5g'
	option htmode 'VHT80'
	option cell_density '0'
	option disabled '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid '5G-Bureau'
	option encryption 'psk2'
	option key 'removed:-)'

Thanks for your help.

Are these the actual addresses you are using? While not likely directly related to your issue, you should not use random address ranges for your lan - make sure you are using rfc1918 addresses (here, it should be 192.168.1.x)

As far as the main issue - it appears that you have not set your country code. Try doing that for both radios and see if that helps.

3 Likes

Hi psherman,
Thank you for the suggestion regarding country code, I've implemented the change and report back end of next week. I have the feeling this could indeed be the solution, as I have on my main router also 2 wifi interfaces and one was also not 100% stable, checking the settings for the one that is working fine, it has country code defined, the one causing issue's, also dit not have the country code defined. Hopefull development.

Regarding the adress scheme I'm using. I have a class B network. I ran out of space in my previous network on one of the subnets. I agree that I should have used the 172.16 - 172.31. I'll investigate if the issue is significantly large to rebuild again.

Let's dig into this a bit...
The old "class A/B/C" terminology has been deprecated -- now we just talk in terms of CIDR ('/' notation). Class B essentially equates to a /16 network, which means it can accommodate 65K hosts. There are a lot of reasons that a /16 shouldn't be directly used in typical environments, but I'm trying to understand your situation...

Your router has a /24 defined on the lan... what's going on elsewhere that would be running a /16? And did you really run out of space (i.e. 65K hosts), or are you trying to simply use a different subnet? If you really need to use a /16 for some reason (i.e the whole 192.168.0.0/16 range), you can use the 10.0.0..0/8 and 172.16.0.0/12 ranges to stay in the RFC1918 ranges.

Hi Psherman,
First of all thank you for your tips. I can confirm that the original issue (wifi stability) has been resolved. The solution was idd applying the country-code to the radio's.

Regarding my previous network. I was able to allocate 255 hosts and with (1) the requirement to to use subnets based on intented use / network profile and (2) 2 subnets requiring more that orginally designed space, To be honest, if I was forced I could probably reallocate and remain in a /24. However I decided to move my network to a range /16. Based on my "older" knowlegde on class A/B/C and my preference that I'm able to have subnets with min. 255 hosts. (administrative limitation based on my IP adress space management)

I'm going to close the ticket as the original issue was resolved.
Thank you again for your additional help in sharing your knowledge on IP adres management.

Unless there are some

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