Wi-Fi says connected, but my internet does not work until I turn it on and off
The Terminal command to show WiFi disconnects for last 24 hours is:
log show --predicate '(processImagePath contains "kernel") && (eventMessage contains "AirPort: Link Down")' --style syslog --last 1d
and the output looks like this