windows 10 version 1709 introduced a default Hyper-V virtual switch which is installed when the Hyper-V role is added. As you can see in the following example, by default on Windows 10, the default virtual switch does not exist because the Hyper-V role hasn’t been added.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

Now that the Hyper-V role has been added, you can see that a new network adapter named “vEthernet (Default Switch)” exists.

Get-NetAdapter | Format-Table -AutoSize
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

While you wouldn’t think this would be a problem, I’ve seen some latency problems on the host operating system once this default switch is added. The problem seems to be related to the interface metric being the same on the physical network adapter and the default switch.

Get-NetIPInterface
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

While you would think the default route would take precedence, something just doesn’t seem right. Having the metric set exactly the same by default doesn’t seem like a good idea.

Get-NetRoute | Format-Table -AutoSize
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

Maybe you’re like me and think that disabling the default switch would be the way to resolve this problem? Bad idea. Trust me, learn from the mistakes of others.

Disable-NetAdapter -Name 'vEthernet (Default Switch)' -PassThru -Confirm:$false
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

Everything seems to work fine after disabling it, but wait.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

Guess what happens after you reboot? The disabled network adapter goes into a “Not Present” state and a new default switch is created which is enabled.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

I received a response from one of the program managers of the Hyper-V team about this issue on Twitter last year and provided them with the information they requested.

Now you not only have a latency problem, but you also have the problem of getting rid of a network adapter that’s not present. Unfortunately, there doesn’t seem to be a PowerShell command for removing a network adapter. Maybe like me, you decide to resort to some arcane DOS command to nuke all of your network settings.

netcfg -d
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

That would also be a bad idea as you’ll end up with another default switch and this time, one of them is in limbo.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

I had to resort to using the GUI to remove these network adapters.


Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

After removing them and rebooting, I was back to square one.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

The solution seems to be to change the metric on the default switch so the host OS prefers the physical adapter.

Get-NetIPInterface -InterfaceAlias 'vEthernet (Default Switch)' Get-NetIPInterface -InterfaceAlias 'vEthernet (Default Switch)' | Set-NetIPInterface -InterfaceMetric 5000 -PassThru
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

This seems to be a hot mess as you’d think Microsoft would prevent disabling the default switch if it causes problems, otherwise you can end up with numerous copies of it and that can’t be good.

Get-NetAdapter
Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...

I built a Windows 10 version 1809 VM and enabled Hyper-V on it. The metric for its default switch was already set to 5000, so this problem may be resolved with newer fresh installations of Windows 10. It is not however resolved for Windows 10 installations that are updated from previous versions to version 1809.

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

代码区博客精选文章
分页:12
转载请注明
本文标题:Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with P ...
本站链接:https://www.codesec.net/view/611439.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(61)