Setting up a CCNA Study Environment with GNS3 and VMware

If you were following my tweets over the last few days, you probably already know that I have been working on setting up a CCNA study environment using Ubuntu Linux, GNS3, and VMware Workstation. After a couple days of difficulties, I finally managed to make it work last night. Here are the steps that I took to make it work.

Before we start, there is the standard disclaimer: these are the steps that worked for me; these steps might or might not work for you, and are almost guaranteed not to work with different Linux distributions or different versions of the associated software.

Here are the software components and versions that I am using in my environment:

  • Ubuntu Linux 8.04.4 LTS, 32 bit
  • GNS3 0.6.1
  • Dynamips 0.2.8-RC2
  • Dynagen 0.10.1.090807
  • VMware Workstation 7.0.1 for Linux, 32 bit

I won’t go into great detail on setting up Ubuntu Linux as there are plenty of resources available for that portion of this environment. You will need to be at least vaguely familiar with the Linux command-line interface (CLI) and basic Linux commands, or you’ll find this process a bit difficult.

Once you have Ubuntu Linux installed and configured appropriately, the first step is to go ahead and install some dependencies using apt-get:

sudo apt-get install dynagen python-qt4

This should download and install both Dynagen and the Python-QT4 libraries. Next, you’ll need to download and install GNS3 0.6.1. There are newer versions of GNS3 available, but earlier attempts to get this environment running with the newer version of GNS3 resulted in problems. Again, your results might differ. Version 0.6.1 of GNS3 is available from the GNS3 SourceForge site.

Once you have GNS3 downloaded, extract it into the directory of your choice (I chose to use /opt/GNS3).

After you’ve downloaded and extracted GNS3, create the following directories under the directory where GNS3 is found:

<GNS3 directory>/project
<GNS3 directory>/ios
<GNS3 directory>/cache
<GNS3 directory>/tmp
<GNS3 directory>/dynamips

Use the chmod and chown commands as necessary to ensure that your user account has full read/write permissions all of these directories except the dynamips directory.

Download a copy of Dynamips (it’s generally available here), put it into the dynamips directory you created, and use the chmod command to make it executable. I also found it necessary to set the Dynamips binary’s SUID bit so that it would always run as root; I know this is not best practice but I could not find any other workaround. (Without setting it SUID, GNS3 would always report an error when trying to launch Dynamips.)

Now launch GNS3 and use the Preferences in the application to set the correct path to your project directory (<GNS3 directory>/project) and the IOS/PIX directory (<GNS3 directory>/ios), the correct path to the Dynamips binary (<GNS3 directory>/dynamips), the correct path to the working directory (<GNS3 directory>/tmp), and the working directory for capture files (set it to your project directory).

At this point you should have a working GNS3 installation. You’ll still need to locate IOS images to use; once you have valid IOS images, place them in the ios directory you created earlier and configure them within GNS3 as needed. You should then be able to create a router instance, boot it, and access the router console from within GNS3.

You could stop there and have a pretty cool environment, but I wanted to go a step further. I also installed VMware Workstation 7.0.1 (I won’t go into detail here, it’s a pretty simple process) and then used the Virtual Network Editor to create some additional host-only networks (in addition to the default vmnet1). Again, this is well-documented already, so I won’t discuss the process in any length. Where it gets interesting is in how you connect GNS3 and these host-only networks so that VMs can be incorporated into your GNS3 router topology.

Here’s how you connect GNS3 and the VMware Workstation host-only networks:

  1. In GNS3, add a cloud object to the topology.
  2. Right-click the cloud object and select Configure.
  3. On the NIO Ethernet tab in the Generic Ethernet NIO section, select one of the host-only networks (like vmnet1) and click Add. This creates a link between the cloud object and the selected host-only network.

At this point, you can attach a VM to the selected host-only network, attach a router to the cloud, and be able to pass traffic from the VM to the router. Pretty cool, huh?

What I’ve done so far is create a simple network with two VMs attached to two different host-only networks which are in turn connected to two different cloud objects and two different routers. Then I created a “serial WAN link” between the two routers (GNS3 won’t, as far as I can tell, actually simulate WAN links with bandwidth limits and latency) and configured everything so that I could pass traffic from one VM to the second VM across the “virtual WAN”. The plan is to increase the network complexity—as much as my poor little Dell laptop will allow given its limited CPU and RAM—and work through the various CCNA study guides in preparation for my exam.

One other quick note about this setup (and the reason why I chose Linux as my host platform): by setting up SSH on the Linux system (with a simple sudo apt-get install openssh-server), I can now SSH into the Linux host system and then use Telnet from there to access all the various routers. In addition, because I’m using OpenBSD as the guest OS on my VMs, I can also SSH from the Linux host to the OpenBSD VMs (assuming my GNS3 network is configured correctly). I’m also thinking that there’s a way I can leverage some VNC connectivity through Workstation to access the VMs as well, but I’ll need to research that a bit to see how it works.

I would be remiss if I did not point out a couple of sites that were extremely helpful in getting this setup up and running. First, this site provided an excellent overview of the GNS3 installation on Ubuntu. Although the walk-through was for a newer version of Ubuntu, the instructions worked perfectly on 8.04.4 LTS. Second, this site gave me the “missing link” on how to connect GNS3 and VMware Workstation’s host-only networks so that you could mix the two environments. Thank you to both sites for outstanding information!

If you are a GNS3 expert or have some additional tips or tricks to share, please add them in the comments below so that all readers can benefit. Courteous comments are always welcome.

Tags: , , , , , , ,

  1. phocean’s avatar

    Hi Scott,

    I wrote an article a while ago if you want to connect the lab to the outside (and also to Vmware in bridge mode) :
    http://www.phocean.net/2009/03/01/connecting-your-gns3-labs-to-the-real-network.html

    And a little tip on how to use Gnome terminal instead of xterm :
    http://www.phocean.net/2009/10/01/use-gnome-terminal-with-gns3.html

    For Konsole, it would be :
    /usr/bin/konsole –new-tab -p %d -e telnet %h %p >/dev/null 2>&1 &

    Regards.

  2. Simon  Long’s avatar

    Hey Scott, this is great!! I’m about to start cramming for my CCNA exam and this is ideal. Thank you soo much for sharing your setup.

    Best of luck with your studies and it was great to finally meet you at the TechFieldDay.

    Simon

  3. slowe’s avatar

    Phocean,

    Thanks for sharing your links. One of the linked articles I mentioned in my post had instructions for using GNOME Terminal, so I didn’t include that info in my post. Thanks for sharing your link as well.

    I’m also thinking that we could easily use VMware Workstation’s NAT or bridged mode (with certain configurations) to connect to the outside network as well; I will most likely test that over the course of my studying.

    Thanks for your comment!

  4. igor’s avatar

    Hi Scott,

    Probably this is a an analogy taken too far, but it just struck me: we have a similar breakthrough with teaching of networking/sysadmin now as we had with programming in 1980s. Instead of limited time on a mainframe/network lab with real hardware, you have unlimited time on your own hardware and freedom to tinker in any way you like. Which probably mean I shoud make the same setup as you did and start playing, otherwise some kid will get my job.

    Just one question, any specific reason to use Ubuntu 8.04? Two years is like millenia in Ubuntu, maybe that’s why you couldn’t run a newer version of GNS3.

  5. Chris Cowley’s avatar

    Scott

    GNS3 is in the repos. All yiou have to do is enable multiverse and run “sudo apt-get install gns3″

  6. slowe’s avatar

    Chris,

    Hmmm….I thought I tried that and it didn’t work. Of course, I ran into so many problems with this setup it’s not even funny. In any event, it’s working now so I should be fine. Thanks for the tip, though!

  7. slowe’s avatar

    Igor,

    I chose to use Ubuntu 8.04 LTS because 9.10 didn’t support the wireless network card or the video adapter in this Dell laptop I’m using for this project. Ubuntu 8.04 LTS supports them just fine.

  8. Andrew’s avatar

    How much RAM do you need on the host?

  9. slowe’s avatar

    Andrew,

    I only have 4GB of RAM on this laptop, which so far has been sufficient. Obviously, the more RAM you have the better off you’ll be.

  10. solgae’s avatar

    “only” 4gb?….hmm, not much to play with it indeed ;)

    this should work great to work on my CCNA that I’ve been delaying for years. Thanks for the tip!

  11. Jeremy L. Gaddis’s avatar

    Sounds like your all set, Scott, but I thought I’d mention a couple things real quick.

    If you’re on a 64-bit host, I think you’ll find the performance and stability is greater when running a 64-bit OS and 64-bit builds of Dynamips, Dynagen, and GNS3. (Myself, I prefer to do without GNS3 but to each his own.)

    Also, if you have multiple CPUs (or multiple cores), you may want to run multiple hypervisors (I’m not sure exactly how to do this in GNS3 since I avoid it, but I’m sure you can Google if necessary). This may not have much difference if you’re only running a couple virtual routers, but when you start running many at once there’s a noticeable performance increase.

    Last, the idlepc values are key, but you’ve probably noticed that already. =)

    Good luck working towards the CCNA!

  12. slowe’s avatar

    Jeremy,

    Forgive me for asking this without first searching, but do you have any good resources for running Dynagen and Dynamips without GNS3? I’ve actually considered it (GNS3 seems unstable at times), so any resources you might be able to send my direction would be great. Thanks for the tips!

  13. Jeremy L. Gaddis’s avatar

    Scott,

    The instability of GNS3 is mostly why I avoid it. I much prefer to just use dynamips and dynagen. Performance, by the way, is much better on Linux than on Windows so you made a good choice of OS. =)

    I mostly figured it out via trial and error, but it’s not that difficult if you’re comfortable with the command-line on a Linux box.

    On Ubuntu, you can quickly install both Dynamips and Dynagen with “apt-get install dynamips dynagen”, but presumably you already have them installed.

    You can start dynamips in hypervisor mode manually with “dynamips -H ” (typically 7200). The configuration (.net) files needed by dynagen are plain-text and you can compose them by hand, though the syntax takes a bit to get accustomed to. A sample one that I made is at http://bit.ly/a5pRaj.

    The dynagen tutorial (http://dynagen.org/tutorial.htm) is a great resource and answers many of the most common questions.

    Once you have a .net file, just run dynagen passing it the filename (e.g., “dynagen myfile.net”). You can then start and stop your virtual routers at will. In your .net file, you’ll specify a port number to the “console =” option. In the above .net file, for example, R1 has “console = 2000″. Once you’ve started up R1, just open a telnet session to the IP address of your Ubuntu box on port 2000. You’ll then be connected to the “console” of R1.

    Hope this helps!

  14. phocean’s avatar

    @Jeremy:
    I have been using GNS for almost 2 years and didn’t have any stability issue (on Linux).
    Even though I am most of the time a command line guy, I really apreciate GNS3 when it comes to design and simulate large network architecture.
    With 2 or 3 router, you may be ok with dynagen only, but when you wan’t to have more than that, you will be happy with a network diagram.

    So thank you, GNS3 guys, keep up the good work.

  15. fii’s avatar

    Try blindhog.net

  16. Dave’s avatar

    GNS3 is really good for CCNA preparations. I have 2Gb RAM on my laptop. That was enought to all my CCNA labs. All labs was from Cisco Exploration.

Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>