How to Configure Dynagen and GNS3
When studying for the many of the Cisco certifications it is best to get some amount of hands-on experience.
For many students this may be possible by simply doing their normal day-to-day jobs but for many more this opportunity is not possible. In order to fill this void there are really three main solutions: buy or rent Cisco equipment to interact with directly, purchase a Cisco simulator or run one of the dynamips emulation solutions.
While buying the equipment will get you hands-on experience, it does require a decent amount of upfront investment and may not be required if your interests are simply to understand basic Cisco configuration and technology.
There are many good simulation solutions out there (including one I worked on from Cisco Press), but the problem with some of these solutions is flexibility. Many of these simulations do quite well to simulate the environment but they are only programmed to understand the commands required in their simulations and thus don’t scale well outside of this specific set of labs.
Dynamips is a solution which emulates specific Cisco hardware; this is then used in concert with a real Cisco IOS image. These emulations do seem to be the best of the available solutions but there is a catch — technically the use of an IOS image not on a licensed Cisco device is a breach of the license (as far as I have been told). Although to my knowledge, Cisco has not gone after anyone, it should be noted. The IOS image must also be obtained through a source other than those distributing the dynamips solutions as they can’t provide this image.
At this time the two available dynamips solutions are Dynagen and GNS3.
Dynagen utilizes a text based configuration file which is used to specify the specific parameters to be used. These parameters include the IOS image location, number and name of the routers used, the specific interfaces emulated on each router, and the specific connection configuration between the routers.
Dynagen also provides access to a simulated Ethernet or Frame Relay switch which can be used to connect the various routers. These switches are simple emulations of the switches and thus do not provide the functionality of a normal Cisco switch.
GNS3 takes this a step further by allowing the user to build a lab via a Windows interface that looks similar to Microsoft Visio or similar tools. GNS3 will build the text configuration files for you and can be used later to utilize the same lab structure.
Basic Dynagen Configuration
Just to get people familiar with the Dynagen interface we will go over the configuration of a simple Dynagen lab configuration. The first thing that must be done is to locate a copy of Cisco IOS and to obtain a copy of Dynagen and install it.
Now the following includes a simple two router configuration which utilizes Frame Relay and Ethernet connections to tie them together.
Now let’s review the configuration:
- [localhost] specifies that dynamips will be running on the local machine and utilize the default port of 7200. This can be changed to another IP address or port if dynamips is not running locally.
- [] specifies the configuration to be used for the emulated 7200 router. As of this writing dynamips supports 2600 series (2610 to 2650XM, 2691), 3600 series (3620, 3640 and 3660), 3700 series (3725, 3745) and 7200 routers.
- image = Program FilesDynamipsimagesc7200-adventerprisek9-mz.124-15.T.unzip.bin specifies the location of the Cisco IOS image.
- npe = npe-400 specifies the type of Network Processing Engine used by the emulated 7200 (This is essentially the brain of the 7200 router).
- ram = 256 specifies the amount of RAM reserved for each instance of a 7200 router.
- slot0 = PA-C7200-IO-FE specifies the type of interface card which is emulated in slot0 of the 7200 router.
- slot1 = PA-4T specifies the type of interface card which is emulated in slot1 of the 7200 router.
- [[ROUTER R1]] specifies the configuration of a router named R1.
- F0/0 = S1 1 specifies that the F0/0 interface of the router will be connected to port 1 on switch S1.
- S1/0 = F1 1 specifies that the S1/0 interface of the router will be connected to port 1 on Frame Relay switch F1.
- model = 7200 specifies that this router will emulate a 7200 router and will thus use the configuration specified in that section as well.
- [[ROUTER R2]] specifies the configuration of a router named R2.
- F0/0 = S1 2 specifies that the F0/0 interface of the router will be connected to port 2 on switch S1.
- S1/0 = F1 2 specifies that the S1/0 interface of the router will be connected to port 2 on Frame Relay switch F1.
- model = 7200 specifies that this router will emulate a 7200 router and will again use the configuration specified in that section.
- [[ETHSW S1]] specifies the configuration of an Ethernet switch named S1
- 1 = access 1 specifies that port 1 on the switch will be an access port and be in VLAN 1.
- 2 = access 1 specifies that port 2 on the switch will be an access port and be in VLAN 1.
- [[FRSWF1]] specifies that configuration of a Frame Relay switch named F1
- 1:101 = 2:201 specifies that port 1 on the switch will connect using a DLCI of 101 and that it connects to port 2 on the switch with a DLCI of 201.
Of course much more complicated configurations can be created in order to emulate a number of different situations. All of the specific documentation can be found at the Dynagen website.
In order to gain access to the router instances you should use a telnet application like putty. Using the above configuration, R1 would be accessed using the IP Address 127.0.0.1 (localhost) and a port number of 2000. R2 would be accessed using the same IP address and a port number of 2001 and so on.
Basic GNS3 Configuration
Now GNS3 takes advantage of the interface of Dynagen and takes it a step further to make the creation of the lab file easier. It also adds the ability to emulate other systems including Cisco’s PIX platform and Juniper’s JUNOS but this will not be covered in this article.
Again with GNS you require a copy of Cisco IOS and a copy of GNS3 and install it. Once this is complete run GNS3, this will bring up a screen like this:
You must then configure GNS3 with the location of the IOS images so that it can reference them once the topology is created. This option is located off the edit menu:
Once in this configuration screen browse to the IOS image; once selected, GNS3 will populate the Platform with the available hardware options. From this screen you can also manually set the IDLE PC parameter (not required but helpful to limit physical memory use) and the Default device RAM parameter.
Once this is completed you should take the time to create the topology that is required using the devices on the left pane. The following shows the same topology that was created in the Dynagen section:
Once this is complete the dynamips can be started by using the play button on the top tool bar, this starts all devices and all interfaces will show as up (green):
Accessing the routers through GNS3 is done by right clicking on the target device and selecting console.
While every engineer is going to have their preferences, both of these tools work well to emulate Cisco’s IOS and are extremely helpful in preparation for many of Cisco’s certification tests.