A brief introduction to GNS3 and Dynamips
GNS3 is a front end for Dynamips. Dynamips, which was written by Chris and released at http://www.ipflow.utc.fr/blog/, is the backend that emulates the router platforms. Sadly the final version released is 2.8 RC2. Reportedly Chris had worked on some enhancements after this release but those enhancements never made it into public hands.
Dynagen, written by Greg, was the first non-gui interface made for Dynamips to make life easier. It has a very nice command line interface and is quite stable. It also has a slight performance edge over GNS3. But the ease of use with GNS3 still makes it more attractive than a slight performance enhancement.
If you would like to use Dynagen, it can be downloaded from http://dynagen.org/
GNS3 started as a project for university students. And it is the most successful graphical interface for Dynamips. Although some Chinese authored a few GUI interfaces they never take off. They are also out of scope for this guide to discuss those reasons.
GNS3 is maintained at following site: http://gns3.net/
Important Note: In this IPexpert Guide, GNS3 is used as a collective word for the combination of the backend software (Dynamips) and the frontend software (GNS3 itself).
GNS3 is well known as the non official Cisco emulator; it can run Cisco IOS on the platforms supported by the program. It’s important to note that, GNS3 is not a simulator it is an emulator. It can support all the commands and features supported on the hardware it emulates. When people say, GNS3 cannot emulate switching; they are misunderstanding the purpose of GNS3. GNS3 supports switching based on the capabilities of the supported platforms. Restrictions in switching are not because GNS3 doesn’t support it. The limitations are put on the hardware platform that is supported, namely the NM-16ESW.
Platforms and modules supported by GNS3.
- 1700 routers
- 2600 routers
- 3600 routers
- 3700 routers
- 7200VXR series
- NM-16ESW switching module
- WIC modules
- NM-xT/ NM-xFT
- Native Etherswitch support and Frame-Relay support
Some important GNS3 components:
Autostart = False/True
This setting allows you to automatically start all the devices when you load you topology if it is set to “True”. We recommended this value be set to “False”.
Ghostios = True/False
This allows GNS3 to run multiple copies of a single image, reducing resources on the workstation. We highly recommended setting it to “True”, in all situations.
Sparsemem = False/True
This setting allows GNS3 to control memory handling. In case this feature is set to “True”, GNS3 will only utilize memory as needed by each running device and unused memory will be swapped to hard disk. This feature is good for machines which lack memory.
But this feature makes your overall performance much slower. This is because excessive swapping of virtual memory with the hard drive. If your computer can handle the memory required by to run all the devices (memory required by one device x number of devices) then you should set this to “False”.
IDLEPC = 0x????????
Many consider this “THE” most important part of GNS3 configuration. It can dramatically change your overall experience. Basically, this value defines the resources the emulated Cisco Routers will use. The IDLE PC value instructs devices to release resources and go idle during while the router is running idle. This then allows resources to be freed up and made available to the other devices. It is kind of co-operative multi-tasking being done among the emulated instances. You should spend sufficient time to find a good combination of IDLEPC value suited for his/her IOS and computer platform.
It is important to understand that our goal is for you to have smooth GNS3 experience. If you can emulate the IPexpert topology with your PC’s CPU running around a scale of 60-70% when all of your devices powered on and you have a handful of configurations loaded, then don’t waste more time on finding better values. This is the performance you should expect. Don’t waste additional time trying to tweak GNS3 settings to get better performance. Just like in the actual lab you need to meet the requirements of the questions, no more, no less.
Image files: GNS3 supports (like normal routers) booting form compressed IOS images. During IOS initialization, routers being emulated have to decompress the image every time it boots and this takes a lot of time. The best way to save time during the initial boot process is to use GNS3 with decompressed images.
IOS files can be decompressed using command-line “uzip” utility easily. Ignore the warning that the decompression process wil report about corrupt headers – this is IOS “bootstrap”. Resulting file is decompressed IOS you can use with GNS3.
Enough talking, let’s move on to the actual setup!!!!!!
Linux (Ubuntu 9.10 Installation and dual booting)
By nature GNS3 is a CPU intensive application and requires a lot of resources. Windows client operating systems are not best suited for Dynamips for this reason as they are not the best tuned for applications like this. Linux, on the other hand, is a very stable Operating System and is better suited for applications, such as GNS3, that require optimized CPU resources. Linux can also better control the utilization of these resources in a more optimized way. Now there are many flavors of Linux on the market. You will have many users which prefer one versus the other but for someone first being introduced to Linux there is none better than Ubuntu. Ubuntu has a very large user community and many of the support forums are heavily supported and have a lot of good resources for guidance in unfamiliar territories. For this reason we will use Ubuntu in this guide as our recommended Flavor.
Ubuntu is available in both 32bit and 64bit version, for this IPexpert guide we will only discuss 64 bit version of Ubuntu. Although there is no difference among 32 bit or 64 bit installation. The current version of 64bit Ubuntu can be obtained from following link: http://www.ubuntu.com/GetUbuntu/download
If you are going to be starting with a clean installation, meaning you have no previous OS installed, then you can start installation of Ubuntu without any other requirements to keep in mind. If case your computer already has another operating system installed, the following links can help with steps to install Ubuntu using a dual boot of Linux and Window’s. (Dual booting Ubuntu and other OS is simple process but if you don’t take the necessary steps for this process you can damage your data; it is always a wise decision to backup your data before proceeding).
Dual boot Windows XP (XP installed first) and Ubuntu:
Dual boot Windows Vista (Vista installed first) and Ubuntu :
Dual booting Windows 7 and Ubuntu will follow the same strategy as the Vista link given above.
Let’s prepare Ubuntu for GNS3 installation now!
Preparing Ubuntu for GNS3 installation
GNS3, in itself, is a small application but it has some dependencies (Linux terminology meaning required software components prior to installation). Installation of these dependencies is the most difficult part of the GNS3 installation, but we are fortunate enough that Ubuntu can do this process automatically with the Synaptic Package Manager.
Step 1: Launch Synaptic Package Manager software by going to System – Administration – Synaptic Package Manager
A window like Fig-1 below will appear
In quick search type gns3 and it will fetch software related to GNS3. You can see from above Fig-1 that for me it fetched gns3 and dynamips. Click on check box for gns3 and dynamips one by one and select “Mark for Installation”. When you will select “Mark for Installation”, it will bring a pop up window that will show all of the dependencies which these two packages require. Click “Mark” for these as well.
Note: Without these dependencies GNS3 will not work.
After that, from top bar click “Apply”, this will start downloading dynamips, gns3 and all of dependencies automatically. After all the applications have been downloaded, Synaptic Software Manager will start installation of applications automatically.
Installation of Tabbed terminal client:
When the installation of GNS3 is done, again open Synaptic Software manager and install a tabbed telnet client called Konsole. If you don’t want to use tabbed telnet client then you can skip this step.
In the Synaptic Software Manager window type konsole in quick search. It will fetch a few related software packages, just select konsole by clicking on “Mark for Installation”. This will bring once again show a dependencies pop up message and you have to click on “Mark”. Same as previous, click on “Apply” from top bar, this will start downloading and installation of konsole (tabbed terminal client).
Running GNS3 under root:
In Ubuntu (Linux) separation of roles is a very important concept. Meaning normal users are separated from the root and other important system accounts. GNS3 can be run as a normal user but for simplicity sakes I highly recommend running GNS3 as root. This will keep everything simple and straightforward. This will avoid a lot of permission issues, which can cause you some major headaches in normal operation of GNS3. If you have plenty of time and wish to spend that time on Linux issues rather than putting that time into CCIE studies then go ahead and figure out things that way… I am not in that mood :)
Creating necessary Shortcuts and supporting folder structure:
We will create shortcuts and folder structure in following way
images will be used for storing images.
projects will be used for storing .net files.
configs will be used for storing initial and final configs for IPexpert labs.
captures will used for capturing network traffic.
supporting files here you can find all the files necessary or useful for running your GNS3 more easily.
tmp will be used for temporary files created by GNS3
Automatic way of GNS3 Configuration: Life cannot be easier than this
Note: For proper operation of GNS3 and to make life easier we will create supporting directory structure. This structure and supporting files can be obtained from attached IPexpert.tar.gz file. Click here to download this file
Note: If you prefer manually configuring GNS3, skip these steps and proceed to Manual configuration.
Decompressing Ipexpert.tar.gz file:
Copy this IPexpert.tar.gz file to your desktop and double click it. Extract the files to the desktop, from here you can move files to proper locations. Here we extracted two folders to the desktop, shortcuts and IPexpert, along with gns3.ini file as shown in Fig.
Move the “GNS3 File Browser (root)” and “gns3 Graphical Network Simulator (root)” shortcuts on Desktop, these two shortcuts are in folder “shortcuts” folder. These two shortcuts will launch browser and GNS3 as root.
When you will first time launch application then you will see an error message like following:
Click Mark as Trusted and it will fix the issue.
Next move the contents in the IPexpert folder to the root directory. To move these files to root, open “GNS3 File Browser (root)” and navigate to /home/yourusername/Desktop, from here copy the IPexpert folder, navigate back to / and past it there. (You can reach to / by clicking on “File System”)
Now copy gns3.ini file to /root/.gns3 location (this folder may not appear by default, you have to press crtl+h). If after pressing crtl+h it does not appear then create one.
You can save original file as gns3-old.ini
Setting Proper Permissions
After moving the IPexpert folder to root (/IPexpert), we have to adjust permissions on this folder. Right click the IPexpert folder, then chose properties. A new window will open; click on Permissions and set permissions as shown in fig (don’t forget to click on “Apply Permissions to Enclosed Files” button). Click Close
Next set the permission settings on the folder /root/.gns3 (this folder may not appear by default, you have to press crtl+h) should be like fig-07
Make sure you have configured permissions properly as shown in above figures.
And that is it!!!!!!!! Now you can proceed to Creating first project step and can skip manual configuration steps.
GNS3 Configuration Manually:: Let me see all what it takes
If you opt not to use the attached file use the following Steps. If you have already followed the steps for the Automatic way please skip to the Creating First project Steps.
First, create a browser shortcut which will explore files in “/root” anything launched through this explorer will be automatically launched to “/root” directory.
Run the following commands in a terminal session, (terminal can be reached by Applications – System Tools – konsole or Applications – Accessories – Terminal)
In the terminal window execute the following command:
sudo gedit /usr/share/applications/Nautilus-root.desktop
This will ask you to enter root password which is same as your user password. Once you entered password and its correct then a new window will open in that window paste the following code:
Name=GNS3 File Browser (Root)
Comment=Browse the filesystem with root privileges
After saving the document close the window.
Enter the following command to refresh the “Desktop” in the terminal window.
Go to Applications – System Tools and right click “GNS3 File Browser (root)” and select “Add this launcher to desktop”.
Create a second shortcut for GNS3 by right clicking on Applications – Education – GNS3 Graphical Network Simulater and choosing “Add this launcher to desktop”.
After you are done, will see the following shortcuts on Desktop:
Right click on GNS3 shortcut select “Properties” and enter the text (gksudo gns3) as shown in following fig, in command box.
Creating the Supporting Folder Structure
Open file browser by double clicking the created shortcut “GNS3 File Browser (Root)”, the first time it will ask for root password, this is same password you used for your login on this system.
Click on File system and create a folder called “IPexpert”, keep in mind in Ubuntu file names are case sensitive which means ipexpert and IPexpert are not same folders.
Fig – 12
Now create the directory structure inside IPexpert as shown in the figure below, remember this structure is provided in attached IPexpert.tar.gz file also.
Inside IPexpert folder we will create the directories of images, projects, configs, captures, supporting files, and tmp.
Before preceding further please put at least one IOS image in /IPexpert/images/ directory in an unzipped format.
I used c3725-advipservicesk9.124-15.T6.bin image along with 0x6271c1a0 idlepc value. This image has proved to be stable and provide all the functionality required for the CCIE R&S blue print.
Configuration of GNS3
1- Launch GNS3 by double clicking on GNS3 shortcut on Desktop. It will ask for the root password which is same as your normal user password. After entering root password, it will show the following window.
For now just press Cancel, we need to configure and fine tune GNS3 before we do anything else.
IOS Images and Hypervisors
I assume that you have finished the file structure steps explained previously. Now we will use that file structure for GNS3 configuration.
1- Configure ISO images and Hypervisor. Click on Edit > ISO Images and hypervisors
Use the following steps for IOS Images:
1- Image file: Select the image you have placed in the /IPexpert/images folder. You must have at least one image for the platform you will be using in the topology. (We are using /IPexpert/images/c3725-advipservicesk9.124-15.T6.bin) image.
2- Choose Platform, this should match with the IOS image you provided in the previous step. (We used the 3725 image so will choose the 3700 platform)
3- Choose the correct Model of your selected platform.
4- Provide the IDLE PC value, if you have one. (We used 0x6271c1a0. For the 3725 with the selected IOS image above, this value has shown promising results. But you may find this not to work so be aware this may need to be adjusted).
5- Select the Default RAM for the Platform. For best results use Cisco feature navigator to seek recommended RAM for the particular model. This model’s recommended RAM is 256 MB, but our experience has shown giving 128MB is sufficient.
Our Topology uses 15 devices so using 128MB for each device, 128×15 = just shy of 2GB. So your laptop/PC should have a minimum of 3GB. With 4GB or more you will have smooth sailing.
6- Put the check in Default Image for this platform. And Click Save.
Click on External hypervisor and duplicate the Settings as shown in Fig-10.
1- Host 127.0.0.1
2- Working directory /IPexpert/tmp
Note: Click Save at least 4 times to create 4 Hypervisors. You should see four instances when finished in the right window as shown above. Using four instances will make these settings optimal for Intel’s Core Ix processors, which support Hyper-Threading.
Click on Edit -> Preferences you will see a dialog box as shown in Fig-10
Click on General
Change the Terminal Command to the following line:
/usr/bin/konsole –profile “gb” –new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &
Note: This setting is only required if you want to use konsole as the default terminal software. In real CCIE lab the terminal emulation program provided doesn’t have tabs. We have found the benefit of tabs for doing practice labs, that in our opinion, far outweighs the benefit of duplicating the actual lab. Of course you will have your own opinion on this as well.
Setting gb profile:
In the above config line for console, we used “gb”, this is name for a Konsole profile “gb”. This profile loads green text on black back ground. To configure this profile open Konsole (terminal software) menu; go to Settings -> Manage Profiles and create a new profile named “gb”, edit settings as you like e.g Green on Black. After you have created new profile delete default profile named shell. Close your terminal and open again all will be set to go.
Last change the Project directory and Image directory settings as shown in Fig-11, then Click Apply.
1- Change the Working directory to /IPexpert/tmp
2- Leave “Enable ghost IOS feature” and “Enable mmp feature” checked.
3- Uncheck “Enable sparse memory feature”.
4- Click Apply.
5- Click Test. If everything works well you will see “Dynamips successfully started” in green as shown in Fig-11.
Note: this test will only be successful if you have completed all the steps and already have software that supports a telnet client.
Configuring Capture Directory:
If you want to use packet captures, which is supported by GNS3 with no extra software or settings, you can use the settings as shown above. You should have Wireshark or some other capture reader installed prior to configuring this. Instructions for this are beyond the scope of this document.
Define path for captured packets, /IPexpert/captures
Click Apply and OK to close this dialog box.
Creating the First Project:
1 – Go to /ipexpert/projects folder and create one file and rename it Ipexpert-test.net. Right click it and chose “Open with”, then “Open with other application”. In the command line type gns3, and click open.
NOTE: This will help you to open any .net file by double clicking on it, (this is the way of handling .net files because of an open bug in GNS3 for Linux).
2 – From the node types area, drag two instances of a router 3700 to the middle of the workspace ( I used the 3700 image, if you have used any other supported image, then drag that platform). Connect the devices using the Connect tool and then run the topology using the Run button.
3- Click Save As to save it.
Loading IPexpert topology:
We will load the IPexpert topology now to see how it all works. This topology is shipped with the zip file, and should be located in the folder “/IPexpert/projects/” if you used our file to create your folder structure.
Important Notes: This guide recommends using GNS3 IPexpert topology on at least an Intel Core 2 Duo 2.0 processor and we recommend a minimum RAM of 4GB for optimal performance. For best results if Intel Core i”x” can be acquired then that will be great.
Written by contributing Customer: Nadeem RafiGNS3 on Ubuntu 9.10 the IPexpert Way,