How do you route between Virtual Networks?

A recent question on this topic returned a series of different responses. The problem with this question is the old consulting response, "it depends".  It depends on your requirements, your available resources, and how much time do you have.

Unfortunately Virtual Server does not provide a built in router functionality so you must find another solution....I present four options.

1) The quick and dirty solution....the default gateway.

The default gateway is a router that forwards traffic to remote subnets on behalf of a host. Well it is supposed to be specified as a remote router, but if all you want to do is have routing like capability, but you really do not need packets to be routed in the traditional sense, you can set your default gateway to your own IP address and you will route your own packets. Well, what you will actually do is think that every other subnet is directly connected to your adapter and you will route all packets blindly to the subnet you are connected.

For example, if you have three machine that you need to have on separate subnets, you can use three different IP address ranges on the same virtual network.

Virtual Machine A  -  IP address =, subnet mask =, Gateway address =

Virtual Machine B  -  IP address =, subnet mask =, Gateway address =

Virtual Machine C  -  IP address =, subnet mask =, Gateway address =

When virtual machine A, B, or C attempts to send a packet to a different subnet, it sends it to default gateway (itself), and it forwards it to the default route of Each of the other virtual machines will accept the packet and inspect it to determine if it should route it to the subnet it knows about.

So the good thing is that you can trick the machines into thinking they are on separate subnets when they are not.  The bad thing is that they will forward every packet blindly regardless if there is a valid subnet. There is also additional overhead because each virtual machine will inspect every packet on the network.

2) Build a virtual machine as a router

You can do this in different ways: Windows Server and RRAS, Windows Server and ISA server, or maybe a LINUX boot disk with just router functionality.  Regardless of which way you go, you are limited to routing between four subnets in a Virtual Server virtual machine. You can get past this issue by creating multiple router virtual machines and cascade them, but you will only get three additional routes for each virtual machine added since one interface will be used for cascading purposes.

This approach has impacts to the number of virtual machines you can run based on the availability of resources on your host.

3) Have the host act as the router

You can install RRAS on the host machine and use multiple physical or loopback adapters to create as many routed subnets as you require. This places performance impacts on the host, but scales better than using multiple VM routers.

4) Use an external router

If you need maximum performance or need to test router specific functions not provided by RRAS or other software routing solutions, then you will need an external hardware router.  This requires as many network adapters as routed subnets in the host and could pose a limitation on scale. You can address this issue with multiple ports network adapters to maximize the scalability.

So if you just need a quick way to trick some VMs into thinking they are on multiple subnets, use the default gateway trick.  If you need multiple subnets but 4 or less, then use the virtual machine router approach.  If you need more than 4 subnets, then you should use the host based router approach if performance it not the goal.  If performance or specific router functions are required, then go with the external router approach with multiple network adapters in the host.

Hope this helps you understand your routing options and which one might best meet your requirements.  If you have an alternative approach I would love to hear about it.

Comments (5)

  1. Anonymous says:

    Robert Larson, a fellow Microsoft Consulting Services colleague and co-author of the upcoming Virtual

  2. Anonymous says:


    Don’t forget that you’re not limited to physical adaptors on the host, as long as the host has support for VLANS, and is connected to a VLAN capable switch/router.

    I’ve used this method in building several test lab environments for clients.

    Depending on the NICs that you use, you can also team multiple ones together to give you increased bandwidth.

    I’m looking forward to the ability to hot add network interfaces in the next version of Virtual Server

  3. virtualgoods says:

    Sorry I overlooked this comment.

    VLANs are not officailly supported although you can get them to work depending on the NIC you use. The VLAN association has to be done after the packet is formed because the VM NIC driver has no knowledge of the VLAN and the host has to perform the VLAN association.

    Same goes for Teaming, not supported by Microsoft, but have heard some get it to work based on NIC mfgr.

    The next Virtualization software released from Microsoft will be for Windows 2008 and will be a completely different architecture. It is called Windows Server Virtualization (codename Viridian) and will ship within 180 days of Windows 2008.

    Unfortuntately Microsoft announced that hotadd of NICs has be delayed until a later release.

  4. Anonymous says:

    Robert Larson , co-author of the Virtual Server 2005 R2 Resource Kit, has joined the blogosphere. Gate

  5. jorje says: can be used for wired scanning for windows xp.

Skip to main content