Keeps connected to router but no internet after a while

Problem: After a while connected to wifi I lose connection to internet but it keeps connected to the router.

Tried solutions: I have tried connecting to a different wifi connection and it happens the same. I have Windows 10 installed on a different partition and wifi works well there. I changed to an LTS kernel (5.4) and it does the same.

Other information: No restart needed: if I connect to a different wifi and then go back to the previous one, it starts working again. Even if a change from 2.4 to 5Ghz of the same router it starts working again.


inxi -Fza:

System:    Kernel: 5.4.89-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 
           root=UUID=549fb996-6917-47c5-9714-29298ca7add4 ro quiet splash apparmor=1 
           security=apparmor resume=UUID=96ca1e46-62ed-45f5-8250-7624b552078d udev.log_priority=3 
           Desktop: GNOME 3.38.3 tk: GTK 3.24.24 wm: gnome-shell dm: GDM 
           Distro: Manjaro Linux 
Machine:   Type: Convertible System: HP product: HP Spectre x360 Convertible 13-ae0xx v: N/A 
           serial: <filter> Chassis: type: 31 serial: <filter> 
           Mobo: HP model: 83B9 v: 56.50 serial: <filter> UEFI: AMI v: F.34 date: 10/23/2020 
Battery:   ID-1: BAT0 charge: 40.5 Wh condition: 40.5/40.5 Wh (100%) volts: 12.8/11.6 
           model: HP Primary type: Li-ion serial: N/A status: Full 
           Device-1: hid-0018:04F3:2597.0001-battery model: ELAN2514:00 04F3:2597 serial: N/A 
           charge: N/A status: N/A 
CPU:       Info: Quad Core model: Intel Core i7-8550U bits: 64 type: MT MCP arch: Kaby Lake 
           note: check family: 6 model-id: 8E (142) stepping: A (10) microcode: E0 L2 cache: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 32012 
           Speed: 800 MHz min/max: 400/4000 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 
           6: 800 7: 800 8: 800 
           Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: 
           conditional, RSB filling 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:5917 
           Device-2: Cheng Uei Precision Industry (Foxlink) HP Wide Vision FHD Camera type: USB 
           driver: uvcvideo bus ID: 1-5:3 chip ID: 05c8:0815 serial: <filter> 
           Display: wayland server: 1.20.10 compositor: gnome-shell driver: loaded: i915 
           note: n/a (using device driver) - try sudo/root display ID: 0 
           resolution: <missing: xdpyinfo> 
           OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.3.3 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel alternate: snd_soc_skl bus ID: 00:1f.3 chip ID: 8086:9d71 
           Sound Server: ALSA v: k5.4.89-1-MANJARO 
Network:   Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel port: f040 bus ID: 02:00.0 
           chip ID: 8086:24fd 
           IF: wlp2s0 state: up mac: <filter> 
Drives:    Local Storage: total: 953.87 GiB used: 32.44 GiB (3.4%) 
           SMART Message: Required tool smartctl not installed. Check --recommends 
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Sabrent model: N/A size: 953.87 GiB block size: 
           physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: RKT303.3 
Partition: ID-1: / raw size: 40 GiB size: 39.12 GiB (97.81%) used: 16.14 GiB (41.3%) fs: ext4 
           dev: /dev/nvme0n1p6 maj-min: 259:6 
           ID-2: /boot/efi raw size: 100 MiB size: 96 MiB (96.00%) used: 68.1 MiB (71.0%) fs: vfat 
           dev: /dev/nvme0n1p1 maj-min: 259:1 
           ID-3: /home raw size: 123.08 GiB size: 120.65 GiB (98.02%) used: 16.23 GiB (13.5%) 
           fs: ext4 dev: /dev/nvme0n1p7 maj-min: 259:7 
Swap:      Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 8.79 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/nvme0n1p8 maj-min: 259:8 
Sensors:   System Temperatures: cpu: 56.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 265 Uptime: 39m wakeups: 3 Memory: 7.53 GiB used: 2.8 GiB (37.2%) Init: systemd 
           v: 247 Compilers: gcc: 10.2.0 Packages: 1440 pacman: 1433 lib: 385 flatpak: 7 Shell: Zsh 
           v: 5.8 running in: gnome-terminal inxi: 3.2.02

ip addr:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 60:f6:77:3b:57:ae brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic noprefixroute wlp2s0
       valid_lft 258216sec preferred_lft 258216sec
    inet6 fe80::422c:feb6:a606:bc66/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

nmcli device wifi list | grep “*”

*       98:35:ED:87:3B:DC  MEGACABLE-A99E     Infra  4     195 Mbit/s  46      ▂▄__  WPA1 WPA2