-
-
Notifications
You must be signed in to change notification settings - Fork 239
Description
I'm not sure if this a strictly a bug, but I'm reporting here so people are aware of it and can work around the issue. I do have a workaround, but I haven't done enough testing to see if the workaround breaks Hyper-V, so YMMV.
I'm running Windows 10 with Hyper-V installed and have an HS110 on my network. When I run kasa or kasa discover from this machine I get nothing.
Direct IP connection also works fine, as does connect by hostname.
If I disable the Hyper-V vEthernet virtual adapters, discovery works fine.
I'm not confident on terminology, but it looks as though the problem arises due Hyper-V virtual adapters having higher priority than the physical ethernet card - more precisely, on my machine the interface metrics for both the vEthernet adapter and the vEthernet Default switch are than lower interface metrics than the physical card.
I fixed problem this by changing the interface metrics on all of the virtual adapters and switches to have higher metrics than the physical adapter. After this discovery works.
Notes:
-
Hat tip to @jamesbarnett91 - the virtualbox note on https://github.com/jamesbarnett91/tplink-energy-monitor pointed me in the right direction.
-
https://mikefrobbins.com/2018/11/08/managing-the-hyper-v-default-switch-in-windows-10-version-1709-and-higher-with-powershell/ got me started on interface metrics. This page also suggests this may only be a problem for older versions of Windows 10 and upgrades of these older versions (where I am).
-
This may or may not break Hyper-V - I'll report back when I've had time to experiment before.
-
This fix may or may not work for virtualbox as well.
-
The following powershell commands allowed me to edit interface metrics (setting requires admin privileges).
- Grab ifIndex for adapter with:
Get-NetIPInterface
- With admin enabled powershell, set the interface metric for adapter 12 to 45.
Set-NetIPInterface -InterfaceIndex 12 -InterfaceMetric 45