Welcome
First of all, may I welcome you to my site. My name is Chris and I'm from the UK and work as a Systems Engineer for Cisco. This blog was initially created to post up my subnetting technique but has now got more stuff to do with attaining Cisco certifications. Either way I really hope that the content is sufficent for your needs and I look forward to hearing your feedback. If you find that the content really helps you please feel free to donate using the PayPal link on the right.
To view the index of all my articles please click here.
GNS3 Configuration Guide - Linux (Fedora 9)
Thursday, 4 December 2008
I've been hearing how much better Linux is to Windows from guys across the world so I thought I would install FC9 on my home computer and promptly destroyed Windows XP. What a blessing in disguise! Now I've made the leap of faith I am one happy man although still a little green to the world of Linux.
Let's get to installing GNS3, VPCS, loopback adapter equivalent bridge interfaces etc. I'm going to do this without pictures as for the majority of the case it is exactly the same as the Windows installation. It is just the initial installation and dependencies that are required.
Note to purists: I am a Linux noob so if my terminology is out then I apologise.
Note the use of sudo here. If you haven't set it up then you can log in as root and repeat the command (without the "sudo" prefix).
1. Install PyQt4
Fedora = sudo yum -y install PyQt4
Ubuntu = sudo apt-get install PyQt4
This should install all dependencies needed for GNS3 including SIP.
2. Install tunctl and bridge-utils e.g. sudo yum -y install tunctl bridge-utils
This will now allow you to create bridged interfaces equivalent to Microsoft Loopback Adapters.
3. Download GNS3 from here. I tend to go for the tgz file.
4. Download Dynamips from the same location under the heading Associated Software. I run 32-bit only so I download the Dynamips 0.2.8-RC2 binary for Linux x86 platforms
5. Right-click the downloaded GNS3 file and choose Extract Here. Drag the Dynamips file downloaded in Step 4 to the extracted folder. Now right-click the Dynamips file and select the Permissions tab and ensure the "Allow executing file as program" box is ticked, then click Close.
6. Now double-click the gns3 file and choose Run. Assuming that all dependencies have been installed you should see GNS3 start with the screenshot in Step 3 of my GNS3 Windows guide. Follow the majority of that to set up the images and working directories plus the idlepc value.
So hopefully now you should be able to muck around with GNS3 and do most of what you need to do. However, I had one main issue and that was how do I connect my router to my local machine so that I could run syslog servers, iperf, and other apps like we do using the Loopback Adapter in Windows? Well I have to pay my respects to tuner_x at the Sadikhov IT forums for the guide on how to do this. You must run GNS3 as root in order to achieve this so for example I run:
sudo ./Chris/Desktop/GNS3-0.5-src/gns3
NOTE: If Dynamips doesn't start (you'll probably notice that you cannot connect to a hypervisor on 7200 when dragging a router onto the stage) as root then you need to either clean the working directory as it points to your user account or point the working directory to a new location.
1. If you didn't do this before you need to install tunctl and bridge-utils as outlined in Step 2 of the initial configuration guide above.
2. Now add the following to the script below so each time you switch on your PC the bridge interfaces are created.
sudo vi /etc/rc5.d/S99local
Now insert the following (note that there is no particular naming convention, just what I chose to do) and save:
# Script to create bridge interfaces. Requires tunctl and bridge-utils to be
# installed.
#
# This creates the interfaces. -t names the interface and -u sets the owner of
# of the interface.
/usr/sbin/tunctl -t fed_0 -u Chris
/usr/sbin/tunctl -t fed_1 -u Chris
/usr/sbin/tunctl -t gns3_0 -u Chris
/usr/sbin/tunctl -t gns3_1 -u Chris
# Then bring the interfaces up
/sbin/ifconfig fed_0 up
/sbin/ifconfig fed_1 up
/sbin/ifconfig gns3_0 up
/sbin/ifconfig gns3_1 up
# Now create the bridge interface
/usr/sbin/brctl addbr gns3_br0
/usr/sbin/brctl addbr gns3_br1
# Bring the bridge interfaces up
/sbin/ifconfig gns3_br0 up
/sbin/ifconfig gns3_br1 up
# Add the tap interfaces to the bridge interfaces
/usr/sbin/brctl addif gns3_br0 fed_0
/usr/sbin/brctl addif gns3_br0 gns3_0
/usr/sbin/brctl addif gns3_br1 fed_1
/usr/sbin/brctl addif gns3_br1 gns3_1
# Here is an example of how to assign an IP address to the gns3_br0 interface so one
# can ping from a GNS3 router to the local machine in order to run syslog etc
#
# ifconfig gns3_br0 inet 192.168.2.254 netmask 255.255.255.0 up
#
# I do this manually and not via the script but keep it here for reference only.
# And that's it
Now you could choose to reboot or restart the appropriate services. I tend to restart the services as it is quicker than rebooting.
sudo /etc/rc5.d/S99local restart
sudo /etc/init.d/network restart
Now add an IP address to one of your gns3 bridge interfaces. Here I am using the first:
sudo ifconfig gns3_br0 inet 192.168.2.254 netmask 255.255.255.0 up
NOTE: Do not use the same IP address as your main ISP router otherwise you'll knock out your Internet connection. D'oh! Always learn the hard way don't you Chris? LOL.
Go into GNS3 and drag a cloud, or a customised symbol, onto the stage and right-click and choose Configure. Select the "NIO TAP" tab and type the name of your bridge interface (e.g. gns3_br0) then click Add, Apply, then OK.
Hook your router up to the cloud, start the IOS, console into your router, and put the interface into the same subnet as your bridge interface. Bring the interface up and lo-and-behold you should have connectivity between your PC and your router.
What about multiple hosts? You can still use VPCS as explained in my VPCS Configuration Guide for Windows although there is a slightly different way to run it.
1. Once you have downloaded the file, extract it to your GNS3 folder.
2. Now open the extracted folder and locate the "vpcs" file (NOT vpcs.exe).
3. Right-click the vpcs file and choose the Permissions tab and tick the box next to "Execute".
4. Go to the desktop and right-click and choose Create Launcher.
5. Type = Application in Terminal
6. Name = VPCS
7. Command = the path to the vpcs file located in Step 2.
8. Comment = Virtual PCs
9. Click OK to create the launcher
10. Drag the launcher into the VPCS folder.
When you want to run VPCS just double-click on the created launcher. The configuration works just as it does in Windows.
That's it. FC9 running GNS3 exactly as I had it on Windows.
I hope it helps you Linux noobs to run GNS3.
Chris
Posted byChris Bloomfield at 13:36 3 comments
Labels: brctl, bridge-utils, dynamips, FC9, Fedora, Fedora 9, gns3, linux, tunctl, vpcs
GNS3 0.5 released
Thursday, 19 June 2008
The GNS3 0.5 release is available. It includes bugs fixes and new features:
* Possibility to load .net files of other users (provided that there is a registered IOS image with the same model as the one used in the NET file).
* New detailed tooltips for nodes.
* A minimalist wizard raised when the configuration file is empty.
* A button to insert a picture on the scene.
* Decorative node support for creating network diagrams.
* Ghostios is now supported on remote hypervisors.
* A symbol manager with library support (a howto to create a symbol library will be released).
* Z values can be changed for annotations and inserted pictures.
* Automatic load-balancing on external hypervisors (choose multiple external hypervisors when recording an IOS image).
* New option to bind the hypervisor manager with an address/name other than 'localhost': useful for labs which use local and remote hypervisors.
* The DMG package includes two Dynamips binaries, one for Tiger and one for Leopard
You will notice that on opening GNS3 for the first time you will now be confronted with a setup wizard which takes you through the first few steps of my main guide.
Clicking on Step 1 will bring you to the following screen:
Clicking on Step 2 will bring you to the following screen:
Posted byChris Bloomfield at 14:14 0 comments
Labels: dynagen, dynamips, gns3, gns3 0.5, ios
GNS3 PEMU Configuration Guide - latest version 0.4.1
Thursday, 3 April 2008
The latest version of GNS3 (0.4.1) offers:
* A dynamic mode (no design/emulation modes)
* A new .net save/load.
* c1700 and WICS support.
* PIX emulation.
* Dynamips's ATM bridge.
* Capture feature for links from the GUI.
* IDLE PC calculation from the GUI.
* GUI improvements (save the window state when closing GNS3 ...)
* Annotation feature.
* Project feature (you can keep router configs, nvram ...)
* NULL NIO support.
* PDF export.
* New languages.
For those that need to set up GNS3 for the first time, I have amended my GNS3 Configuration Guide based on version 0.3.x so that users of 0.4.x can understand and follow it too.
Anyway, back to the stand-out new feature - PIX emulation, yay! My only minor gripe is that PIX is now EOL but as there are loads of PIX firewalls out there I'm not complaining.
Hopefully you can tell but I'm not the kind of guy to leave people in the lurch and chuck them in the deep end so here is a step-by-step guide on how to configure a PIX firewall in the latest version of GNS3.
1. Download and install the latest version of GNS3 from http://www.gns3.net/download and ensure that you install the PEMU wrapper (this is done by default when installing GNS3).
2. Open up GNS3 and you will see a screen like the following (notice how it has changed from the old version, especially that you run the IOS and console to devices from the one screen).
3. Now go to Edit on the menu bar and select Preferences. You will now see the screen below:
4. Now select the PEMU option from the left-hand menu to be presented with a screen like the one below. All you need to do now is point to the PIX Image where it says "PIX Image". Once you have done that click on Apply, then Close.
5. Now drag and drop a PIX firewall from the left-hand menu of the main screen onto the centre stage. Right-click on the firewall and select Start then Console:
6. You should now see your Console session to your PIX firewall as below:
Posted byChris Bloomfield at 11:26 4 comments
Labels: Cisco, configuration, dynagen, dynamips, firewall, gns3, ios, pemu, pix, router
GNS3 Configuration Guide
Tuesday, 18 December 2007
What is GNS3 I hear you cry? Well, imho, it is the best tool on the market to practice router configuration without having an actual router in front of you. What sets it apart is that it is a Cisco IOS emulator, not one of those nasty simulators that constrain the commands that can be used. The caveat is that you will need a Cisco IOS, for example I use the 3660 Crypto IOS. I have a support contract with Cisco so I can access an IOS however if you look around enough you will be able to find a Cisco IOS for yourself.
GNS3 is actually the graphical front-end of Dynamips/Dynagen and allows you to drag-and-drop routers onto a stage, connect them up, run IOS on them, and save their configs, just as if you had your own network. It can be a little confusing to set up first of all so I will present a step-by-step guide below of how to install and configure GNS3 including a couple of advanced options which will allow you to run Cisco Security Device Manager (SDM) on your PC.
Installation and Configuration
This process needs to be done only the once.
1. Download GNS3 from here and choose the installer which includes Dynamips, WinPCap and the binary version of GNS3 and install, accepting the various licence agreements etc.
2. You now need a Cisco IOS. Get one from Cisco if you have a CCO account with Support or find an IOS on Google.
3. Now open up GNS3.
Users of GNS3 version 0.5 will see the following: 
4. Now click on Step 1.
You will see something similar to the following: 
5. The executable path should point to the dynamips-wxp.exe in the Program Files directory. Change the Working Directory to a desired folder then click on the Test button. You should see that Dynamips has successfully started, if so click Apply then OK. If not you should double-check the Executable Path and the Working Directory:
6. Go back to the Setup Wizard and choose Step 2 and you should get a screen similar to below:
7. In the Settings section you need to point to the IOS image you copied in Step 2 and select the platform and model, then click on Save. The value of the IDLE PC section will be blank and leave blank for now. Now click on Close. Click on OK to close the Setup Wizard.
8. On the main screen drag a router onto the main screen then right-click on it, select Start and wait for the IOS to start and then right-click and select Console. You should now get a DOS screen open up with a telnet session for the router. NOTE: The length of time you have to wait for this to start depends on the speed and memory of your PC. 
9. Say “No” to initial configuration dialog until you get to the Router> prompt. Now type enable to go into Enable mode.
10. Go back to the GNS3 session KEEPING THE CONSOLE SESSION OPEN.
11. Type idlepc get your-router-name for example idlepc get R0 and wait for some idlepc values to be displayed. Make a note of these values and click Cancel.
12. By default Dynamips will take up 100% of your CPU usage and you need to specify an idlepc value to get that changed. Close down the console session and open up Task Manager on your PC (usually CTRL-ALT-DELETE) then go to the Performance tab.
13. Go to Edit-->IOS Images and Hypervisors and select the IOS you identified in Step 4 then click on Edit. Enter the first idlepc value you wrote down from Step 12 then click on Save then Close.
14. Start the IOS again as you did in Step 8 then console to the router. View the CPU utilisation in Task Manager and see if it falls below 5%. If it stays at 100% then go back to step 14 and change the idlepc value to the next one in the list. Repeat this until you get an idlepc value that has the CPU utilisation at around 5% or less.
You have now successfully installed and configured GNS3.
Configuring a Serial Interface on a Router
By default the 3660 image that I use comes with 2 FastEthernet interfaces. In order to simulate WAN links you need to add serial interfaces to the router as outlined below.
1. Right-click on your router, choose Configure, then click on your router name.
2. Click on the slots tab and change slot 1 (or any other slot other than slot 0) to NM-4T. This will provide you with 4 serial interfaces. NOTE THAT THE SLOT NAME MAY BE DIFFERENT DEPENDING ON WHICH IOS YOU USE.
3. Click on Apply then OK.
Adding a switch module to your router
Follow the same steps as you did for configuring a serial interface but choose the NM-16ESW module from the drop-down list.
Connecting two or more routers
You will come to the point where configuring just one router is not sufficient such as when you want to run a routing protocol. The following guidelines show you how to connect routers together.
1. Drag two or more routers onto the stage and configure their slots if required. Display their hostnames by pressing the ABC button on the toolbar if they are not already displayed.
This is a personal preference and allows you to track which router is which.
2. Now click on the interface button on the toolbar and select Manual.
The interface button changes to a red cross.
Now left-click on a router and select an interface which you want a cable connected to. Now click the router to which you want to connect to and select the interface on that router for the other end of the link. You should now see the link has been drawn. Once you have finished configuring the interfaces click the interface button (red cross) to get out of interface configuration mode (the icon will revert to the telephone jack symbol). The picture below shows three routers with a FastEthernet connection and the other with a Serial link (zig-zag line).
3. Notice that each link has got a red dot on it. When you start the IOS each dot should turn to green which denotes that each router has successfully started the IOS.
Saving your configuration
After all your hard work on the command line you will probably want to save your configuration and reuse it on another day. Follow the steps below to save your work:
1. Go to File-->Save As and save your topology where you want as a .net file. When it comes to reusing this topology just double-click on the .net file to open it up in GNS3.
2. On each router save your config using copy run start
3. Back in GNS3 type save /all in the bottom half of the screen to save all of the configs into the .net file. If you want to save the config of only one router you can replace the keyword all with the name of the router you wish to save the config of. You can also extract the configs by clicking on the "Extract all start-up configs" button on the toolbar.
Configuring a host in the network (Advanced)
There may be an occasion when you want to connect a host in your topology such as running Cisco’s Security Device Manager (use of this may figure in future CCNA exams). To do this you must first configure a Loopback Adapter on your PC.
1. Go to Control Panel-->Add Hardware then click Next
2. Yes I have already connected the hardware
3. Scroll to the bottom and click on Add a new hardware device then Next
4. Install the hardware that I manually select from a list (Advanced)
5. Click on Network Adapters then Next
6. Select Microsoft as the Manufacturer then on Microsoft Loopback Adapter under Network Adapter then click Next then Next again.
7. Open up Control Panel-->Network Connections to see the adapter in place.
Now that you have created a loopback adapter you will want to connect it to a router. To do this, follow these steps:
1. In the GNS3 installation directory run the Network Device List.bat file which will give you the Ethernet address of your Loopback Adapter.
Notice the second adapter shown where description is MS Loopback Driver. I have renamed the adapter as Loopback Adapter for SDM. We are interested in the NIO_gen_eth string.
2. Go into GNS3 and drag a cloud onto the stage.
3. Right-click the cloud and select configure.
4. Choose your cloud from the list.
5. In the Generic Ethernet NIO section select your Loopback Adapter from the drop-down list (the one that matches what is shown in Step 1) and click on Add, Apply, the OK.
6. Now connect a FastEthernet port on your router to the cloud as you would connect two routers.
7. Configure an IP address and subnet mask on the router interface connected to the cloud and bring the interface up.
8. Go to Control Panel-->Network Connections and right-click your adapter. Choose Properties then Internet Protocol (TCP/IP) and give it an IP address in the same subnet as the router’s FastEthernet interface with the same subnet mask and with a default gateway matching the IP address of the router’s interface.
Example:
Router’s FastEthernet 0/0 interface connected to the cloud:
On the router I would have something like:
Router(config)#int fa0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut
On the PC I would have something like:
IP address = 192.168.1.2
Subnet Mask = 255.255.255.0
Default Gateway = 192.168.1.1
You should now be able to ping between your PC and the router
Running SDM (Advanced)
There may be a need to practice using the Cisco Security Device Manager (SDM) for your exam and the following steps show you how to configure it.
1. Download and install SDM from the www.cisco.com or from a share on the web.
2. Choose to only install SDM to your PC, NOT to the router.
3. Now configure your router with a hostname and a domain name in order for SSH to work:
Router#conf t
Router(config)#hostname SDMRouter
SDMRouter(config)#ip domain-name SDMDomain
4. Now configure your router with the following commands:
SDMRouter(config)#username your_username privilege 15 secret 5
SDMRouter(config)#ip http server
SDMRouter(config)#ip http secure-server
SDMRouter(config)#ip http authentication local
SDMRouter(config)#line vty 0 4
SDMRouter(config-line)#login local
SDMRouter(config-line)#transport input telnet ssh
SDMRouter(config-line)#privilege level 15
SDMRouter(config-line)#line cons 0
SDMRouter(config-line)#login local
SDMRouter(config-line)#transport input telnet ssh
SDMRouter(config-line)#privilege level 15
SDMRouter(config-line)#exit
SDMRouter(config)#crypto key generate rsa gen mod 1024
5. Now double-click the SDM icon and enter the IP address of the router and tick the box asking about HTTPS then click on Launch.
6. Ensure you allow popups on your browser.
7. Enter username and password as defined after step 3.
8. Say yes to allow SDM to install.
You should now have a screen similar to the one below although this may be because I used a username and password of “cisco” which are the default.
9. Select a new username and password for the router then click OK. You should see the screen below then click OK.
10. You should now be in SDM and able to configure the router.
Posted byChris Bloomfield at 09:11 67 comments
Labels: adapter, Cisco, configuration, dynagen, dynamips, emulator, gns3, guide, idlepc, ios, loopback, microsoft, NIO_gen_eth, router, sdm