Go to http://www.gns3.net/downloadDynagen at Sourceforge and download.
Open the GNS3 package and copy it to your Applications folder.
Now you can run the GNS3 and it will tell you to install Dynagen. Dynagen is a python wrapper that simplifies the dynamips emulator.
Dynamips is basically a MIPS CPU emulation software with some code to emulate the Cisco hardware. Dynagen extends this to read a text file for the configuration and makes it easier
Copy Dynagen to your Applications Folder.
- 1 Configuring GNS3 Preferences
- 2 Working and Unzipping IOS Images
- 3 Configuring the IOS details
- 4 Setting the IDLEPC value
- 5 CPU and Memory
- 6 Wrap Up
Configuring GNS3 Preferences
I have created a directory in my Documents folder to store my GNS3 data and IOS images.
The Executable path for dynamips isn’t straightforward because it’s a file. Be default, OS X wants it to be a directory (because all programs are actually directories in OS X) so you will need to manually enter
When dynamips runs, it creates a number of files that are images of the memory etc, that the MIPS CPU emulator needs to reference about the hardware architecture and memory spaces.
I would always enable the sparse memory feature to save memory when running multiple images of the same type.
If you have everything correct, you should be able to press the TEST button and get a success message in green as shown:
I haven’t used this feature as yet and may post something on this in the future.
PEMU does not work on MAC OS X (as far as I know and these settings make no difference.). This is becuase the binary that emulates the PIX/ASA has only been compiled for the Windows and Linux platforms.
Working and Unzipping IOS Images
Cisco IOS images are compressed so as to use the least amount of flash memory. Historically, flash memory was expensive and not very large. As a result, IOS was compressed and the first thing IOS usually does these days on startup is to uncompress the image from Flash to RAM. When using GNS3/Dynagen, you can save startup time by uncompressing the IOS images.
Cisco IOS images are compressed using one of three formats, zip, mzip or STAC. The IOS image name will tell you which compression is being used. For the following filename, the letters MZ are the key:
The first letter tells you whether the image runs from flash, memory or ROM. (in the olden days, RAM was also expensive and the image would often run from flash, and only dynamic information was stored in RAM. That is, the program was always executed from Flash, not form memory. Today, RAM is cheap so the flash image is always copied to memory at boot time.)
- f – flash
- m – RAM
- r – ROM
- l – the image will be relocated at run time
and the second letter tells you what the compression type is:
- z- zip compression
- x – mzip compression
- w – ìSTACî compression
For most images, ZIP compression is used and you can use a standard software package. For those images that use mzip compression, you can download the Zipeg software which supports mzip.
When unzip the file, it is a convention to rename it with a .image extension. This makes sure you don’t confuse it with a ‘normal’ image.
Which IOS image should you use ?
Because dynagen is an emulator for the MIPS CPU, you can only images that run on Cisco router hardware that uses the MIPS processor. This means most of the older routers, and not many of the new ones. Your best bet is to use 7200 series images, but also the C1700, C2600, C2691, C3600 and C3700 families used MIPS CPU’s. The C3700 is probably your seond best bet.
Configuring the IOS details
We need to tell Dynamips where the IOS image is.
Press Shift-?-I or use the Menu, Edit, IOS Images and Hypervisors to get this screen:
Point the Image file: to the directory where you IOS images are are stored. I prefer to create a GNS directory in my Documents and a sub-directory for IOS. Thus my directory is:
You must click Save to write the parameters and it will look like:
We will set the IDLEPC in the next section but you need to leave it blank for now.
You can have multiple images for a platform, but if you are using sparsemem (as I recommend you should to save memory), then run the same image for every router. In fact, I would typically only use a single router and a single image for all my GNS3/Dynagen use.
Setting the IDLEPC value
Drag the router model that you configured in the previous section onto the screen and click the play button to start the emulator.
You need to connect to the router and move out of the of Setup mode. This is because Setup Mode uses all available CPU cycles and will cause your IDLEPC value to be wrong for normal use.
And make you sure you get out of the Automated Setup utility.
This window will pop up while dynamips calculates the unused CPU command that are being repeated (Note the “Please wait while calculating an IDLE PC” text in the corner)
Right click on the router and select the IdlePC from menu:
The system will offer a list of possible IDLEPC values, select one of the values that has a an asterisk next to it.
And now you will have an IDLE PC value configured.
CPU and Memory
There are many other sites that talk about how much CPU and Memory you need to run GNS3. But using Dynagen V0.11 and GNS3 V3.5 will use 100% of CPU. This is because the configuration file will spawn multiple dynamips hypervisors. I presumse that this allows better use of multicore processors,and is probably best for for MS Windows. For the following network layout:
Here is the Activity Monitor for my modified config. What I did was reduce the number of hypervisors created when GNS3 starts by editing the .net text file that GNS3 creates.
GNS3 will put the following text into the .net file. This text spawns another dynamips instance on the IDP port specified.
workingdir = /Users/gregferro/Documents/GNS/BE-WAN-Emulator-V1.1_working
udp = 10200
image = /Users/gregferro/Documents/GNS/IOS/c7200-advipservicesk9-mz.124-20.T1.image
idlepc = 0x61301b6c
ghostios = True
sparsemem = True
Why did I change it ?
Because each dynamips process seems to burn up 100% of CPU. I have been able to reduce this. Having four dynamips instances trying to grab CPU resources stoped me from using web browsing. By reducing the number of hypervisors to two, it works a lot more efficiently.
So there are some notes on installing and using GNS3 on Mac OS X Snow Leopard. I expect I will continue to tune and modify parts of the configuration. I have a feeling that V0.11 of dynagen works less good than the previous version I was running. i think I might give that go. However, my previous Dynamips wasn’t using GNS3 as I configured everything from the command line. GNS3 makes setting up the networks a lot easier, so I expect that I will use both the command line and GNS3 for different purposes. GNS3 for quick and dirty testing, and the command line for much larger and more complicated testing (more about how to do this here.