After installing Hyper-V on Windows 8, I noticed that web browsing became painfully slow. Upon investigating, I figured out the problem was being caused by the way that I setup my Hyper-V Virtual Switch. The issue is caused by setting a Default Gateway on an Internal type virtual network adapter.
If you add a Default Gateway when configuring the static IP address on the Internal network adapter, it will add a persistent default route (0.0.0.0) to the routing table on the host machine. This causes the machine to attempt to connect to the internet using the internal adapter first. When it does not find the connection, it will then use the other network adapters. This is what causes the delay when trying to browse the internet.
To prevent this from happening, all you need to do is not enter a Default Gateway when configuring a static IP address on a virtual internal network adapter. However, if you have already done this, you can follow the steps below to fix it.
- Open an elevated Command Prompt
- Type ipconfig /all and hit Enter
- Confirm that your Internal network adapter does NOT contain a default gateway value.
Note: By default the adapter will be named vEthernet (Name). Where Name is the name you assigned it in the Virtual Switch Manager.
- If your Internal network adapter has a default gateway remove it.
- Type route print and hit Enter
- Make note of the Gateway Address under Persistent Routes for the Network Address 0.0.0.0. This address should be the same one that you entered in for the Default Gateway.
Note: In this case I only have one entry. If you have multiple static IP addresses assigned, you will see multiple entries under Persistent Routes. It is important that you choose the correct one. You may want to make note of all entries in case you need to restore one.
- Type route delete 0.0.0.0 mask 0.0.0.0 <Gateway Address> and hit Enter. Gateway Address should equal the value you made note of in step 6.
Ex. route delete 0.0.0.0 mask 0.0.0.0 172.16.1.1
- Wait for confirmation that the route was deleted.
- Reboot your machine.