Insights

How to check your gateway IP address

Find your gateway IP address on Windows, macOS and Linux, pair it with its interface, and check a destination-specific route.

Illustration of network router with one connected Ethernet port.
On this page

On Windows, run ipconfig in Command Prompt and read Default Gateway under the adapter you're using. On macOS, open System Settings → Network → your connection → Details → TCP/IP and read Router, or on Linux run ip route and read the address after via in a default via line.

In short:

  • Windows gateway. Read Default Gateway and keep its adapter heading with the address.
  • Mac gateway. Read Router in the selected connection's TCP/IP settings.
  • Linux gateway. Read the address after via and the interface after dev in the default route.

Check your device's network settings

IP means Internet Protocol. You may see Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6) addresses. Your gateway is the next routing hop used to leave your local network.

At home, the gateway is usually your router's local address. On a larger network, it can be another routing device's interface. Use these read-only checks on devices you own or administer. They don't change settings, so no configuration recovery is needed.

Windows

1. Open Command Prompt.

2. Run the gateway lookup command.

ipconfig

3. Find the adapter you're using and read Default Gateway.

You should see network details grouped under adapter headings. The Default Gateway field shows the gateway configured for that adapter. Record the address and adapter heading together, not just the first gateway listed.

macOS

1. Open System Settings and select Network.

2. Select your connection, then open Details → TCP/IP.

3. Read the Router field.

That field shows the gateway address for the connection you selected. Keep the connection name with the address.

You can also check the default route in Terminal.

4. For the Terminal alternative, run this command.

route -n get default

Read the gateway address from the result. This checks the default route, not the route to every possible destination.

Linux

1. Open Terminal.

2. Run the route lookup command.

ip route

3. Look for a line starting with default via.

It may look like this:

default via 192.168.1.1 dev eth0

Here, 192.168.1.1 is the gateway and eth0 is the interface. Your values may differ. Record both values, and use the checks below if several routes appear. ip route inspects IPv4 routes by default; use ip -6 route when checking IPv6 routes.

Choose the gateway for the connection you need

A configured default gateway and a destination's selected route answer different questions. A default route applies when no more specific route matches the destination. These checks are read-only on devices you own or administer, so no configuration recovery is needed.

1. Keep each gateway paired with its adapter or interface.

Windows can list physical adapters and logical interfaces, such as dial-up connections. Seeing several adapter entries doesn't prove that all traffic uses one gateway. Use the entry associated with the connection you need instead of copying the first address shown.

2. On Windows, inspect the routing table.

route print

The output shows the routing table, which lets you check the default route alongside other routes. This is different from the adapter configuration shown by ipconfig.

On macOS, the route -n get default command above checks the default route. Don't treat that result as proof that every destination uses the same gateway.

For Linux, the ip route manual distinguishes listing routes from looking up the route to a particular destination. Replace <destination-IP>, including the angle brackets, with the numeric IP address you actually need to reach.

3. On Linux, check the route for that destination.

ip route get <destination-IP>

The result shows the route your device would use for that address. It's a route lookup, not a reachability test, so it doesn't prove the destination can respond.

If the gateway or interface differs from the default entry, keep the destination-specific result. A more specific route may apply. For later diagnosis, record the destination address alongside the route result.

If you don't see a gateway

First, confirm that you inspected the intended connection and its routing information. A blank gateway field or missing default route doesn't identify a failed router. Specific routes can still exist, so a missing default route doesn't prove that every remote destination is unreachable.

Ask your network administrator for the intended gateway if you need to configure one. Don't guess an address, scan for a router, delete routes or change settings just to locate the value. Keep the gateway address, interface name and lookup result for any later connectivity diagnosis.

Ask an AI assistant

Share this article

Private Everywhere

Stop giving the internet everything

Keep your browsing, messages, files, and agents private.