In my case, I use a mobile stick for internet access and local router too. I played the router settings and setted some option, which need to ssh for me.
- separate AP [on] <- wrong setting in my case
And a many long months later I try ssh connect to my raspberry, but it exited with No route to host
message. I find firewall settings, and sshd config, but everything looked good. After that I remember to the router settings, and try out revert some setting, and one of that works:
- separate AP [off] <- good setting in my case
I am not sure what is this setting doing, but I am sure, without this cannot connet via ssh or VNC to raspberry. The strange thing that rpi has internet access and works well, therefore, it has not been revealed before.