How can I find out what IP my router on my local area network is using?
In Terminal.app type
route get default
route get default | grep gateway
for more condensed output.
This is the fastest way as pointed out by Daniel. Thanks Dan.
There is another way that will take a lot longer:
netstat -r | grep default
The convention is to give the router the first address on the subnet. This means, in most cases, your router's IP address is the same as your IP address except it ends in 1.
If your IP is 10.0.0.105, then your router's IP is probably 10.0.0.1.
If your IP is 192.168.1.83, then your router's IP is probably 192.168.1.1
I was at first a bit confused by the output from the
route get default | grep gateway commands on my Mac (OS X 10.9.4), as it yielded in my case a host name rather than an IP address.
In case anyone else comes here wanting the IP address as well, adding the
-n option could possibly help (according to the documentation, it will bypass attempts to print host and network names symbolically when reporting actions):
route -n get default | grep gateway
If you want the local address of the router it's most likely your gateway address. Press the Apple Menu () , got to 'System Preferences', then go to 'Network'. Select any of the items on the left (Ethernet/AirPort) that say connected.
On the right will be a bunch of fields, one of which is 'Router', which is usually 192.168.1.1.
If you want your internet IP address you can just go to http://www.whatsmyip.net/ and it will show you there.