This chapter gets you through the first hurdles you will strike in your quest to have a Graphical Network Simulator (GNS3) running on your computer, and it comes in three parts: pre-installation tasks and prerequisites, the installation process, and the post installation tasks required to build your first simulation. During the process, you will gain an appreciation of the other applications and pieces of software that all contribute to make GNS3 work. I will explain the reasoning behind the multiple steps you need to take to install GNS3 successfully and finish the chapter with you well-prepared to build your first simulation emulating Cisco routers.
The following topics will be covered in this chapter:
Pre-installation tasks and prerequisites:
Router image files
The installation process:
Installing on Windows
Installing on OS X
Installing on Linux Mint
Post installation tasks
By the end of this chapter you should have GNS3 running on your computer ready to create your first network simulation.
The first prerequisite is that the installer realizes that GNS3 is not a normal application! It is a collection of inter-working applications and hosted operating systems, each with their own memory and CPU demands. You are not going to get GNS3 installed and running as quickly as you might some other standalone application.
But you probably already know that – I'm guessing that you are reading this book because you have at least already installed, or attempted to install GNS3, and struck a point at which you realize you need to know more. To address this, I will start with some essential knowledge that will help you see the bigger picture. If you are new to GNS3 or new to network simulation concepts, you would do well to read the http://gns3.net/ home page before you continue.
GNS3 can be thought of as a meeting place for a variety of operating system emulators. The best known and most important of these is Dynamips. Dynamips allows you to emulate Cisco routers and provides a collection of generic devices and interfaces.
Every instance of a router or any other device you run is going to spawn a copy of its own operating system that will compete for your host computer's RAM and CPU cycles. You will be running multiple computers within your computer, so remember that as your computer's CPU heats up and your fans begin to whirr more loudly.
Now consider that devices like routers and firewalls require some kind of terminal application to give you access, so meet the next member of the GNS3 extended family, your terminal application. Depending on your operating system, your terminal application might be Gnome Terminal, iTerm2, Konsole, PuTTY, SecureCRT, SuperPutty, TeraTerm, Windows Telnet client, or even Xterm.
No matter which terminal application you choose, it will consume some more resources for every session you have opened, although it is minimal.
Finally, there are two more companion applications that are not essential, but often used in conjunction with GNS3. These applications are as follows:
And of course, these too need CPU and RAM when you use them.
So before you start thinking about running GNS3 on your computer, you had better make sure that it is up to the job, but that will largely depend on how many devices you plan to include in your simulations, how much memory you allocate to these devices, and how well you are able to "tune" the Idle-PC value (discussed in Chapter 2, Creating your First GNS3 Simulation).
I'll cut to the chase. You need as much memory as you can afford. I wouldn't want to run GNS3 on less than 2GB RAM and I'd buy 16GB or more if I could afford it. And router emulation can be CPU intensive. Quad core CPU would be awesome, but a Pentium IV could get you started. Multi-core CPUs are especially useful if you intend to use Qemu or VirtualBox emulators.
That said, if you want to be more precise, you should be able to calculate how much of your RAM is being consumed by your Operating System itself, with as few other programs as possible running, then add the amount of RAM that GNS and the associated programs consume, and finally add the amount of RAM you will allocate to your devices.
The most important pre-installation task for GNS3 is to have a router image file ready. This is often the task that causes people to give up on GNS3 before they get started, but it is necessary because Dynamips (or Qemu or VirtualBox) is nothing more than an emulator, and it is going to need an operating system image to emulate!
For example, if you plan to emulate Cisco 3725 router, your image file might be called
Note: Obtaining the appropriate image files for your router is your responsibility. It may be necessary to buy a piece of the hardware you wish to emulate and copy the image files from the hardware you own.
Whatever your image file(s) are, prepare for your installation by copying your image files to the appropriate locations as listed below. You will need to create the
Images directories as you go.
Location for the image files
OS X or Linux
If you have a maintenance contract with Cisco, you can download router images for your router from the Cisco Software Centre. If you have an ASA device, you will probably find copies of the software on the accompanying CD, or again you can obtain software for devices from Cisco, provided you bought a maintenance contract.
For Cisco routers I recommend using Cisco 7200 or 3725 router images. Most of the examples in this book will use the Cisco 3725 router because it requires no configuration to get started. For serious simulations, I would recommend using 7200 routers because the 7200 is the model for which Dynamips was designed, and this router also supports Cisco IOS (Internet Operating System) Version 15.
The story is similar for Junos – the operating system for Juniper routers. You can find the Junos software easily on the Juniper website, but you'll need to use your customer login to download the software.
Downloading Vyatta router images is much easier because Vyatta is an open source project. You can download both Qemu and Virtual Box based Vyatta router images directly from the GNS3 sourceforge.net download page:
http://sourceforge.net/projects/gns-3/files/ - look in the Qemu Appliances or VirtualBox Appliances directories. However, getting a Vyatta router working is much more complicated than the Cisco routers discussed here. Deploying Vyatta routers is discussed in Chapter 4, Unleashing Other Emulators.
Now, if you have one or more router images in your
Images directory as described previously, you are ready to install GNS3. The following examples will assume you have a Cisco 3725 router image in your
Depending on your operating system and which features you want to use, you may need to download more than a single application to get GNS3 running. However, there is no better place to start than at the GNS3 website: http://www.gns3.net/download/.
The installation process is vastly different for each operating system. If you are running a version of Windows, the only installation package you need is the all-in-one package – although getting it installed and running may require a little more work. For OS X and Linux users, your tasks are going to be much more detailed.
Download and install the all-in-one package from http://www.gns3.net/download/. During the installation process you will get the chance to choose the packages you wish to install.
I recommend that you choose to install SuperPutty during the installation. It will then become your default console application, otherwise PuTTY will be your default console application. However, be warned that SuperPutty will download and install the .NET framework the first time it runs (it is huge and takes a long time) and requires a restart as well.
During the installation you will need to confirm any Windows UAC challenges or license agreements you may be confronted with, and in the case of Windows 8 you may even be presented with a compatibility issue when WinPcap is installed. If so, simply choose to Run the program without getting help.
Once the installation is complete, go ahead and begin the Post-installation tasks in this chapter.
There is no all-in-one package for OS X, so you have to find the bits you need and install them one at a time. Here is what you will need to download in addition to GNS3. Use the latest version, and for the installation process, I will assume that the following applications have been downloaded.
Step 1: Install XQuartz X11
With OS X, it is best to install Wireshark before GNS3, but Wireshark uses an X11 display, so first you have to install X11. XQuartz is the X11 version created by the XQuartz community project created by Apple.
When your XQuartz installation is completed, you will have to log out and log in again. I suggest running XQuartz after logging back in (it gets installed in the
/Applications/Utilities directory) to be sure the install went smoothly. You should see an Xterm window open.
Step 2: Install Wireshark
/Library/StartupItems/ChmodBPF. A script which adjusts permissions on the system's packet capture devices (/dev/bpf*) when the system starts up.
Having these permissions is going to make life easier when you install GNS3.
Wireshark comes as a
.pkg install file. But (on Mountain Lion at least,) your default security preferences will prevent you from installing it. To bypass the security preferences, you must launch the install package by right-clicking (or <Ctrl>-clicking) on the package and selecting Open. Accept all the agreements and enter your password when required.
Click on the Browse button and locate XQuartz in
/Applications/Utilities/. You will then have to quit Wireshark and run it again, being patient as it builds its cache.
Note: Wireshark always starts XQuartz when it runs, and you will need to switch to the XQuartz window rather than the Wireshark window when you switch between applications.
Step 3: Install GNS3
GNS3.app is more packed away than just GNS3. Not quite an all-in-one package like Windows, but it does include a copy of Dynamips and VPCS, which you will use soon, as well as a copy of the Qemu emulator which you will use later.
There are many variations of Linux, but when it comes to software distribution, there are two main installation flavors –
rpm (based on Red Hat) and
deb (based on Debian). Since there is actually a way to install GNS3 from a
deb package, I have chosen to use Linux Mint 15.0 (Cinnamon) desktop as the principle flavor of Linux to describe the installation process. This process should also work on other flavors of Debian Linux including Ubuntu. For other Linux flavors like Red Hat, check out the GNS3 Forum and go ahead, ask for help if you need it.
Step 1: Prepare your repository
The GNS3 source files are now stored in a Private Package Archive (PPA). Before you can use the PPA, you must first give your Linux system permission to use it. From a Linux command line, issue the following command to prepare your system to use the GNS3 PPA. At the same time, you should ensure that your repository is up-to-date by running apt-get update from a terminal command window.
sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
Step 2: Install Dynamips and GNS3
sudo apt-get install gns3 dynamips
Step 3: Install VPCS
sudo apt-get install vpcs
Step 4: Install Xterm
GNS3 requires Xterm to run VPCS and the Tools | Terminal command. Xterm is often installed by default on Linux, so the following command will update your install to the current version if it is already installed, or install it if it is not.
sudo apt-get install xterm
You are now ready to proceed to the post-installation tasks.
Note: When GNS3 starts, it looks for the GNS3 settings file
~/.gns3/gns3.ini (OS X/Linux) or
%APPDATA%\gns3.ini (Windows). If it does not exist, it runs the Setup Wizard. If the Setup Wizard did not run, quit GNS3, delete this file and run GNS3 again.
The process is similar for each operating system, and the Windows setup is shown here, with references to the other operating systems as needed.
Warning: Double check that you completed that important pre-installation prerequisite and already have a router image in your
Images directory, otherwise you won't be able to complete all the steps that the Setup Wizard will take you through.
The first step is to configure the path to your OS images (IOS, Qemu, PIX etc.) directory. Remember, you copied your images to your
%HOMEPATH%\GNS3\Images directory before you began the install. (Or your
Click on the number 1 to bring up the GNS3 Preferences dialogue for General Settings. Note that the OS images (IOS, Qemu, PIX etc.) directory is set to the directory where you copied your images. If this is not correct, change it now. Also note that there is a Projects directory. It should be set to be located on the same
GNS3 directory branch as your OS images (IOS, Qemu, PIX etc.) directory.
Back at the Setup Wizard, click on the number 2 to bring up the GNS3 Preferences dialogue for Dynamips. The key point here is to click on the Test Settings button. This is to verify that the path to Dynamips is correct. If you do NOT see a message like Dynamips 0.2.10 successfully started, then you will need to troubleshoot. The most likely cause is that the path to Dynamips is incorrect or Dynamips was not installed correctly.
Click on OK to dismiss the Preferences dialogue and return to the Setup Wizard where you will now click on the number 3. This will open the IOS images and hypervisors dialogue.
Step 1: Select an image file
Click on the ellipsis (…) next to the Image file prompt. A file browser will open at your
Images directory. Select an IOS image and click on OK. If the image is compressed (which is likely if this is the first image you have selected), then you will be presented with a dialogue asking if you would like to uncompress it. Some images simply won't work unless they have been decompressed, and it is always a good idea to "uncompress" the image anyway because your simulated routers will load much faster.
By convention, compressed images use a
.bin extension, and uncompressed images use a
Don't stop. Your image isn't added yet!
Step 2: Configure the Idle-PC value
There have been many tears wept, many heads banged and many disappointments suffered by people who neglect this rather inelegant feature. The actual reason for an Idle-PC value, and what is does, is discussed in Chapter 2, Creating your First GNS3 Simulation. For now, just be happy that since GNS3 0.8.4, there is an easy way to Auto calculate the Idle-PC value – possibly saving you hours of searching for a good value. Without an Idle-PC value, your routers will potentially run your computer's CPU to 100 percent.
I suggest you open your Windows Task Manager (or run
top in a terminal window on OS X/Linux) before you commence this process so you can observe the CPU usage as GNS3 attempts to find an Idle-PC value.
Warning: During this step your computer is likely to become unresponsive at times. Make sure your computer is not busy with other important tasks during this step.
Click on the Auto Calculation button for the Idle-PC value. A progress dialogue will appear. Don't be alarmed if your computer's CPU jumps to 100 percent several times during this process, or even if you see Application Not Responding messages.
If GNS3 is not able to find a good Idle-PC value, you will see a Failed to find a working Idle PC value message. Before you try again, make sure you have absolutely all other applications on your computer closed (except perhaps Windows Task Manager), and try again. When the process is finished, close the dialogue.
Optionally, you can now click on the Test Settings button, which simply boots your router image so you can check your CPU usage. If your CPU usage is still high, make a note of the previously allocated Idle-PC value, and try again.
Step 3: Save your settings
If you used the Auto calculation, then GNS3 would have saved your configuration automatically, but if you manually typed your own Idle-PC or left it blank, then you need to click on Save before your settings are saved for this image. If you try to add another image before saving, you will simply overwrite the one you have already selected.
Unfortunately, there is no warning if you click on Close without saving. The best you can do is look at the list of images at the top of the window. If your image is not listed there, then you can be sure it has not been saved.
Step 4: Check the base config
When you boot a hardware router for the first time, you are greeted at the console with a message:
--- System Configuration Dialog --- Would you like to enter the initial configuration dialog? [yes/no]:
But if you have a Base config file specified, GNS3 boots the router with the configuration from that file applied which is a great time saver and even assists in keeping your CPU under control if you have a lot of routers. (Having a lot of routers sitting at the
[yes/no] prompt can spike your CPU).
You can edit the
baseconfig.txt file if you wish to customize it, or even have a different file for each router image. By default, it is found in your
Or if you want your simulations to be more "real-world" and boot to the System Configuration Dialog, and the
[yes/no] prompt then you can delete this setting, leaving it blank. But don't forget to click on Save again after deleting the field.
In this chapter you have learned about the GNS3 family of applications, and hopefully now have a better appreciation of the many contributors to this product.
You now know how as to work out if your computer is going to be powerful enough to handle the size of the simulations you wish to run.
You have followed the process of downloading the appropriate files for your installation and installing them in the recommended order, and gone through the essential installation steps of defining the images and projects directories, tested your Dynamips installation and configured at least one IOS image ready for inclusion in a simulation. Ideally, you will have found a good Idle-PC value for this image, and you now have a working installation of GNS3 ready to build your first GNS3 project with Cisco emulated routers and the Virtual PC Simulator, which is of course what you will be doing in the next chapter.