In a previous post I showed you how to create a routable test environment using Windows Server 2008R2 and RRAS, since that post I have upgraded my laptop to Windows 8 to take advantage of the built in Hyper-V feature so I didn’t have to dual boot my system. This got me thinking about how I could setup a routable network on Windows 8 now that I didn’t have RRAS. I came across a piece of software called Vyatta which enables you to create virtual switches/routers to do this. This guide will show you how to setup a simple routable network on Windows 8 with Hyper-V and a Vyatta switch.First you will need to download the latest release of Vyatta from here, in my case I downloaded the 64bit version.
Next you will need to create a new virtual machine within Hyper-V, one of the cool things about this software is that it isn’t resource hungry, the virtual machine I created has two virtual processors, 512mb ram and a 10GB vhd file and even then this is over what is required. In addition to this, you will also need to create the virtual networks within Hyper-V. For my environment I have the following internal networks:
vNet Servers Site 1 – 10.10.0.x/24
vNet Servers Site 2 – 10.20.0.x/24
vNet Clients Site 1 – 10.10.30.x/24
vNet Clients Site 2 – 10.20.30.x/24
Depending on how many virtual networks you have configured within Hyper-V, you will now have additional network cards present on the host machine in the network and sharing center. These should have their IP address configured with an IP address from the corresponding subnet. This address will then be the default gateway address that you will set on your virtual machines. In my case I have set them as follows:
vNet Servers Site 1 – 10.10.0.254/24
vNet Servers Site 2 – 10.20.0.254/24
vNet Clients Site 1 – 10.10.30.254/24
vNet Clients Site 2 – 10.20.30.254/24
Once you have your Hyper-V machine setup and the virtual networks configured, you need to boot from the downloaded ISO file. When prompted to login, the default username and password is vyatta in lowercase.
- At the command prompt type Install system
- When prompted type Y and press enter
- At the prompt to configure the partitions, type A and press enter to auto configure the partitions
- Enter SDA to install the image and press enter
- Enter Y when prompted to confirm the installation and press enter
- Press enter to accept the default partition size option
- Press enter to copy the config.boot
- Configure the password for the administrator account
- When prompted to confirm which drive GRUB should modify, press enter and this will complete the installation
Configure the router
Now that the router is setup, the next step is to configure each of the interfaces.
- At the username prompt enter vyatta and then the password you set during the setup process
- Type configure to enter configuration mode
- At the command prompt type set interfaces Ethernet eth0 address 10.10.0.254/24 and press enter
- Repeat this for each of the interfaces you need to configure
- Type commit to commit the changes
- Type save to save the configuration
- Type exit to exit configuration mode
At the command type ping 10.10.0.254 (substitute your address here), assuming that you have configured your router correctly you should get a response back.
The final step is to configure the default gateway on each of your virtual machines and you should then be able to route between your networks. As a simple test try pinging a machine in another subnet.
This is guide shows you how to configure a simple router for use in lab environment, Vyatta allows you to do much more than that and more information can be found in the documentation available from here.