Dynamips

Basic Install “How-to” for Dynamips

The video covers the install of WinPcap, Dynamips, and the Dynamips .INI BGP lab file. Please feel free to use this video for non-commercial purposes.

Download the video here

 

The following is a basic tutorial for getting Dynamips up and running through GNS3. I tried to be thorough and short, I hope I ended up with a little of both. And a video of this is forthcoming.

Download the all in one installer from:

www.GNS3.net

Before you install, I recommend creating the directory structure you want to use. You can accept the default locations that GNS3 uses but I will be using the following locations for this tutorial.

C:\dynamips

C:\dynamips\working

C:\dynamips\images

The all-in-one installer for GNS3 is straight forward, just follow the prompts. This will install WinPcap, Dynamips, Pemuwrapper, and GNS3. WinPcap is the program that allows Dynamips to access your systems Ethernet adapter so you can transmit traffic to and from your LAN. Dynamips is the Cisco IOS emulator. And Pemuwrapper and GNS3 make up the graphical user interface. Once GNS3 is installed and you start the program, you have to jump through a couple of hoops to get it to function the way you want. The Setup Wizard will guide you through two steps.

<!–[if gte vml 1]> <![endif]–><!–[if !vml]–><!–[endif]–>

Click on Step 1 and you are presented with the GNS Preferences page (which you can access later). Select Dynamips from the list on the left and click on the “TEST” button. This will start the Dynamips engine. At this point you can also set your projects and working directories (select General from the list on the left to set the projects directory). I have set my projects directory to C:\Dynamips and working to C:\dynamips\working. Click “OK” to return to the Setup Wizard.

Click on Step 2 and you are presented with the IOS Images and Hypervisors page (again you can access this later). In the settings section, type the path to the folder you have stored the image file in the “image file” field (C:\dynamips\images). You can also browse to it by clicking the button with the three periods. Verify that the “Platform” and “Model” fields correspond to your image file and click “Save” at the bottom and then “Close” to close the Window.

Then click OK to close the Setup Wizard.

GNS3 Setup Wizard

Building your network is as simple as clicking and dragging the device you want from the Node Types list on the left. In this case I will use a 3640 image so I will click on the “Router c3600” and drag it to the center window pane. You can resize this topology field by using the scroll wheel on your mouse. Now we want to configure the device with the appropriate line card. Right click on R0 and take a minute to look at the context menu. From here you can do everything you need too; configure the device, start and stop the router, etc. To configure a device select “Configure” from the context menu and you arrive at the Node configurator window. Select R0 from the list on the left and then click on the “slots” tab. From the drop down menu for slot0, select NM-16ESW (or whatever card you wish). Currently, Dynamips does not support the switch ASIC, only routers, so this card enables us to use the router as if it were a switch. Click Apply and then OK to close the window. Repeat these steps for R1.

GNS3 Main Window

Now all you have to do is right click on the router and select “Start”…..Watch your CPU, Dynamips loves to hog all the CPU time. Fortunately, the engineers have devised a way to lasso the wild Dynamips beast and slow it down…the idle PC.

 

IDLE-PC

The idle-pc value must be calculated so that you can run multiple router instances on one physical device. Without it, Dynamips will use 100% of the CPU. To calculate the idle-pc, right click on R0 and select start. Right click again and select console. Once the router has fully booted you will see Would you like to enter the initial configuration dialog? [yes/no]: press n and then enter and you will see the Router> prompt. At this point, right click again on R0 and select IDLE-PC. Once GNS3 calculates the value, from the drop down box select the value with * next to it as that indicates the best value…watch the CPU utilization fall to nearly zero. At this point I recommend saving your work as this will create the .NET file that stores all your router information. GNS3 saves the idlepc under the individual router instance in the .NET file. But you can work around this by editing the .NET file with your favorite text editor. Close GNS3, open the .NET file with your text editor, move idlepc = 0×604c1d24 out of the router instance and place it in the image [[3640]] section. This will apply the value to all 3640’s in your .NET file. You will have to repeat this process for each image as the idlepc is image specific.

 

Once you have your routers configured with the desired cards and a calculated idlepc, you add links between devices by clicking on the link icon that looks like an RJ-45. I recommend choosing the manual option so that you can select what ports you want to use. Otherwise, it will use the lowest port number available. Go ahead and create a link or two and start configuring.

 

Saving your configurations.

 

When you start a new project, there are two options for saving your configurations. One will tell GNS3 to save the configurations; this will result in saving them in the working directory as mentioned later. The second option will export the configuration as a .cfg file. It will create a folder named the same as the .NET file and append the name with _configs. For example:

 

=> Exporting RouterName configuration to C:\Dynamips\GNS3 Tutorial_config\RouterName.cfg

 

By clicking on the save button GNS3 will save your configurations as long as you uncheck the automatically clean working directory in the Dynamips Preferences window. When you start a router for the first time, GNS3 creates a file and stores it in the working directory as follows:

 

c3600_RouterName_nvram

 

When you perform a write or copy running-config startup-config it modifies this file with the new configuration. If the automatically clean working directory checkbox is checked, it will delete all files in that directory when you close GNS3. This includes the aforementioned file. Bye-Bye configuration! So you could leave the automatically clean working directory check box checked and use the second option from the New Project window to save your configurations. However, not only does it create the new .netfilename_configs folder, it also creates a new working directory with the .NET file name appended with _working. This will change the path specifications in the .NET file. Well if you start a new project and only opt to export your configurations and not save nvrams, it will create the new .netfilename_configs but not the .netfilename_working folder. So if you really want to keep your folders and files clean. Deselect both options when starting a new project and use the Dynagen console to save your configurations. This command will actually hash the configuration and store it in the .NET file itself.

*note à I had some difficulty getting this to work properly after I successful did it the first time. If it is not working, reopen the .NET file with GNS3, make you changes but DO NOT CLICK THE GNS3 SAVE BUTTON. Just type save /all from the Dynagen console:

 

=> save /all

206-unable to extract config of VM ‘R4′

206-unable to extract config of VM ‘R5′

saved configuration from: R1

saved configuration from: R2

206-unable to extract config of VM ‘R3′

 

Why did R3, R4, and R5 fail? Because they did not have an original startup config and the router loaded the default configuration. You have to perform a write or copy running-config startup-config on all routers before you use this command.

 

=> save /all

saved configuration from: R4

saved configuration from: R5

saved configuration from: R1

saved configuration from: R2

saved configuration from: R3

 

Please post any comments or suggestions. I will have the video posted soon.

 

 

 

 

 

 

 

 

 

 

 

Advertisements

4 Responses

  1. excellent is the word ! pls keep helping

  2. Save /all worked perfect from the console. Thank you so much. You saved me lot of trouble/pain.

  3. Very useful man, thank you for sharing this information.
    I was struggling with the configuration saving problem.

  4. i love it. ty bro…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: