The easiest way to retrieve a routers IP address is by going through System Preferences. This is much the same way that you get your Macs IP address, but the router IP is a few steps further in preference menus.
Ideally the router IP would be included in the detailed network data shown when option-clicking on the Wi-Fi menu since it fits in line with troubleshooting, but it’s not exactly hard to click through system prefs either.
If you are looking for an external IP address as seen by the internet, you can get that by typing the following into the command line:
This will report back the IP of either your Mac or your router as it would be accessible from the internet and outside world, which is different than the router IP you use to connect locally.