What Is My Router’s IP Address (Default Gateway)

A router is a device that communicates between the Internet (or public network) and the devices in a local network (or private network).

A typical home router, that usually acts as a default gateway for the local devices, can be configured using a web-based configuration page that can be accessed from a web-browser if you know the router’s IP address.

In this note i will show how to find out the router’s IP address in Windows, Linux and MacOS from the command line.

Cool Tip: Check if TCP port is opened in PowerShell! Read more →

What Is My Router’s IP Address

To display the IP address of the default gateway in Windows i.e. the router’s IP address, execute the route command with the print option from the command prompt:

C:\> route print
Network Destination            Netmask          Gateway        Interface    Metric
            0.0.0.0            0.0.0.0      192.168.1.1     192.168.1.31        50
          127.0.0.0          255.0.0.0          On-link        127.0.0.1       331
          127.0.0.1    255.255.255.255          On-link        127.0.0.1       331
        192.168.1.0      255.255.255.0          On-link     192.168.1.31       306
       192.168.1.31    255.255.255.255          On-link     192.168.1.31       306 

To find out the router’s IP address in Linux or MacOS, execute:

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    600    0        0 wlp2s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp2s0

Leave a Reply