4

How to get network ip address via windows command prompt? I know tat ipconfig /all shows ip configuration, but what about having just ipv4 adress?

  • Maybe this would do for you: netsh interface ip show address "Ethernet" | findstr "IP Address" . Substitute "Ethernet" with your main adapter name – Ashtray Feb 20 '14 at 6:57
  • what about a more general command? I mean getting all ipv addresses? – hpaknia Feb 20 '14 at 7:00
  • Just don't type the adapter's name and it'll output all the IP addresses – Ashtray Feb 20 '14 at 7:01
3

I wrote a proper ip4 command out of similar frustration.

ip4

(.exe is here)

| improve this answer | |
  • if you use chocolatey you can just type choco install ip4 – Treer Nov 10 '19 at 20:21
  • I downloaded it and my antivirus is flagging it. – Jean Paul Ruiz Apr 6 at 2:59
  • 1
    I reported the false flag to avast, and they claim to have fixed it – Treer Apr 13 at 22:05
  • I will give it another try. Thanks for letting me know. – Jean Paul Ruiz Apr 14 at 23:04
7

You can view all the configured IP addresses using this command:

netsh interface ip show address | findstr "IP Address"

You can also add the adapter name to get IP address of a specific network interface.

netsh interface ip show address "Ethernet" | findstr "IP Address"

This should work in at least latest versions of Windows.

| improve this answer | |
2

Another valid way is via WMIC:

wmic NICCONFIG WHERE IPEnabled=true GET IPAddress

This will show the IP address if there is one and the adapter that has it configured is enabled. Quite useful in many situations.

| improve this answer | |
  • Getting the IP for the enabled adapter is a bonus! Thanks! – ariestav Jul 13 at 19:29
0

For those on Windows 10 with powershell, you can run:

[System.Net.Dns]::GetHostEntry([System.Net.Dns]::GetHostName()) | select AddressList
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.