GNS3 lab with VirtualBox

02/03/2010

Windows7\XP

Goal to achieve:

Make connectivity between two workstations in different networks. Emulated environment include:
Cisco 3600 Router, Windows Server 2003, Windows XP.

In this tutorial I will explain how to setup a network with emulated virtual PC`s using GNS and VirtualBOX.
Although the entire configuration of GNS and VirtualBOX is out of scope of this tutorial I will briefly go through the major points.

My topology is going to look like this:

Let`s start…
So the steps are next:

1. Configure VirtualBOX settings
2. Configuring GNS3 settings
3. Test connectivity

Configure VirtualBOX settings

After installing VBOX emulate 2 PC`s. I will use Windows Server 2003 and Windows XP.
To do it select NEW button from the toolbar and go through the wizard to install the required OS. You will need the images of the operation systems.

virtualbox toolbar menu

Before the emulated OS is started chose the platform from the list and click the SETTINGS button from the toolbar. Settings window will be opened. Choice Network and set the configurations as it shown in the next picture.

Do it in both emulated stations.

Configuring GNS3 settings

You will need the Cisco IOS image, it is not (and will not be) provided by GNS.

Open a new project in GNS3 and save it to your default working directory. By the way, here is a tip to make GNS working: Make sure that the path to your working directory is set in properties of Dynampis settings (Ctr+Shift+P). The folder should be created by you; otherwise the Dynampis will fail to start.

Drag and drop a Cloud from the list to the working desk. (You can configure an PC icon to have the cloud characteristic by adjusting it in Symbol Manager under the Edit menu)

Double click on your cloud and go to NIO Ethernet tab. Here are all of your installed adapters listed. Choice the VirtualBox Host-Only Network and click the Add button. Click OK. Rename the cloud by right clicking on it and selecting Change the hostname. Rename it to XP.

Do it twice , the second cloud rename to Server2003.

Emulating cisco router

I will use Cisco 3600 Router.
Drag and drop one to the working desk.
Double click on it and add, in Slots tab, two Fast Ethernet interfaces.
Click OK , then right click on your router icon and select Start

Now go to Console of the router, by right clicking on its icon and selecting Console from the drop down menu. Configure the interfaces. One with 192.168.56.254 /24 and the other with 172.30.30.254 /24

Now you have two different networks.
Add a Manual links (as shown in the next picture) between the router interfaces and the clouds.

Start your virtual machines. After each one started configure their IP addresses:

In 192.168.56.0/24 network with IP 192.168.56.1, mask 255.255.255.0, default getaway 192.168.56.254
In 172.30.30.0/24 network with IP 172.30.30.1, mask 255.255.255.0, default getaway 172.30.30.254

Test connectivity

Test your connectivity by pinging the default getaway and the other machine from each PC.
Now you can configure VTC access to your router and telnet it from the machines, or test the ACLs and etc…

That’s all, hope it will help in your learning.

Advertisement

18 Responses to “GNS3 lab with VirtualBox”

  1. Hari said

    Hi Altbiz

    It’s worked but , Hmm

    Upto Router Ip addressing it was ok . but when I try to give ip to my ubuntu host residing on virtual box . I give the ip address but I can’t ping the default gateway of the router.

    Okay
    Ohh .. My topology is like this

    windows xp -Virual Box[Ubuntu]
    Gns3
    ———————————–:)
    then I come to windows xp – Network Connections-> VirtualBox Host-Only Ethernet Adapter –

    Here I given the same subnet masked Ip and default gateway as router interface .
    then it is worked. no packet loss in pinging .but here I have only one host that is Ubuntu. I am thinking seriously now . What will happen If I am installing Multiple hosts in Virtual Box.

    Can it possible to get different Network in Virtual Host
    ?
    thanks and cheers

    • altbiz said

      Hey,

      I have a lab with WinXP , WinServer , and Linux. I also think that Linux is in a different network (or subnet). I will get back home and check it for you.

  2. iivo said

    Very nice tutorial, I have tried something similar:
    Running OS – WinXP, and GNS3 installed
    2 VirtualBox hosts, Ubuntu 9.10.
    When configuring both of them with the “host only” setting, in GNS3 (the cloud configuration) i can see only one VirtualBox host-only adapter. for both clouds.
    And second, even without GNS3, the VM-s can ping each other. this I do not want, because I need them to communicate through GNS3.

    If you have any idea, please contact me.
    thank you in advance

  3. altbiz said

    es I have an idea, and I will try to explain it using my poor English :)

    First you should not be able to ping one host from another without GNS3 network , you right , this is the point.
    If u like to do this you should choice “Internal Network” instead of “Host-only Adapter” in workstation configurations of VirtualBox ( if I remember right).

    Now about the clouds.What I figured out later , after writing this howto is next:

    Actually it is ok that u can see only one “VBox hots-only adapter” in GNS3. What is means that all hosts come from this interface , and it is doesn’t matter how many clouds
    you will configure with this interface they(clouds) will all be the same. Think about it as an internet connection , it like many access points (clouds) to the same internet within which your hosts are located.

    Try to connect this two clouds to a switch and watch its MAC address table going crazy. For Switch its like multiple connections to the same point and every time the signal will come
    to another interface of the switch.

    What it means that u can use only one cloud to connect all emulated workstations to a virtual network :)
    How to separate them? I didn’t even tried yet. :)

    I hope it was clear.

  4. Amit said

    Hello,

    Which version of Virtual Box and GNS did you use? I have Virtual Box 2.1.4 and GNS3 0.7.2. When I am trying to configure the network adaptor in Virtual Box – “Attached To”, it is not displaying “Host-only Adaptor”. Instead, it has to show 4 options:

    1.) Not Attached.
    2.) NAT.
    3.) Host Interface.
    4.) Internal Network.

    And I am able to type in “Network Name” only when I select “Internal Network”. Even by doing so, I am not able to find anything in “Generic Ethernet NIO” in GNS3. Please suggest what can be done.

  5. anon said

    Worst tutorial ever…

  6. I conceive you have remarked some very interesting points , thankyou for the post.

  7. Tyler West said

    If you want any other device, such as a Cisco router or another virtual guest, to provide DHCP to your VirtualBox adapter then you will need to disable the default DHCP server that VirtualBox turns on with the host-only network. It would be nice to see that listed as an option in your tutorial.

    While the VirtualBox guest is on type in

    VBoxManage list dhcpservers

    on the host OS. The common server listed is HostInterfaceNetworking-vboxnet0. Then type the following:

    VBoxManage dhcpserver remove –netname HostInterfaceNetworking-vboxnet0

    That should disable it and allow other systems on the network to provide DHCP without being overridden by VirtualBox.

    I find it humorous and distressing that “anon” would make such an non-constructive comment and not even have the dignity of leaving their name. Wallow in cowardice. Thankfully you’re not even one of us.

  8. razur said

    Hi, I have a problem.
    I’m connecting two routers via serial connection in gns3, then each router has a fasteth connection to a VM in virtualbox, everything works just fine, I’m able to ping from any device to any device.
    The problem is when I try to telnet from VM in one router to the other router, the serial connection betwen the routers goes down.
    If I remplace the VM with another router, it can telnet without any problem, but then trying with a VM the serial connection goes down again.
    The VMs are damn small linux (I have tried WinXP and Fedora with the same results), my machine is Windows 7 64bits, and I have just configured routing on the routes (no ACL, no QoS, etc), doesn’t matter if I use RIP, OSPF, etc, I have the same error.
    What could be the problem?

    • altbiz said

      Hello,

      I suggest to try find answer to this on gns3 or VirtualBox forums. This may be some kind of bug, may be I am wrong, better try to ask professionals (Forums of VM and GNS3)

      Regards,

  9. abhi said

    With similar setup,I am not able to browse the internet from virtual PC but can ping public IPs.

  10. abhi said

    ok..can you suggest any solution as I have tried but working.

  11. keep up the fantastic work , I read few articles on this internet site and I think that your website is rattling interesting and contains sets of fantastic information.

  12. Alex said

    Hello,I have a problem too, in the GNS3 it can not find the two vitualbox intfaces,why?

  13. the following GNS3 lab with VirtualBox Networking seems to have set aside me when I say a lot of time in searching for a solid nice read

  14. hermann said

    hello, i used gns3 virtualbox for learn computer network, i create 2 computer, i generate tcp traffic tcp port 8080 10 Mbps with lantraffic to computer 2, i have problem lan traffic cant generate 10 Mbps, lantraffic generate 30 Mbps only, why?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.