For Kubuntu 22.04.1 (KDE 5.24.7) [kernel 5.15.0-60], I had to "Define a special behavior" to never let the computer sleep.
System Settings > Power Management > Activity Power Settings
Define a special behavior
[check] Never shut down computer or let it go to sleep
ADDITIONALLY, NetworkManager would not fully recover the LAN connection IF it automatically detected a cable disconnect and reconnect.
SO (eventually), I found that bringing the NIC down and up via the CLI worked consistently.
THUS, in /etc/network/if-up.d, I created a file 000-cycle-enp2s0-down-up
with the following content:
#!/bin/bash
NIC_NAME="enp2s0"
if [[ "$IFACE" != "$NIC_NAME" ]]
then
exit 0
fi
/usr/sbin/ip link set $IFACE down
/usr/sbin/ip link set $IFACE up
THEN, I made the file executable:
sudo chmod +x 000-cycle-enp2s0-down-up
AS a result, I now have a reliable SSH and HTTPS connection.
NOTE: 'enp2s0' is the name of my NIC. You must determine the name of yours. I used the following code and recognized the associated ip address with the NIC name.
ip a|grep "inet "