I posted a month or so ago about my ‘Experiences using a DD-WRT router with Hyper-V’, well I have been living with it over a month? How has it been going?
Like the curate’s egg ‘good in parts’. It seems OK for while and then everything would get a bit slow to stop.
Just as a reminder this is what I had ended up with
In essence, a pair of virtual switches, one internal using DHCP on the DD-WRT virtual router, and a second one connected to an active external network (usually Ethernet, as DHCP with virtual switches and WIFI in Hyper-V seem a very hit and miss affair).
From my Hyper-V VMs the virtual router seems to be fine, they all have a single network adaptor linked to the virtual switch that issue IP addresses via DHCP. The issues have been for the host operating system. I wanted to connect this to the internal virtual switch to allow easy access to my VMs (without the management complexity of punching holes in the router firewall), but when I did this I got inconsistent performance (made harder to diagnose due to moving house from a fast Virgin cable based Internet connection to a slow BT ADSL based link who’s performance profile varies greatly based on the hour of the day. I was never sure if it was problem with my router or BT’s service).
The main problem I saw was that it seemed the first time I accessed a site it was slow, but then was often OK. So a lookup issue, DNS?
Reaching back into my distant memory as network engineer (early 90s some IP but mostly IPX and NETBIOS) I suspected routing or DNS look up issue. Routing you can do something about via routing tables and metrics, but DNS is harder to control with multiple network connections.
The best option to manage DNS appeared to be changing the binding order for my various physical and virtual network adaptors so the virtual switches were the lowest priority.
This at least made most DNS requests go via physical devices.
Note: Also on my Virtual Network Switch adaptor on the host machine I told it not to use the DNS settings provided from the virtual router, but this seemed to have little effect as when using nslookup it still picked the virtual router, until I changed the binding order.
On the routing front, I set the manual metric on IP4 traffic via the virtual router adaptor to a large number, to make it the least likely route anywhere. Doing this should mean only traffic to the internal 192.168.1.x network should use that adaptor
This meant my routing table on my host operating system looks as follows when the system is working OK
I did see some problem if the route via the virtual switch appeared first in the list, this can happen when you change WIFI hotspot. The fix is to delete the unwanted route (0.0.0.0 to 192.168.1.1)
route delete 0.0.0.0 MASK 0.0.0.0 192.168.1.1
But most of the time fixed the binding order seemed enough, so I did not need to do this
External DHCP Refresh
If you swap networks, going from work to home, your external network will have a different IP address. You do have to restart the router VM (or manually renew DHCP to get a new address)
DHCP and WIFI
There is still the problem getting DHCP working over Hyper-V virtual switched. You can do some tricks with bridging, but it is not great.
The solution I have used is to use Hyper-V checkpoint on my router VM. One set for DHCP and another with the static IP settings for my home network. Again not great but workable for me most of the time. I am happier editing the router VM rather than many guest VMs.