Yes, you can quickly find your local IP address using a single command in PowerShell. This method is the most direct way to see the network interface details for your computer without opening network settings or third-party apps. The command `Get-NetIPAddress` filters for the interface that is currently connected to the internet, typically labeled as "Ethernet" or "Wi-Fi".

What You'll Need

  • A computer running Windows 10 or Windows 11.
  • The Windows PowerShell application (often called the Command Prompt).

Step-by-Step

  1. Open the Start menu. Click the Windows icon in the bottom-left corner of your screen. In the search bar, type "PowerShell" or "Windows PowerShell".
  2. Select the correct application. In the search results, click on "Windows PowerShell" or simply "PowerShell". Do not select the terminal with the blue background icon unless you specifically need the advanced terminal features; the standard black-screen window is sufficient for this task.
  3. Run the command. In the PowerShell window, type the following command and press Enter:
    Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -notlike "*Loopback*"}
  4. Review the output. The system will display a list of your network interfaces. Look for the line that describes your active connection. It will likely be labeled "Ethernet" if you are plugged in or "Wi-Fi" if you are on a wireless network. Next to the Interface Description, the column labeled IPAddress contains your local IP address (usually starting with 192.168.x.x or 10.x.x.x).

Common Mistakes

  • Ignoring the Interface Alias: The command above filters out virtual adapters like Hyper-V or VPN tunnels. If you see multiple entries, ensure you are looking at the one that matches your physical hardware (e.g., Realtek PCIe GBE Family Controller or Intel(R) Wi-Fi 6 AX201).
  • Using the Wrong Address Family: This command specifically asks for IPv4 addresses. If you are in a network environment that uses IPv6, you will not see those addresses here. To see both, remove the -AddressFamily IPv4 part of the command, though this will display more information than strictly necessary.

Tips

  • One-Liner Shortcut: If you want to see just the IP address and nothing else, you can pipe the output of the command into a format command. Type Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -notlike "*Loopback*"} | Select-Object IPAddress, InterfaceAlias and press Enter. This will display a clean, two-column table.
  • Determining the Gateway: Sometimes you need to know the router's IP address to access it directly. You can add the Gateway property to the output with: Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -notlike "*Loopback*"} | Select-Object IPAddress, InterfaceAlias, DefaultGateway.

Troubleshooting

If the command returns an empty list or the IP address appears incorrect, check the following common issues.

  • Network Adapter Disabled: Ensure your network adapter is turned on. In Windows, go to Settings > Network & Internet > Advanced Network Settings and check if your adapter is toggled off. If you are on Wi-Fi, ensure the physical switch on your laptop is on and the Wi-Fi radio is enabled.
  • IP Address Conflict: If another device on your network is using the same IP address as your computer, you may see a black screen or a command prompt that is unresponsive. To check for a conflict, open a web browser and try to load a page. If it fails, it is likely a conflict. You can resolve this by releasing and renewing your IP address, which forces the router to assign you a new one.
  • VPN or Proxy interference: If you are connected to a corporate VPN, the command may return the VPN's internal IP address instead of your local one. Disconnect the VPN temporarily to see your standard local IP address.

Frequently Asked Questions

  1. Why does it show two IP addresses?

    It is normal to see two entries: one for the local network (like 192.168.1.50) and one for the local loopback (127.0.0.1). The loopback address is used for testing the computer's own network stack and is not used for actual internet communication. You can filter these out by adding Where-Object {$_.IPAddress -notlike "127.*"} to your command.

  2. What if I use a Mac or Linux?

    The commands are different. On macOS and Linux, you typically use the ifconfig or ip addr command in the Terminal.

  3. Is this the same as my public IP?

    No. The command above shows your local IP address assigned by your router. Your public IP address is what the rest of the internet sees. You can find your public IP by searching "what is my IP" in a web browser.

  4. How do I change my IP address?

    You can change your local IP address by going to Settings > Network & Internet > Ethernet (or Wi-Fi) > Properties and setting the IP assignment to "Manual". You will need to know your subnet mask and default gateway to do this correctly.

  5. Why does the command take a long time?

    PowerShell commands are generally very fast, but if your computer has many network adapters (e.g., multiple virtual machines, Bluetooth PAN, or VPN tunnels), the query might take a moment to iterate through all of them.