Contents

Boosting Host Internet Speed with Hyperv Internal Host-Only Network

Maximizing Host Internet Performance in Hyper-V with Metric Optimization

Website Visitors:

Introduction

Hyper-V, Microsoft’s virtualization platform, is a powerful tool for running multiple operating systems on a single physical machine. One of its features is the ability to create Internal Host-Only Networks, which can be incredibly useful for various purposes. However, some users have reported that using these networks can slow down the host machine’s internet speed. In this article, we’ll explore the issue and present a solution by setting a low metric value for the host network adapter.

Understanding the Problem

When you create an Internal Host-Only Network in Hyper-V, it essentially isolates the virtual machines (VMs) running on your host machine. This network allows these VMs to communicate with each other and the host but not with the outside world, which is precisely what you’d expect from a host-only network.

However, the problem arises when this internal network starts to affect the host machine’s internet speed. This slowdown can happen because the host machine’s operating system prioritizes the virtual network adapter over the physical one when routing network traffic. To fix this, we need to adjust the metric value of the network adapters.

Internet works in your host machine (laptop or desktop) but it will be very slow. This includes anything related to internet like browsing, any apps that use internet etc…

What is the Metric Value?

The metric value is a numerical value assigned to network interfaces on a Windows machine. It determines the priority of network adapters when routing network traffic. Lower metric values indicate higher priority, and Windows uses the adapter with the lowest metric value by default.

Setting a Low Metric Value from GUI

Here’s a step-by-step guide on how to set a low metric value for your host network adapter, ensuring that it gets priority when routing internet traffic:

Step 1: Access Network Connections

  • Open run dialog box by pressing Windows + r keys. Type control in the run dialog box and hit enter. This will open control panel.
  • On the top right, change the View by value to Large icons and click Network and Sharing Center.
  • On the top left, click on Change adapter settings option. This will open the network connections or the network adapters console in your machine.
Tip
You can directly open network connections by running the command ncpa.cpl in the run dialog box.

Step 2: View Adapter Settings

Let’s view adapter settings for both your primary network adapter and your Hyper-V Internal Host only adapter. In your network connections page:

  • Identify your primary network adapter(Ethernet or Wi-Fi) and double click it to open the status dialog box. Click properties option.

  • Back in your network connections page, identify your Hyper-V Internal Host only network adapter(Ethernet or Wi-Fi) and double click it to open the status dialog box. Click properties option.

Step 3: Configure Adapter Properties

Perform below step for both the adapters ie., your primary network adapter(Ethernet or Wi-Fi) and your Hyper-V Internal Host only network adapter.

  • In the Properties window, scroll down and locate Internet Protocol Version 4 (TCP/IPv4) and select it.
  • Click on the Properties button.

Step 4: Adjust Metric Value

You have to identify the metric value for Hyper-V Internal Host only network adapter and set lower metric value number to your primary network adapter(Ethernet or Wi-Fi)

On your Hyper-V Internal Host only network adapter:

  • In the IPv4 Properties window, click on the Advanced button at the bottom.
  • Note down the value given in Interface metric column.

On your primary network adapter(Ethernet or Wi-Fi):

  • In the IPv4 Properties window, click on the Advanced button at the bottom.
  • In the IP Settings page, uncheck the option that says Automatic metric.
  • In the Interface metric field, set a number lower than the number you have for Hyper-V Internal Host only network adapter. This will prioritize your host network adapter over others.
  • Click “OK” to confirm the changes.

Step 5: Confirm Changes

  • Click “OK” in all the IPv4 Properties window.
  • Click “OK” in all the Properties window to save the changes.

Step 6: Restart Your Computer

  • To apply the changes, you may need to restart your computer.

Setting a Low Metric Value using PowerShell

You can set a low metric value for your network adapter using PowerShell. Here are the steps to do it:

Step 1: Open PowerShell

Open a PowerShell window with administrator privileges. To do this, right-click on the “Windows” button and select “Windows Terminal (Admin)” or “Windows PowerShell (Admin).”

Step 2: Identify Network Adapters

To list all network adapters and their metric values, you can use the Get-NetIPInterface cmdlet. Run the following command:

1
Get-NetIPInterface | Select-Object InterfaceAlias,InterfaceMetric

This will display a list of network adapters and their metric values.

Step 3: Set a Low Metric Value

Identify the network adapter you want to set a low metric value for (usually your primary network adapter, like Ethernet or Wi-Fi). Make note of the “InterfaceAlias” value for this adapter. Perform the same for your Hyper-V host only network adapter.

Now, use the Set-NetIPInterface cmdlet to set a low metric value. Replace "YourNetworkAdapterAlias" with the actual “InterfaceAlias” of your network adapter and a desired metric value. Metric value 10 is shown in below example. Make sure you use a metric value less than your Hyper-V host only network adapter metric value.

1
Set-NetIPInterface -InterfaceAlias "YourNetworkAdapterAlias" -InterfaceMetric 10

Step 4: Confirm Changes

To confirm that the metric value has been updated, run the Get-NetIPInterface command again:

1
Get-NetIPInterface | Select-Object InterfaceAlias,InterfaceMetric

You should see your network adapter with the new metric value.

Step 5: Restart Your Computer

To apply the changes, it’s recommended to restart your computer.

That’s it! You’ve now set a low metric value for your network adapter using PowerShell, which should prioritize it for network traffic routing and potentially improve your internet speed.

Conclusion

Setting a low metric value for your host network adapter can significantly improve your host machine’s internet speed when using Hyper-V’s Internal Host-Only Network. This simple solution ensures that the physical network adapter takes precedence over the virtual one when routing network traffic, preventing slowdowns and interruptions. Enjoy faster internet speeds without compromising your virtualization needs with this effective tweak.

Your inbox needs more DevOps articles.

Subscribe to get our latest content by email.