Hi,
I would like to know where the data about the network adapters is obtained, that is, when executing the BridgeDeviceList command, an id that represents the adapter is shown, where does it come from?
Is there any way to use the BridgeCreate command using the actual name of the network adapter? (BridgeCreate hubname /DEVICE:X)
[SOLVED]Network adapter data
-
- Posts: 7
- Joined: Mon Jan 25, 2021 11:08 am
[SOLVED]Network adapter data
Last edited by jpl on Thu Apr 08, 2021 8:58 am, edited 1 time in total.
-
- Posts: 1
- Joined: Wed Feb 17, 2021 7:47 am
Re: Network adapter data
This procedure can't identify the adapter if there's no driver installed. If you need the latest driver, choose your Windows version from the Drivers and Software list. These downloads cover most Intel® Ethernet Adapters and install the latest drivers when you run them. 2 player games
-
- Posts: 7
- Joined: Mon Jan 25, 2021 11:08 am
Re: Network adapter data
Firstly thanks for repliying!
I have installed a Microsoft KM-TEST Loopback Adapter and I have the latest drivers updated, however when i try to create a Local Bridge using BridgeCreate command in vpncmd I can´t identify the network adapter with the name I have assigned in the control panel of windows. The real name of the network adapter is ETH0 but when i execute BridgeDeviceList to check the name that SoftEther uses to identify it, it is shown as "MS NDIS 6.0 LoopBack Driver (ID=XXXXXXXXXX)", so i wanted to know where does this name come from.
I have installed a Microsoft KM-TEST Loopback Adapter and I have the latest drivers updated, however when i try to create a Local Bridge using BridgeCreate command in vpncmd I can´t identify the network adapter with the name I have assigned in the control panel of windows. The real name of the network adapter is ETH0 but when i execute BridgeDeviceList to check the name that SoftEther uses to identify it, it is shown as "MS NDIS 6.0 LoopBack Driver (ID=XXXXXXXXXX)", so i wanted to know where does this name come from.
-
- Posts: 1
- Joined: Wed Feb 17, 2021 10:49 pm
Re: Network adapter data
If you need the latest driver, choose your Windows version from the Drivers and Software list. 192.168.100.1 192.168.1.1
Last edited by hjyuk on Thu Feb 18, 2021 6:48 pm, edited 1 time in total.
-
- Posts: 7
- Joined: Mon Jan 25, 2021 11:08 am
Re: Network adapter data
I dont need the latest diver.
What I need is to know how SoftEther generates the name of the network adapters in windows. Exmp: "MS NDIS 6.0 LoopBack Driver (ID=XXXXXXXXXX)"
What I need is to know how SoftEther generates the name of the network adapters in windows. Exmp: "MS NDIS 6.0 LoopBack Driver (ID=XXXXXXXXXX)"
-
- Posts: 10
- Joined: Fri Jan 05, 2018 11:51 pm
Re: Network adapter data
Are you asking how to query the system programmatically to access network adapter data? If so the following vbscript shows you how to do it.
SET WshShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapter")
For Each objItem in colItems
WScript.Echo objItem.Description
WScript.Echo objItem.NetConnectionID
Next
For a full list of properties that about the adapter you can refer to this link
https://docs.microsoft.com/en-us/window ... orkadapter
Now SoftEther is not written in vbscript but there are mechanisms in other programming languages to get the same information from Windows.
Is this the kind of information you were looking for?
Mike
SET WshShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapter")
For Each objItem in colItems
WScript.Echo objItem.Description
WScript.Echo objItem.NetConnectionID
Next
For a full list of properties that about the adapter you can refer to this link
https://docs.microsoft.com/en-us/window ... orkadapter
Now SoftEther is not written in vbscript but there are mechanisms in other programming languages to get the same information from Windows.
Is this the kind of information you were looking for?
Mike
-
- Posts: 1323
- Joined: Sun Feb 14, 2021 10:31 am
Re: Network adapter data
Here are the SoftEther steps to generate ID=x:
- call the "EnumEthernet" method of RPC API
- get GUID of Network Adapter
- hash it
get GUID: netsh lan show interfaces
compile this short code from SoftEther's BridgeWin32.c
Code: Select all
// Generate an ID from GUID
UINT Win32EthGenIdFromGuid(char *guid)
{
char tmp[MAX_SIZE];
UCHAR hash[SHA1_SIZE];
UINT i;
// Validate arguments
if (guid == NULL)
{
return 0;
}
StrCpy(tmp, sizeof(tmp), guid);
Trim(tmp);
StrUpper(tmp);
HashSha1(hash, tmp, StrLen(tmp));
Copy(&i, hash, sizeof(UINT));
i = Endian32(i);
if (i == 0)
{
i = 1;
}
return i;
}
-
- Posts: 7
- Joined: Mon Jan 25, 2021 11:08 am
Re: Network adapter data
Thank you very much, this was what I was looking for!solo wrote: ↑Sun Feb 21, 2021 9:46 amHere are the SoftEther steps to generate ID=x:You can generate it manually yourself:
- call the "EnumEthernet" method of RPC API
- get GUID of Network Adapter
- hash it
get GUID: netsh lan show interfaces
compile this short code from SoftEther's BridgeWin32.c
Code: Select all
// Generate an ID from GUID UINT Win32EthGenIdFromGuid(char *guid) { char tmp[MAX_SIZE]; UCHAR hash[SHA1_SIZE]; UINT i; // Validate arguments if (guid == NULL) { return 0; } StrCpy(tmp, sizeof(tmp), guid); Trim(tmp); StrUpper(tmp); HashSha1(hash, tmp, StrLen(tmp)); Copy(&i, hash, sizeof(UINT)); i = Endian32(i); if (i == 0) { i = 1; } return i; }