You've all heard it before, weather it be from my mouth or a few others, use Dynagen/dynamips for your Cisco study needs. Well, for the past few years people have been consistently asking what equipment they should buy to accommodate their CCNA/CCNP training, so ive *finally* decided to create this thread to hopefully educate some of the readers here about Dynagen/dynamips.
Additions:
Please, if you would like me to add anything or if I left out something PM me and I will fix it. I would very much like for this post to be sticke'd as I feel it is 100% necessary.
What it is and is not:
Dynagen is the front end manipulation tool for dynamips
Dynamips is the backed(Server) hypervisor(if you don't know what a hypervisor is, please use google)
Dynamips is a platform dependent hypervisor, it runs REAL cisco IOS.
Dynamips is a *router* emulator
Dynagen is NOT graphical based
Dynamips is also NOT graphical
Dynamips is NOT a simulator
Dynamips will NOT emulate L3 switching
My intent for this thread is not to be redundant, so I will be linking to many sites which have done all the wet work so to speak. I want to first do a FAQ and then go over a "get er done" turorial.
FAQ:
Q: What do you mean its emulation?
A: Dynamips at its most basic form is a virtualization tool, when you build those routers, what they actually are is virtual machines. Since they run actual code, the software(IOS) is completely unaware that its being virtualizard. If you're familiar with virtualization, this is full hardware virtualization as opposed to paravirtualization.
Q: Can dynamips emulate switches?
A: Yes and no, again. Dynamips can emulate very limited switching features. You can build a 3640(or something that supports the NM-16ESW. This card will allow you to connect multiple routers together. Anything that is unsupported on the 16ESW will also be unsupported on the virtualized version. Dynamips cannot emulate any Layer 3 switching, so you will still need your 3550/3560's
Q: Can this really take me through my training?
A: Yes, this will take you from CCNA through CCIE from a router standpoint. You can also do many of the other certifications as well, including many voice certifications. Yes, dynamips can run CME
Q: How stable is it?
A: This is a training tool, for that its worth its weight in gold. As for stability, you will not notice any instability or loss of features until you get very deep into your studies(CCIE).
Q: Why should I use this, and not real gear?
A: Real gear is awesome, blinkey lights, cables,lound fans, rack space... its all sweet. Whats not is the electric bill. You need to keep that stuff running to have those blinkey lights right? The power savings alone are reason enough for most people to not have their own routers. Now, I do not recommend not ever using real gear, you need to have some kind of physical interaction with the actual equipment. For a home lab, I think that its unnecessary if you dont have the means.
Q: I like stuff with a GUI, should I use GNS3
A: Personally, I hate GNS3. If you attempt to export a net file from GNS3 into dynagen it wont work(as of a few versions ago). They add all these retarded coordinates that just dont play well with dynagen. To each their own though, if you like GNS3.. use it. I just wont cover it in this thread.
Q: Does cisco support this as a training tool.
A: Yes and No. Officially, absolutely not but unofficially.... Ive had to talk about this tool to over 100 Cisco employees already.
Last but not least,
Q: What kind of hardware do I need:
A: This might be a long one.
I get this questione PM'd to me all the time, and it really depends on what you want to get out of this home lab as well as your budget. The question that you want to ask youeself is this, "How far do I want to take my studies". Im not talking certification wise either, say that you want to test a 50 router MPVPN design then you're going to need a pretty beefy box. Also, anything with more power will allow you to run more routers...keep the basics in mind. So, at bare minimum I would recommend the following:
1 x Dual core processor
2 gigs of memory
60 gigs of hdd space(virtual router memory is stored on the disk dy default, and net files)
This is obviously barebones, and would be perfect for a CCNA pod and possibly a CCNP pod. If you decide to run it on linux, that setup might even allow you to run the CCIE pod(11 routers).
Personally, I recommend this if on a semi-tight budget:
1x quad core proc(phenom or equivilent intel)
4 gigs of memory
60 gigs
For all those that are curious, my specs are as follows(my recycled virtual box):
2x quad core xeon(5310 I think)
12 gigs of ram
a ton of hdd space(not needed)
3x 4 port NIC
For the CCIE:
Yes it can be done! and many people are doing it. See my setup above. The reason for the 12 network interfaces is that you can tie virtual router interfaces(fast ethernet/ethernet) to real physical interfaces, and you need 12 interfaces for Internetwork expert workbooks. You can do this in windows or unix/linux. This is the easiest and most cost efficient way to do a CCIE pod. Obviously you're going to need a dynamips server and the required 4 L3 switches(2x 3550, 2x3560). Here is a snippet of my configuration file, notice the mapping of virtual to physical interfaces:
Thats pretty much it, not rocket science.
DYNAGEN/DYNAMIPS GET ER DONE!:
IMAGES:
First: GET youself the desired *supported* images/platforms, they are as follows:
1710
1720
1721
1750
1751
1760
2610
2611
2620
2621
2610XM
2611XM
2620XM
2621XM
2650XM
2651XM
3660
3640
3620
2691
3725
3745
* card support is different on each.
Note: Extracting your images will greatly decrease the time in which it takes your router to load. I always recommend doing this.
Installation:
Installation is fairly easy, and completely platform dependent. I personally recommend running Dynagen on really any flavor of unix/linux. If you wish to use binaries, that's easily available but I always like to do things to good ole fashioned way. Dynagen installtion could not be easier and here is the process:
1. Head over to the dynagen sourceforge page and download the desired flavor.
http://sourceforge.net/project/showfiles.php?group_id=160317
2. Unzip/unpack and put into a directory of your choice(or install using exe for windows)
3. You're done!
Remember, this is just the front end package for dynamips. Next you're going to need to get the Dynamips server. *If you're using windows, the installer should have installed the dynamips server
Linux/unix instructions:
1. Now head over to the dynamips BLOG. Yes blog. I prefer using the blog because all of the most recent updates are always posted there by chris.
http://www.ipflow.utc.fr/blog/
2. As you can tell, the updates are pretty damn old. Grab the 0.2.8-RC2-xxx.bin
3. This is the part thats a bit shady(documentation wise), remove the .bin extension of that file for ease.
4. chomd it, I usually use 777 becuase im herendouzly lazy.
5. Load it up like you would any other exec file.
6(optional) Since Im using dynamips for CCIE study and the dynamips server will usually only run around 7 routers(nicely) with one instance, I run two seperate server instances. I will create a quick script(if you can call it that) file to call the dynamips server and create the two instances. It looks like:
dynamips -H 7201 &
dynamips -H 7200 &
For those of you who might not know, the "&" is the put the process into the background.
Congrats! We have dynamips and dynagen installed. This was a pretty quick and dirty guide, and to the point. For those of you who want some more "meat" then check out the Dynagen tutorial.
The turorial will also explain some other essentials that I will briefly go over. Since we are using dynagen as our front end we will be using a simple text editor to modify our "net" files. The net file is exactly what it sounds like, its your network file/map/diagram/whatever. Dynagen will provide you with 4 or 5 different samples of network files. I suggest that you always keep your .net files in their own seperate directories along with your dynagen working directory. Again, Im trying to not be too redundant so Im will go over the important apsects of the net file:
The Net File:
Wheww.... alright, so that's a fair bit of information to stomach but now you have your net file complete. The next thing to do is to load your dynamips server executable first, then your net file. If completed successfully you should see a => prompt. By default, all of your routers will load automagically, if this is undesired(I dont like mine starting all at once) insert this "autostart = false" to the top of EACH one of your net files.
Tuning Dynamips w/ IDLE PC Values:
This is the single most important part of dynagen/dynamips, you need to tune it. By this I mean, load up one of your routers, then when its fully complete go back to the dynagen prompt and type int the following command:
idlepc get R1(or your router name)
This will give you a list of hex values, some with a asterisk and some with none. The ones with asterisk's are preferred.
Hit the number that correlates with that hex value and watch your CPU usage drop. What you have done was tell the hypervisor to free up CPU cycles that it had reserved because the router is not doing anything. Without this, you could probably only load up around 3 routers. THIS IS EXTREMELY IMPORTANT, DO NOT SKIP THIS STEP! Next, copy that value.. thats your idlepc value for THAT specific IOS image for YOUR computer. I like to manually add my idlepc values to EACH one of my net files and not the IOS image... to do this simply add this line under your IOS definition in the net file "idlepc = 0xab1830202". Other people prefer to add it to the IOS image itself, but do not recommend it.
GhostIOS:
The GhostIOS feature is used to conserve physical RAM. By default dynamips will utilize disk space for router DRAM, which you can change if you dont want to constantly be paging, but this is how it works. Dynamips will utilize physical memory for the hypervisor process as well as the IOS image(s) that you load for each virtual router. For memory conservation you can use GhostIOS, which will load one IOS image into a shared memory location for all virtual routers to access. I definitely recommend doing if you are memory constrained and/or wish to load up a large topology of routers. Syntax is very basic, and I generally add it under my router IOS model definition.
Linkage:
http://7200emu.hacki.at/ - Essential to your path with dynamips/dynagen
http://dynagen.org/tutorial.htm
http://www.blindhog.net/tutorials/dynagen-linux-install.htm - Excellent New video tutorial by blindhog.
PS. apologies for the grammatical and spelling errors. I should be studying but am taking some time to do this.
Thanks,
Xphile
Additions:
Please, if you would like me to add anything or if I left out something PM me and I will fix it. I would very much like for this post to be sticke'd as I feel it is 100% necessary.
What it is and is not:
Dynagen is the front end manipulation tool for dynamips
Dynamips is the backed(Server) hypervisor(if you don't know what a hypervisor is, please use google)
Dynamips is a platform dependent hypervisor, it runs REAL cisco IOS.
Dynamips is a *router* emulator
Dynagen is NOT graphical based
Dynamips is also NOT graphical
Dynamips is NOT a simulator
Dynamips will NOT emulate L3 switching
My intent for this thread is not to be redundant, so I will be linking to many sites which have done all the wet work so to speak. I want to first do a FAQ and then go over a "get er done" turorial.
FAQ:
Q: What do you mean its emulation?
A: Dynamips at its most basic form is a virtualization tool, when you build those routers, what they actually are is virtual machines. Since they run actual code, the software(IOS) is completely unaware that its being virtualizard. If you're familiar with virtualization, this is full hardware virtualization as opposed to paravirtualization.
Q: Can dynamips emulate switches?
A: Yes and no, again. Dynamips can emulate very limited switching features. You can build a 3640(or something that supports the NM-16ESW. This card will allow you to connect multiple routers together. Anything that is unsupported on the 16ESW will also be unsupported on the virtualized version. Dynamips cannot emulate any Layer 3 switching, so you will still need your 3550/3560's
Q: Can this really take me through my training?
A: Yes, this will take you from CCNA through CCIE from a router standpoint. You can also do many of the other certifications as well, including many voice certifications. Yes, dynamips can run CME
Q: How stable is it?
A: This is a training tool, for that its worth its weight in gold. As for stability, you will not notice any instability or loss of features until you get very deep into your studies(CCIE).
Q: Why should I use this, and not real gear?
A: Real gear is awesome, blinkey lights, cables,lound fans, rack space... its all sweet. Whats not is the electric bill. You need to keep that stuff running to have those blinkey lights right? The power savings alone are reason enough for most people to not have their own routers. Now, I do not recommend not ever using real gear, you need to have some kind of physical interaction with the actual equipment. For a home lab, I think that its unnecessary if you dont have the means.
Q: I like stuff with a GUI, should I use GNS3
A: Personally, I hate GNS3. If you attempt to export a net file from GNS3 into dynagen it wont work(as of a few versions ago). They add all these retarded coordinates that just dont play well with dynagen. To each their own though, if you like GNS3.. use it. I just wont cover it in this thread.
Q: Does cisco support this as a training tool.
A: Yes and No. Officially, absolutely not but unofficially.... Ive had to talk about this tool to over 100 Cisco employees already.
Last but not least,
Q: What kind of hardware do I need:
A: This might be a long one.
I get this questione PM'd to me all the time, and it really depends on what you want to get out of this home lab as well as your budget. The question that you want to ask youeself is this, "How far do I want to take my studies". Im not talking certification wise either, say that you want to test a 50 router MPVPN design then you're going to need a pretty beefy box. Also, anything with more power will allow you to run more routers...keep the basics in mind. So, at bare minimum I would recommend the following:
1 x Dual core processor
2 gigs of memory
60 gigs of hdd space(virtual router memory is stored on the disk dy default, and net files)
This is obviously barebones, and would be perfect for a CCNA pod and possibly a CCNP pod. If you decide to run it on linux, that setup might even allow you to run the CCIE pod(11 routers).
Personally, I recommend this if on a semi-tight budget:
1x quad core proc(phenom or equivilent intel)
4 gigs of memory
60 gigs
For all those that are curious, my specs are as follows(my recycled virtual box):
2x quad core xeon(5310 I think)
12 gigs of ram
a ton of hdd space(not needed)
3x 4 port NIC
For the CCIE:
Yes it can be done! and many people are doing it. See my setup above. The reason for the 12 network interfaces is that you can tie virtual router interfaces(fast ethernet/ethernet) to real physical interfaces, and you need 12 interfaces for Internetwork expert workbooks. You can do this in windows or unix/linux. This is the easiest and most cost efficient way to do a CCIE pod. Obviously you're going to need a dynamips server and the required 4 L3 switches(2x 3550, 2x3560). Here is a snippet of my configuration file, notice the mapping of virtual to physical interfaces:
Code:
[[Router R2]]
model = 3640
console = 5002
slot0 = NM-1FE-TX
slot1 = NM-4T
F0/0 = NIO_linux_eth:eth1 #Physical to SW2 -> f0/2 # This is the mapping
S1/0 = FRSW 2
cnfg = /home/xphile/initial/IEWBII/Labs/r2.txt
DYNAGEN/DYNAMIPS GET ER DONE!:
IMAGES:
First: GET youself the desired *supported* images/platforms, they are as follows:
1710
1720
1721
1750
1751
1760
2610
2611
2620
2621
2610XM
2611XM
2620XM
2621XM
2650XM
2651XM
3660
3640
3620
2691
3725
3745
* card support is different on each.
Note: Extracting your images will greatly decrease the time in which it takes your router to load. I always recommend doing this.
Installation:
Installation is fairly easy, and completely platform dependent. I personally recommend running Dynagen on really any flavor of unix/linux. If you wish to use binaries, that's easily available but I always like to do things to good ole fashioned way. Dynagen installtion could not be easier and here is the process:
1. Head over to the dynagen sourceforge page and download the desired flavor.
http://sourceforge.net/project/showfiles.php?group_id=160317
2. Unzip/unpack and put into a directory of your choice(or install using exe for windows)
3. You're done!
Remember, this is just the front end package for dynamips. Next you're going to need to get the Dynamips server. *If you're using windows, the installer should have installed the dynamips server
Linux/unix instructions:
1. Now head over to the dynamips BLOG. Yes blog. I prefer using the blog because all of the most recent updates are always posted there by chris.
http://www.ipflow.utc.fr/blog/
2. As you can tell, the updates are pretty damn old. Grab the 0.2.8-RC2-xxx.bin
3. This is the part thats a bit shady(documentation wise), remove the .bin extension of that file for ease.
4. chomd it, I usually use 777 becuase im herendouzly lazy.
5. Load it up like you would any other exec file.
6(optional) Since Im using dynamips for CCIE study and the dynamips server will usually only run around 7 routers(nicely) with one instance, I run two seperate server instances. I will create a quick script(if you can call it that) file to call the dynamips server and create the two instances. It looks like:
dynamips -H 7201 &
dynamips -H 7200 &
For those of you who might not know, the "&" is the put the process into the background.
Congrats! We have dynamips and dynagen installed. This was a pretty quick and dirty guide, and to the point. For those of you who want some more "meat" then check out the Dynagen tutorial.
The turorial will also explain some other essentials that I will briefly go over. Since we are using dynagen as our front end we will be using a simple text editor to modify our "net" files. The net file is exactly what it sounds like, its your network file/map/diagram/whatever. Dynagen will provide you with 4 or 5 different samples of network files. I suggest that you always keep your .net files in their own seperate directories along with your dynagen working directory. Again, Im trying to not be too redundant so Im will go over the important apsects of the net file:
The Net File:
Code:
# Simple lab
[localhost:7201] # This is where you define your server and TCP port that the server opearates on. Default int 7200!
[[3640]] # This is your router model definition, this relates DIRECTLY to the IOS image as well.
image = \Program Files\Dynamips\images\c7200-jk9o3s-mz.124-7a.image # Path to your REAL ios image.
# On Linux / Unix use forward slashes:
# image = /opt/7200-images/c7200-jk9o3s-mz.124-7a.image
ram = 160 # Memory definitions, if you want to give routers more than their base defaults.
[[ROUTER R1]] # This is your virtual router instance definition, each name needs to be unique
s1/0 = R2 s1/0 # Your virtual router to router definitions. This one defines that Routers 1's serial 1/0 interface connects to R2's serial s1/0 interface.
model = 3640 # This defines which IOS image you're going to use for this virtual router instance. It will refrence your "[[3640]]" image definition above.
[[router R2]]
# Notice that you do NOT need to re-define R1-R2 s1/0 back to back connection. If you do, dynagen will fail to load and tell you there is a problem with your configuration file[net file].
Wheww.... alright, so that's a fair bit of information to stomach but now you have your net file complete. The next thing to do is to load your dynamips server executable first, then your net file. If completed successfully you should see a => prompt. By default, all of your routers will load automagically, if this is undesired(I dont like mine starting all at once) insert this "autostart = false" to the top of EACH one of your net files.
Tuning Dynamips w/ IDLE PC Values:
This is the single most important part of dynagen/dynamips, you need to tune it. By this I mean, load up one of your routers, then when its fully complete go back to the dynagen prompt and type int the following command:
idlepc get R1(or your router name)
This will give you a list of hex values, some with a asterisk and some with none. The ones with asterisk's are preferred.
Code:
Please wait while gathering statistics...
Done. Suggested idling PC:
0x80340d80 (count=27)
0x80623c00 (count=31)
[COLOR="Red"]* 0x8061de94 (count=29)[/COLOR]
0x8061dea8 (count=41)
0x8061e078 (count=39)
0x8061e3c0 (count=47)
[COLOR="Red"]* 0x8061e3e8 (count=25)[/COLOR]
0x8061e3ec (count=46)
0x8061e414 (count=40)
0x8061e43c (count=48)
Restart the emulator with "--idle-pc=0x80340d80" (for example)
Hit the number that correlates with that hex value and watch your CPU usage drop. What you have done was tell the hypervisor to free up CPU cycles that it had reserved because the router is not doing anything. Without this, you could probably only load up around 3 routers. THIS IS EXTREMELY IMPORTANT, DO NOT SKIP THIS STEP! Next, copy that value.. thats your idlepc value for THAT specific IOS image for YOUR computer. I like to manually add my idlepc values to EACH one of my net files and not the IOS image... to do this simply add this line under your IOS definition in the net file "idlepc = 0xab1830202". Other people prefer to add it to the IOS image itself, but do not recommend it.
GhostIOS:
The GhostIOS feature is used to conserve physical RAM. By default dynamips will utilize disk space for router DRAM, which you can change if you dont want to constantly be paging, but this is how it works. Dynamips will utilize physical memory for the hypervisor process as well as the IOS image(s) that you load for each virtual router. For memory conservation you can use GhostIOS, which will load one IOS image into a shared memory location for all virtual routers to access. I definitely recommend doing if you are memory constrained and/or wish to load up a large topology of routers. Syntax is very basic, and I generally add it under my router IOS model definition.
Code:
##################################################
#
# Instance 1
#
##################################################
autostart = true
[localhost:7200]
[[3640]]
#
# Specify 3640 IOS image on Windows here:
#
# Specify 3640 IOS image on Linux here:
image = /home/marc/dynagen/images/C3640-JK.BIN
[B][COLOR="Red"] ghostios = true[/COLOR][/B]
idlepc = 0x605050e4
Linkage:
http://7200emu.hacki.at/ - Essential to your path with dynamips/dynagen
http://dynagen.org/tutorial.htm
http://www.blindhog.net/tutorials/dynagen-linux-install.htm - Excellent New video tutorial by blindhog.
PS. apologies for the grammatical and spelling errors. I should be studying but am taking some time to do this.
Thanks,
Xphile
Last edited: