A Wi-Fi network is more than just the router, however. There will almost always be at least some devices wired to the router ...
If you use SSH on your MacOS device, then you should know there is a built-in SSH connection manager that is easy to call up and use.