Is it possible for IPCONFIG on Vista to display the status of one adapter only?

18

7

Is it possible for IPCONFIG on Vista to display the status of one adapter only?

I have so many adapters that the one I want has scrolled off the top.

Alternatively, is there another program that could display the status of a specific adapter (IP address etc…)

justintime

Posted 2009-08-08T15:21:47.337

Reputation: 2 651

'ipconfig | more' not an answer to your question, but a solution – Joakim Elofsson – 2009-08-08T22:57:30.950

btw use 'space' to show more – Joakim Elofsson – 2009-08-08T23:04:28.267

Yes - 'ipconfig | more' is a reasonable workround. I would prefer if IPCONFIG could be selective but there one is.... If this was an answer I would accept it – justintime – 2009-08-09T18:21:20.493

Answers

29

It's not as short as ipconfig, but you can use netsh to do this:

> netsh interface ip show addresses "Local Area Connection"

Configuration for interface "Local Area Connection"
    DHCP enabled:                         Yes
    IP Address:                           10.34.46.91
    Subnet Prefix:                        10.34.46.0/24 (mask 255.255.255.0)
    Default Gateway:                      10.34.46.254
    Gateway Metric:                       0
    Default Gateway:                      10.10.124.14
    Gateway Metric:                       0
    Default Gateway:                      139.30.107.176
    Gateway Metric:                       0
    InterfaceMetric:                      4245

Replace "ip" in the command by "ipv6" to get IPv6 information.

Put it into a batch for less typing :-)

Joey

Posted 2009-08-08T15:21:47.337

Reputation: 36 381

1Discovered the grep-like | findstr "<string>" for those parsing the output (in my case, looking for subnet information). – msanford – 2014-06-02T18:01:24.947

2

netsh interface ip show addresses "Local Area Connection"

just a sidenote: This doesn't reflect the current state.

When I tried this solution to check the dhcp address, it wouldn't update the status until ipconfig was issued.

user273962

Posted 2009-08-08T15:21:47.337

Reputation: 21

1

To achieve the goal of only outputting one adapter, pipe the string of commands to head (from the GnuWin32 package).

:: Output network adapter name and IP addresses using native commands only

ipconfig /all | findstr /IR "ipv4 ethernet adapter" | findstr /IRV "description tunnel vpn dial bluetooth [2-9]:$" | findstr /LV "*"

:: Using grep binary from gnuwin32 output only network adapter name and IP addresses

ipconfig /all | grep -iE "ipv4|ethernet|adapter" | grep -iEv "description|tunnel|vpn|dial|bluetooth|[2-9]:$" | grep -iFv "connection*"

:: And one more that yields the bare essentials (hostname, adapter name, MAC, IPv4, subnet, gateway, DNS)
:: I purposefully excluded v6 addresses because I don't have a need, if you need then just omit it

ipconfig /all | findstr -iv "ipv6 bluetooth Description DHCP Autoconfiguration Netbios routing wins node Connection-specific obtained expires disconnected"

See https://sysinfo.io/output-ip-address-with-ipconfig/ for more detail.

Sysinfo.io

Posted 2009-08-08T15:21:47.337

Reputation: 11

Welcome to Super User! Can you include the relevant info from your link - ie what command to issue, how to install head ? Cheers! – bertieb – 2019-02-14T13:31:09.000

@bertieb Your wish is my command. It has been done. Link is included to the official source of GnuWin32. – Sysinfo.io – 2019-02-14T22:27:39.147

1

From your question it sounds like you're not aware that you can change the Screen Buffer Size for the command window in Windows? This gives you a scroll bar at the side of the window that you can use to scroll back up to view info that's scrolled off the top of the window.

On the console window click the icon at the left of the title bar (or just right-click the title bar) select Defaults, click the Layout tab, change the Screen Buffer Size Height to something quite a few times larger than the Window Size Height (mine are currently 25 lines height for the window, but 300 lines for the screen buffer height).

Can't remember if this was on by default for Vista or not, but for XP and prior you definitely had to go in and manually change it to something sensible yourself.

The other very useful option that I always change on a new install are switching on QuickEdit Mode on the first tab. This lets you select text in the command window with the mouse, then just hit Enter to send it to the clipboard, and just right click on the console window to paste (obviously don't switch this on if you use any console apps that use the mouse).

GAThrawn

Posted 2009-08-08T15:21:47.337

Reputation: 4 176

Doesn't it already default to 80x300? (Unless the poster still uses command.com...) – user1686 – 2009-08-09T07:55:07.600

Thanks for tip - I am aware that you can change the the buffer size, but would prefer not to have to scroll back. – justintime – 2009-08-09T18:18:39.267

1

I installed Gnu Grep for windows and then modified my path so I could run grep from anywhere

Then I made a batch file that contains

ipconfig | grep -A5 -i "Ethernet Adapter Local Area Connection:"

I have a TON of adapters so ipconfig by itself was a pain.

Steve Byrum

Posted 2009-08-08T15:21:47.337

Reputation: 11

Been looking for that. – Mandark – 2016-11-13T11:35:31.643

0

You can also view that information in the Network and Sharing Center.

From the Network and Sharing Center, click "Manage network Adapters" or similar - this will show the network connections folder. If you double click on a connection, you'll see the same output as ipconfig in a gui.

EvilChookie

Posted 2009-08-08T15:21:47.337

Reputation: 4 519