systeminformation icon indicating copy to clipboard operation
systeminformation copied to clipboard

Not all interfaces shown (docking station)

Open tomas-reznak opened this issue 2 years ago • 2 comments

Describe the bug

When trying to get list of all network interfaces on the laptop, si.networkInterfaces(cb) doesn't return all of them. I know about older similar issues, but this is some kind of special behavior which could be investigated.

To Reproduce

My laptop uses:

  1. default internal network interface (named Ethernet)
  2. docking station interface (named Ethernet HP Docking)
  3. Wi-Fi, Bluetooth, Loopback interfaces - skipped for simplicity

When internal interface is set as Disabled (via Windows Control Panel), si.networkInterfaces(cb) returns both interfaces correctly.

image

When internal interface is set as Enabled, si.networkInterfaces(cb) returns this interface only.

image

Current Output

When internal network interface is set as Enabled, it returns just this interface:

[
	{
		"iface": "Ethernet",
		"ifaceName": "Intel(R) Ethernet Connection (10) I219-LM",
		"default": false,
		"ip4": "",
		"ip4subnet": "",
		"ip6": "",
		"ip6subnet": "",
		"mac": "c8:5a:cf:6d:8f:5c",
		"internal": "undefined",
		"virtual": false,
		"operstate": "down",
		"type": "wired",
		"duplex": "",
		"mtu": "",
		"speed": 9223372036854.775,
		"dhcp": false,
		"dnsSuffix": "",
		"ieee8021xAuth": "Unknown",
		"ieee8021xState": "Unknown",
		"carrierChanges": 0
	}
]

When using ipconfig -all, both interfaces are returned correctly:

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) Ethernet Connection (10) I219-LM
   Physical Address. . . . . . . . . : C8-5A-CF-6D-8F-5C
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Ethernet HP Docking:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek USB GbE Family Controller
   Physical Address. . . . . . . . . : C8-5A-CF-6D-8F-5C
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Expected behavior

After fixing this bug, both interfaces (with some others, which I skipped for simplicity) should be returned as this:

[
	{
		"iface": "Ethernet",
		"ifaceName": "Intel(R) Ethernet Connection (10) I219-LM",
		"default": false,
		"ip4": "",
		"ip4subnet": "",
		"ip6": "",
		"ip6subnet": "",
		"mac": "c8:5a:cf:6d:8f:5c",
		"internal": "undefined",
		"virtual": false,
		"operstate": "down",
		"type": "wired",
		"duplex": "",
		"mtu": "",
		"speed": 9223372036854.775,
		"dhcp": false,
		"dnsSuffix": "",
		"ieee8021xAuth": "Unknown",
		"ieee8021xState": "Unknown",
		"carrierChanges": 0
	},
	{
		"iface": "Ethernet HP Docking",
		"ifaceName": "Realtek USB GbE Family Controller",
		"default": false,
		"ip4": "",
		"ip4subnet": "",
		"ip6": "",
		"ip6subnet": "",
		"mac": "c8:5a:cf:6d:8f:5c",
		"internal": "undefined",
		"virtual": false,
		"operstate": "down",
		"type": "wired",
		"duplex": "",
		"mtu": "",
		"speed": 9223372036854.775,
		"dhcp": false,
		"dnsSuffix": "",
		"ieee8021xAuth": "Unknown",
		"ieee8021xState": "Unknown",
		"carrierChanges": 0
	}
]

Environment (please complete the following information):

  • systeminformation package version: 5.12.6
  • Node.js version: 18.12.0
  • OS: Windows 10 Enterprise
  • Hardware: HP ZBook Fury 15 G7 + HP Thunderbolt Dock G2

Additional context Add any other context about the problem here.

tomas-reznak avatar Jan 13 '23 16:01 tomas-reznak

systeminformation.networkInterfaces() is using os.networkInterfaces() to get interfaces, but nodejs os function doesn't return all interfaces (according to documentation should return all interfaces with IP set, but this is not true)

For Linux maybe it would be better to check all devices in /sys/class/net, not sure about other systems.

balk0t avatar May 09 '23 11:05 balk0t

Hello, is there any progress on this?

tomas-reznak avatar Apr 09 '24 20:04 tomas-reznak