GNS3 and VirtualBox Integration Under OS X - Part 3

Get it from www.bitsontheline.com, give my highest respect to the author.
=======

GNS3 and VirtualBox Integration Under OS X - Part 3

In Part 1 we setup our virtual network and configured tap interfaces for use by VirtualBox and for bridging to our physical network, inPart 2 we configured the router and gave it Internet access using the IP firewall built into OS X. In Part 3 we are going to set up our virtual clients using VirtualBox and bridge them with the tap interfaces connected to our virtual network. Lets get started.

Our network diagram shows 2 virtual clients, one connected to each network segment:

GNS3

For some diversity I’m using XP and Ubuntu virtual machines, but both could be the same if you prefer. I’m not going to cover the creation of a virtual machine using VirtualBox as it’s quite self explanatory and there are plenty of tutorials already out there. This tutorial will therefore assume you have created your virtual machines and have an OS installed.

By default, VirtualBox will not allow you to bridge a virtual network card to a tap interface, however we can add a tap interface to the list of available interfaces using the following command:
MacBook:~ Matt$ VBoxManage modifyvm Windows -nic1 hostif -hostifdev1 ‘tap1: ethernet’
Lets look at this command in more detail. ‘Windows’ refers to the name of the virtual machine being altered, in my case a Windows XP machine called ‘Windows’. ‘tap1..’ refers to the name of the tap interface that is connected to a virtual network segment, in our case tap1 connects to the 172.16.10.0 /24 segment. If you receive an error message check the name of the virtual machine is correct and ensure you are not executing the command as root.

Back in VirtualBox and in the virtual machines settings, we now have an option to attach to a tap interface:

VirtualBox

We now need to give our virtual client an IP address in the network it is attached to, in this example the 172.16.10.0 /24 netnwork. There are two devices in this network already: 172.16.10.1 is in use by our Routers’ e1/0 interface, while 172.16.10.2 is in use by our tap1 interface. Lets give are VirtualBox machine the following IP details:

IP Address: 172.16.10.3 /24
Default Gateway: 172.16.10.1
DNS: 172.16.10.1

Lets test these settings with a couple of pings from the virtual client, first the default gateway:
C:\Documents and Settings\Administrator>ping 172.16.10.1
Pinging 172.16.10.1 with 32 bytes of data:
Reply from 172.16.10.1: bytes=32 time=28ms TTL=255
Reply from 172.16.10.1: bytes=32 time<1ms TTL=255
Reply from 172.16.10.1: bytes=32 time=8ms TTL=255
Reply from 172.16.10.1: bytes=32 time=5ms TTL=255
What about Google?
C:\Documents and Settings\Administrator>ping www.google.com
Pinging www.l.google.com [209.85.229.104] with 32 bytes of data:
Reply from 209.85.229.104: bytes=32 time=106ms TTL=242
Reply from 209.85.229.104: bytes=32 time=118ms TTL=242
Reply from 209.85.229.104: bytes=32 time=110ms TTL=242
Reply from 209.85.229.104: bytes=32 time=108ms TTL=242
Excellent job done.

Well this is the last part of this tutorial and I hope it has shed some light on what can be achieved with OS X and GNS3. Six months ago when I first began looking at GNS3 and the concepts covered in this tutorial there were very few resources out there which made achieving the functionality that most Windows users were enjoying very frustrating. I hope this tutorial helps to promote OS X as a viable platform for network professionals and those considering changing to a Mac but are concerned about its technical ability. Rest assured, it’s more than capable!

Bonus Material
Configuring Tap interfaces and the OS X firewall can be a bit of a pain after rebuilding a lab or rebooting your Mac, therefore I use a script to reconfigure the interfaces and the Firewall for the setup I need. I’ve attached a Bash script that configures the tap interfaces based on the lab in this tutorial, it’s very simple and can be run using ./Auto.sh

Tap Interface and OS X Firewall Auto Setup

One Response to “GNS3 and VirtualBox Integration Under OS X - Part 3”

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章