Some routers have the ability to disallow access to the setup login from the wifi. If that was activated on yours, it would produce the symptom you have.
Even if this is not the case for you the solution to regain access to the setup is still the same. Connect to the router with a cable, if you can, even if you need to have a friend with a laptop come over. Or reset the router.