Virtual Networking with VirtualBox

Quick Start (Windows only)

Want to get started with virtnet without reading about it? Follow these steps if your host computer is running Windows.

  1. Download the base virtual machine (450MB), and extract/unzip it. Also download the Windows command scripts: vn-topology01.cmd | vn-topology03.cmd | vn-topology05.cmd | vn-topology07.cmd
  2. Open VirtualBox, and from the "Machine" menu select "Add...". Then browse to the folder of the extracted ZIP and select base.vbox. This should create a virtual machine in VirtualBox called base. Do NOT start the base VM.
    Add base machine to VirtualBox
  3. Double-click on a topology file (e.g. vn-topology05.cmd) and follow the instructions to setup the topology. In short for each node you need to:
    1. Start the node in VirtualBox
    2. Login to the node using username network and password network
    3. Type and run the command:
      sudo bash virtnet/bin/vn-deploynode x y
      where x is the topology number (1, 3, 5 or 7) and y is the node number (1, 2, 3, ...).
    4. Reboot the node with the command:
      sudo reboot

    The screenshot below is an example for topology 5, which has 3 nodes:
    Configure topology 5

Once all of the nodes have been started, deployed and rebooted, you can start using them.

If you have problems or do not understand the steps, see a video demonstration (17 min).

Using the Virtual Network

The following videos/instructions will help you get started in using virtnet.

Introduction to virtnet

I am using VirtualBox to create multiple virtual machines running Ubuntu Linux, then configuring them to create a virtual network. This virtual network is then used for testing and demonstrating basic networking and security concepts and technologies. To simplify and speed up the process, a single base virtual machine is created in VirtualBox, and then scripts are used to automatically clone the base to the necessary number of nodes and configure those nodes (e.g. IP addresses, names). Several pre-defined network topologies have been created so you can easily build a virtual network.

virtnet refers to the collection of scripts to setup the nodes to create a desired topology. There are two variants of the scripts:

  1. Generic Bash shell scripts that work on Linux, OSX and Windows hosts (using Cygwin).
  2. Windows command scripts that are simplified to easily run on Windows 7, 8 or 10.

The generic Bash scripts are more complete and allow for 20+ different topologies. However they require installation of software in advance, especially on Windows hosts. Due to this and teaching requirements (e.g. labs that do not allow software installation) the Windows command scripts were created. Currently they only support 4 topologies.

Windows Hosts only

See the quick start guide.

Linux, OSX and Windows Hosts

Some articles, notes and code for setting up a virtual network with VirtualBox using the generic Bash shell scripts.

Installing virtnet

Getting started with virtnet. The first link is the main set of instructions for installing and setting up a virtual network.

Accessing and Configuring virtnet Nodes

Make your life easier when using virtnet ...

Examples of Using virtnet

Several cases where I have used virtnet to demonstrate networking and security concepts. Also see my list of Linux articles.

virtnet Code and Resources

Download the scripts, base image and view the topologies available.

Other Articles

Some of these articles may be out-of-date or no longer relevant. It is best to try the instructions in the above links first.