Friday, September 11, 2015

Create a virtual router (DD-WRT) in VirtualBox

Okay, this is a pretty long post, but hopefully it captures what you need to create a virtual router in VirtualBox.  Some of the websites I have linked here make it seem so simple, but there is a little more to it and I have tried to capture what you need here.  I also included the links I used so you can refer to them if you run into any challenges.

Download dd-wrt for x86 platform and prepare the image/disk file:

Download the dd-wrt file.  The file can be down loaded from this site. http://www.dd-wrt.com/site/support/router-database Type ‘x86’ in the search box.  Select x86 and then the link labeled ‘DD-WRT X86 Public Vga: Console image’.

Convert the image file to a VM disk by executing the following command in the command prompt window.

cmd> "C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" convertdd dd-wrt_public_vga.image dd-wrt.vmdk

Resized the disk. http://www.dd-wrt.com/phpBB2/viewtopic.php?t=76456  Otherwise it will be stuck at 10MB and may not save your settings.

cmd> "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd --resize 1024 "dd-wrt-x86.vmdk"

Some forums suggest the image needs to be natively installed to the VM.   http://www.dd-wrt.com/phpBB2/viewtopic.php?t=81836

Create a new virtual machine in VirtualBox:

Set the following specifications.

Operating System: Linux
Version: Other Linux (32-bit)
Storage: Choose existing disk: dd-wrt.vmdk
Audio: Clear the checkbox ‘Enable Audio’
Network>Adapter 1: Select PCnet-FAST III as the Adapter Type (under Advanced)

Depending on your desired network configuration, select the appropriate ‘Attached to:’.  I want to create a connection with my home network so I selected ‘Bridged Adapter’ and my computer’s WiFi adapter (which is how my computer connects to my home network).

Network>Adapter 2: Enable the adapter and again select PCnet-FAST III as the Adapter Type.  Select internal network.

I had trouble with the default Intel PRO/1000 MT Desktop where eth0 and eth1 were not being recognized.  The posting from JimmyPage on this thread http://www.dd-wrt.com/phpBB2/viewtopic.php?p=690980 was helpful.

Configure the virtual router:

Turn on DD-WRT VM when the text stops hit enter and log in. 
User: root
Password: admin

At the command prompt enter ‘ifconfig br0 192.168.2.1’ to change the IP address to avoid conflicts with your physical network (assuming it is on 192.168.1.X, which mine was).

Using a separate VM computer, set the network adapter to 'Internal Network'. Turn on the VM computer.  Manually set the IP address to 192.168.2.2. Open a browser in the VM computer and enter 192.168.2.1 to access the DD-WRT webGUI.  Change the username and password and login.  Go to the ‘Setup’ tab and update the following fields (use values appropriate for your network).

WAN Setup
Connection Type: Static IP
WAN IP Address 192.168.1.3
Subnet Mask 255.255.255.0
Gateway 192.168.1.1
DNS 192.168.1.1

Network Setup
Local IP Address 192.168.2.1
Subnet Mask 255.255.255.0

I left the rest of the values on the setup tab as the default.  Click 'Save', then click 'Apply Settings'.  The router should now handout IP addresses to your VMs. Change the settings on the separate VM computer to automatically receive an IP via DHCP. 


The following are additional links I referenced.

This youtube video is pretty helpful and walks through similar steps to those above.

The following links provide an overview of the steps.




2 comments:

  1. DD-WRT was originally designed for the Linksys WRT54G series, but now runs on a variety of routers. DD-WRT is a Linux-based firmware for wireless routers and access points. Originally designed for the Linksys WRT54G series, it now runs on a wide variety of models. best dd-wrt router

    ReplyDelete
  2. How do you choose the best choose the best product among the ones listed here? Click here

    ReplyDelete