Networking • Beginner • 5 min read

How to Find Your Local IP Address and Default Gateway (Windows, Mac, Linux)

Summary

Quick guide to locating your private IP address, subnet mask, and router default gateway on Windows 11, Windows 10, macOS, and Linux terminal.

Companion Tool
IPv4 Subnet Calculator & CIDR Mask Reference

Free online IPv4 subnet calculator. Calculate network addresses, broadcast addresses, usable host ranges, and wildcard masks instantly with CIDR notation.

Open tool

Private IP vs. Public IP vs. Default Gateway

When diagnosing network connectivity, port forwarding, or configuring home lab servers, you will encounter three distinct IP addresses:

  1. Private Local IP (Host Address): The unique address assigned specifically to your device (computer, phone, printer) on your Local Area Network (LAN), typically starting with 192.168.x.x or 10.x.x.x.
  2. Default Gateway (Router IP): The local address of your home or office router (often 192.168.1.1 or 10.0.0.1). When your computer sends traffic destined for the external internet, it delivers those packets to this gateway.
  3. Public IP Address (WAN): The single external address assigned to your modem by your Internet Service Provider (ISP), visible to all remote servers on the public web.

How to Find Your IP Address in Windows 11 and Windows 10

Method A: Using Command Prompt (Fastest)

  1. Press Win + R, type cmd, and press Enter.
  2. Run the command:
    ipconfig
  3. Locate your active network adapter:
    • IPv4 Address: Your local device IP (e.g., 192.168.1.45).
    • Subnet Mask: Defines your local subnet boundary (e.g., 255.255.255.0).
    • Default Gateway: Your router’s admin address (e.g., 192.168.1.1).

Method B: Using Modern PowerShell

Open PowerShell and run:

Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notlike "*Loopback*" } | Select-Object IPAddress, InterfaceAlias

Method C: Through Windows Settings GUI

  1. Open Settings (Win + I).
  2. Navigate to Network & internet.
  3. Click on your active connection (Wi-Fi or Ethernet).
  4. Click on Hardware properties to view your IPv4 address, DNS servers, and link speed.

How to Find Your IP on macOS

Via Terminal:

# For Wi-Fi:
ipconfig getifaddr en0

# For Wired Ethernet:
ipconfig getifaddr en1

# To view your Default Gateway (Router IP):
netstat -nr | grep default

Via System Settings GUI:

  1. Click the Apple Menu () > System Settings (or System Preferences).
  2. Click Network in the sidebar.
  3. Select your connected network (Wi-Fi or Ethernet) and click Details…
  4. Switch to the TCP/IP tab to inspect your IP address and router gateway.

How to Find Your IP on Linux (Ubuntu, Debian, Fedora, Arch)

Open your terminal emulator and use the modern ip utility:

# View all active IP addresses:
ip -brief address show

# Or view detailed network interface statistics:
ip addr show

# To find your default gateway router address:
ip route show default

Next Steps: Calculating Network Subnets

Once you have identified your local IP and subnet mask, use our interactive IPv4 Subnet Calculator to determine your network base address, broadcast address, and the complete pool of available host addresses on your local segment.

Related reference