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.

 

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
 
  • network, linux
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

CIDR Notation – Explained & Examples

CIDR (Classless Inter-Domain Routing) notation is a compact method for specifying IP addresses...

Disable IPv6 on Linux – Ubuntu, Debian, CentOS

To disable IPv6 on Linux it is required to modify Linux kernel parameters. IPv6 can be temporary...

169.254.0.0/16 – Disable ZEROCONF Route

You may notice that in your routing table you have a route 169.254.0.0/16. It is so called...

What is my Public IP address?

Use one of the following commands to check your public IP address from the Linux command line....

Finding Active Computers in Local Network from Linux

Searching for Linux command that can list all IP addresses of devices connected to the network?...