Answered by:
Get-NetAdapter returns strange results

Question
-
I noticed while trying to solve other network issues that the Get-NetAdapter command seems to return the network adapters of the container host and not the container (or atleast their names):
[1b2b4048-bf7]: PS C:\Windows\ServiceProfiles\LocalService\Documents> Get-NetAdapterName InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
Hyper-V Virtual Ethernet Adapter #2 0 bps
Microsoft Hyper-V Network Adapter 0 bpsipconfig on the other hand returns:
[1b2b4048-bf7]: PS C:\Windows\ServiceProfiles\LocalService\Documents> ipconfig /allWindows IP ConfigurationHost Name . . . . . . . . . . . . : WIN-18CB2HRNVI2
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : test.localEthernet adapter vEthernet (sw-1B2B4048-BF7C-46DE-A0DE-C04450461A30-0):Connection-specific DNS Suffix . : rebtelnet.local
Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #3
Physical Address. . . . . . . . . : 00-15-5D-0B-2F-00
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::d8eb:e4da:dc7b:9d50%15(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.11.57(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Thursday, August 20, 2015 3:38:48 AM
Lease Expires . . . . . . . . . . : Friday, August 28, 2015 3:38:49 AM
Default Gateway . . . . . . . . . : 192.168.11.1
DHCP Server . . . . . . . . . . . : 192.168.10.45
DNS Servers . . . . . . . . . . . : 192.168.10.45
192.168.10.42
192.168.10.41
NetBIOS over Tcpip. . . . . . . . : DisabledMaybe this is causing problems with services like winrm and file shares
- Edited by aL3891 Thursday, August 20, 2015 3:14 PM
Thursday, August 20, 2015 11:46 AM
Answers
-
Hello,
If you run get-netadapter -IncludeHidden you will also see the net adapter that is displayed by ipconfig. The other adapters present on the host are currently still shown but without any populated details.
Thanks for bringing this up and please keep in mind that this is a first public preview and not the final version.
Hope this helps,
Lars
This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.
- Proposed as answer by BrianEhMVP Thursday, August 20, 2015 4:25 PM
- Marked as answer by aL3891 Thursday, August 20, 2015 4:56 PM
Thursday, August 20, 2015 3:46 PM
All replies
-
A container itself is not a standalone machine like a VM. So don't think of it in that way.
It has a port that is NAT'ed and shares the IP of the host.
Brian Ehlert
http://ITProctology.blogspot.com
Learn. Apply. Repeat.Thursday, August 20, 2015 2:53 PM -
But i'm not using a Nat vm-switch, i'm using one connected directly to a host interface.
Even if that's the case, shoudn't get-netadapter atleast return the same interface(s) ipconfig does? something is off about this i think
Thursday, August 20, 2015 3:12 PM -
Hello,
If you run get-netadapter -IncludeHidden you will also see the net adapter that is displayed by ipconfig. The other adapters present on the host are currently still shown but without any populated details.
Thanks for bringing this up and please keep in mind that this is a first public preview and not the final version.
Hope this helps,
Lars
This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.
- Proposed as answer by BrianEhMVP Thursday, August 20, 2015 4:25 PM
- Marked as answer by aL3891 Thursday, August 20, 2015 4:56 PM
Thursday, August 20, 2015 3:46 PM -
I see, thanks!
I would still consider this a bug though, it seems odd to me that the network adapters of the container OS should be visible to the container, it should only see its own adapters. especially since they aren't populated with any values.
Also ipconfig doenst seem to display the host adapters either (the behavior i'd expect)
I know this is the first public beta, so no worries :) containers are really cool and once you sort out these issues they will be incredibly powerful!
- Edited by aL3891 Thursday, August 20, 2015 5:06 PM
Thursday, August 20, 2015 5:01 PM