INE would like to thank Nadeem Rafi for this guest blog post on using GNS3 with Ubuntu! Nadeem is one of our prized CCIE 2.0 Self-Paced students currently studying hard for his CCIE R&S exam. You will often see Nadeem in the INE Online Community working with his fellow students. Nadeem is currently enjoying 100 rack rental tokens from Graded Labs for his excellent post here!
Installing and Dual Booting Ubuntu
Linux is a stable Operating System and applications that do intense calculations can be handled in a more optimized way, as compared to other proprietary Operating Systems. Perhaps one of the best things, however, is the fact that it is free and can co-exist with other Operating Systems.
Ubuntu is more user friendly than many other Linux flavors, especially considering that almost everything works out of the box with most laptop installations.
Ubuntu can be obtained in both 32-bit and 64-bit versions from:
http://www.ubuntu.com/GetUbuntu/download
For more information about how to install and dual boot with Windows XP (XP installed first), visit:
http://apcmag.com/how_to_dual_boot_windows_xp_and_linux_xp_installed_first.htm
For more information about how to install and dual boot with Windows Vista (Vista installed first), visit:
http://apcmag.com/how_to_dualboot_vista_with_linux_vista_installed_first.htm
After you have installed and booted Ubuntu successfully, you can proceed to the installation of GNS3 and the supporting software.
GNS3 and Supporting Software Installation
Installation of GNS3 is quite simple.
Step 1 – System – Administration – open the Synaptic Package Manager. You will be prompted for a password. Use your login password here.
Step 2- In the search box, type gns3, which returns the GNS3 and Dynamips packages. Select both of the packages (mark for installation). In the pop up window it will show all of the dependencies which these two packages require. Click Mark for these as well. Click Apply and installation will start by downloading and configuring GNS3 + Dynamips along with all required applications.
Step 3 – After successful installation, you will see the following icon: Applications – Education – GNS3 Graphical Network Simulator.
Step 4 – For a multi tab console we need to install the utility called konsole. In the Synaptic Package Manager type konsole and install it as previously described.
For best results, it is now time to configure Ubuntu for ease of use with GNS3.
Configuring Ubuntu for GNS3
For best operation of GNS3, we will create some directories. This will help to have a managed hierarchy of folders and files. Note: file and folder names under Linux are case sensitive, so the best option is to use lowercase names in all situations.
Step 1 – Create one root context-enabled Explorer. Go to Applications – System Tools and right click File Browser. Select Add this launcher to desktop.
Step 2 – You will see a new shortcut on the desktop for the file browser. Right-click it and choose Properties. In the Properties box you will see a command similar to “nautilus –no-desktop –browser %U”, which we need to replace with “gksudo nautilus” (without quotes). Now whenever you launch this version of the file browser, it will launch in root context and anything opened within this browser will automatically operate in the root context.
Step 3 – Now we will create one more shortcut for GNS3; using the above method. The only difference will be the command line text “gksudo gns3”. This shortcut will help you to launch GNS3 in the root context.
Step 4 – Open explorer using your newly created shortcut (root context file browser). Click on File System and create one new folder named gns3 (all lowercase).
Step 5 – Inside the gns3 folder, create the following folders: images, projects, configs, ie, capture, and tmp.
- images will be used for storing images
- projects will be used for storing .net files
- ie will be the working directory for router temp files
- capture will used for capturing network traffic
- tmp will be used for temporary files created by GNS3
Configuring GNS3
Before we start configuring GNS3, you have to provide at least one IOS image, preferably in an unzipped format. Ensuring the image is unzipped will save time when your routers boot and they will not need to unzip each time they are launched.
Step 1 – GNS3 requires to be run by the root account (admin account), for that we have created a shortcut which launches GNS3 in the root context. Launch Gns3 using this shortcut.
Step 2 – For the time being, cancel the first dialog box, and click on Edit – IOS Images and Hypervisors and click on the IOS Images in the newly opened window. (I assume that you have already placed one IOS Image of your choice into the /gns3/images folder). Please navigate to that folder and select your image, platform, and model accordingly. If you have a good Idlepc value, you can place it here also along with the default RAN for this IOS image. Do not forget to click on the Default image for this platform.
Step 3 – Now click on the External Hypervisors tab. Provide the proper working directory here /gns3/tmp and hit save 6 times. It will create 6 instances of Hypervisor.
Step 4 – Now go to Edit – Preferences and in the newly opened window, click on General and then on the General Settings tab. Configure this window as shown in following image, and replace the terminal command with the following:
/usr/bin/konsole –profile “gb” –new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &
NOTE: The blog software is truncating one of the two hyphens (-) before the keyword new in the above command.
NOTE: This modification is only required if you want to use konsole (multi tab terminal emulator), otherwise you can leave it as is.
Step 5 – Now click on Dynamips – Dynamips and configure this window per the following graphic:
Step 6 – After applying the above configuration, press Test. If everything succeeded, you will see “Dynamips successfully started”. If you want to capture and examine packets, click on Capture and provide the path to your capture directory: /gns3/capture (this directory was created earlier). You also need Wireshark for packet analysis.
Creating the First Project
Step 1 – Go to your /gns3/projects folder and create one file and rename it test.net. Right click it and chose “Open with”, then “Open with other application”. In the command line type gns3, and click open. NOTE: Next time you can open any .net file by double clicking it, (this is the way of handling .net files because of a bug in GNS3 for Linux).
Step 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.
You are now ready to create your topologies and start emulating. Remember, you can save your topologies to your /gns3/projects directory for later usage.
Happy emulating everyone!
About Anthony Sequeira, #15626:
Anthony Sequeira brings decades of teaching, technical writing, and consulting experience to INE. Anthony began his career as an author and lecturer within the IT community, featuring best-selling titles for Microsoft and Cisco Press. Best known as one of the training voices for the revolutionary e-learning company called KnowledgeNet, Anthony now teaches online and in-classroom exclusively for INE. When not helping his students master Cisco networking, Anthony can be found at the poker tables, or flying the Florida skies in a Cessna.
You can leave a response, or trackback from your own site.
66 Responses to “GNS3 on Ubuntu”
« Older Comments « Older CommentsLeave a Reply










@newbeus
do u tried to login to devices using any other terminal software? or you tried with default settings w/o changing to Konsole ?
@jo:
As Nadeem said, I had syntax errors. When I copied and pasted from the blog I got the below (1). Which is what it looks like in the above write up. After checking the “Konsole Handbook” and cleaning my glasses, I saw my errors. This may help you.
(1) /usr/bin/konsole –profile “gb” –new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &
(2) /usr/bin/konsole –profile “gb” –new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &
Nadeem, again great work, thank you.
@jo
When I posted my corrections they came out with the same errors. It should be:
–profile
minus minus profile (no spaces)
–new-tab
minus minus new minus tab (no spaces)
@newbeus
Yes the issue is same… its only showing single minus not –. I will request Anthony to fix in original blog also.
hi guys, am i missing something here? Konsole KDE-4 is not working when im running gns3 as root. It just pops up and then disappear.
But as a normal user, everything works fine.
Any help??
Thanks in advanced!
oh never mind, i got it working.
Thanks!
Please read few earlier replies, you can find solution. Even if you read blog carefully there is mentioned that blog software is missing one minus in konsole command line.
HTH
Great article. Continue to logging more great stories. Computers are growing swifter and less money. Consumers are more developed to what is ready. Secondhand PC’s are a way to buy a cheap computer
Hi guys this is very good post. Here are my two cents.
If you would like to access your devices using terminal with tabs like SecureCRT, create a launcher with the following command. Use Ctrl+PgUP and Ctrl+PgDn to switch between tabs.
Here is the command:
gnome-terminal –tab –title “R1″ –command “telnet -a localhost 2001″ –tab –title “R2″ –command “telnet -a localhost 2002″ –tab –title “R3″ –command “telnet -a localhost 2003″ –tab –title “R4″ –command “telnet -a localhost 2004″ –tab –title “R5″ –command “telnet -a localhost 2005″ –tab –title “R6″ –command “telnet -a localhost 2006″ –tab –title “SW1″ –command “telnet -a localhost 2007″ –tab –title “SW2″ –command “telnet -a localhost 2008″ –tab –title “SW3″ –command “telnet -a localhost 2009″ –tab –title “SW4″ –command “telnet -a localhost 2010″ –tab –title “BB1″ –command “telnet -a localhost 2011″ –tab –title “BB2″ –command “telnet -a localhost 2012″ –tab –title “BB3″ –command “telnet -a localhost 2013″
thanks Adriot, great tip.
Hi Nadeem Rafi,
have a question here mate:
have you tried using ip sla to to do some test for voip traffic?? I can’t get it to work on ubuntu 9.10. I mean, i’m getting RTT results, but the MOS value as well as the ICPIF is fixed on single value, MOS = 4.50 and ICPIF = 4719928667. Its working correctly on XP though.
And one more thing, same on ubuntu 9.10, I can’t get the correct result when i do the “show queueing interface” command, all I see is the queueing strategy, available bandwidth and all that stuff, BUT it doesn’t display the part with (depth/weight/total drops/no-buffer drops/interleaves), Conversations, ToS, Length, souce-port, destination-port..etc.. i mean i can only display the upper portion of the proper result of that command. I have 2 http traffic and 1 ip sla traffic goin on there, but it doesn’t display that lower portion of the output.
need help guys,
thanks mate!
take care
@ tobie
Sorry for late reply, but i was quite busy with studies and some office work.
I have never tried your scenario, so i cannot comment about it.
I hope some one else can put light on this.
Hello Rafi ,et al;
I’ve a setup where i’ve ubuntu 9.04 install on a server and the same on my laptop as well. I prefer having the load thrown on the server, hence get the dynamips running on the server and the gns3 frontend (as a root user)on my laptop. I’ve had the following issues recently:
1. I cannot save my topology (.net file) in my folder. I’ve used chmod & chown to give full privelege to this folder , but doesnt help. I’m aware of the open bug, but the workaround doesnt seem to work as well.
2. Do I’ve an option of running in usermode rather that a root in this kind of setup?
Kind regards,
Anish
anish_achenkunju@yahoo.com
regarding ist issue, you can give it a try to save as instead of normal saving. As you know its open bug, so nothing we can do regarding this issue.
For second issue, you can run it as a normal user, but it will complicate things. If you have good experience with Linux and you have enough spare time to spend on Linux instead of Cisco then its doable.
HTH
Thanks for finally clearing up some of the mysteries around gns3 on Ubuntu. The problem I have is still that it fails to start dynamips. Is there something further I can do to isolate this issue? From the command line “sudo dynamips -H 7200″ seems to start but not from gns3.
Konsole is giving some problem most of the time as the hyphens are need to be modified.
Please check the below link. Its awesome.
Just install Roxterm and mention the terminal path in gns3 preferences.
# sudo apt-get install roxterm
/usr/bin/roxterm -p gns3 -n %d –tab -e telnet %h %p
http://www.ittidbits.com/blog/?tag=gns3