5

While troubleshooting connectivity issues on my PC, I noticed that I have duplicate of every network interface when issuing Get-NetIPInterface command on PowerShell.

Notice how each interface has a duplicate. Even the ifIndex's are the same.

But I can conclude that these are not just "shadows" of the same interface, because one of vEthernet (Ethernet 2) has DHCP Enabled and the other one Disabled.

PS C:\Windows\system32> Get-NetIPInterface

ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- --------------                  ------------- ------------ --------------- ----     --------------- -----------
37      vEthernet (WSL)                 IPv6                  1500            5000 Enabled  Connected       ActiveStore
21      Ethernet 2                      IPv6                  1500               6 Enabled  Connected       ActiveStore
31      vEthernet (Ethernet 2)          IPv6                  1500              15 Enabled  Connected       ActiveStore
1       Loopback Pseudo-Interface 1     IPv6            4294967295              75 Disabled Connected       ActiveStore
37      vEthernet (WSL)                 IPv4                  1500            5000 Disabled Connected       ActiveStore
21      Ethernet 2                      IPv4                  1500               6 Enabled  Connected       ActiveStore
31      vEthernet (Ethernet 2)          IPv4                  1500              15 Disabled Connected       ActiveStore
1       Loopback Pseudo-Interface 1     IPv4            4294967295              75 Disabled Connected       ActiveStore

Network connections (ncpa.cpl) window doesn't show the duplicates.

Network connections

Why do I get these duplicate network interfaces, and how do I fix it?

1 Answer 1

7

This is not the list of link-layer interfaces (that's Get-NetAdapter), it's a list of IP interfaces or network stacks. As can be seen from the 3rd column ("AddressFamily"), one entry represents the IPv4 configuration of that interface and the other represents IPv6 configuration. (The two protocols are basically independent network stacks that only share the same link layer – but each has its own addresses, routes, gateways, static/DHCP settings, etc.)

3
  • Now that makes sense! :) Thanks. But still I wonder why they have the same ifIndex...
    – LPVOID
    Jan 25 at 7:30
  • Because ifIndex is always assigned to "physical" / link-layer interfaces (not just on Windows but other systems as well), i.e. it's not the index of the Get-NetIPInterface output but a property of the whole "Ethernet" interface from Get-NetAdapter.
    – user1686
    Jan 25 at 7:35
  • (The name ifIndex comes from SNMP, specifically from IF-MIB schema.)
    – user1686
    Jan 25 at 7:39

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.