You are on page 1of 42

GNS3 Documentation

v0.4.1 Parts of this tutorial are taken from the excellent Dynagen tutorial by Greg Anuzelli. Intro uction........................................................................................................................! About Dynami"s.............................................................................................................! About Dynagen...............................................................................................................! Installing G#$%..................................................................................................................% I&$ Images........................................................................................................................4 'esource (tilization...........................................................................................................) *onfiguring Dynami"s Preferences...................................................................................+ *onfiguring General Preferences......................................................................................, -erminal *omman .xam"les......................................................................................./ 'unning a sim"le lab.......................................................................................................10 0orking 1ith the *onsole................................................................................................14 *alculating I le2P* values...............................................................................................13 (sing a 4rame 'elay evice............................................................................................!0 *ommunicating 1ith 'eal #et1orks................................................................................!! (sing an .thernet $1itch evice.....................................................................................!4 0I* 5o ules...................................................................................................................!+ *lient 6 $erver an 5ulti2server &"eration......................................................................!+ 5emory (sage &"timizations..........................................................................................!/ Packet *a"ture................................................................................................................!/ $ave an loa a to"ology................................................................................................%! &ther *omman s 6 4eatures...........................................................................................%4 7ar 1are *urrently .mulate .........................................................................................%4 4A8s................................................................................................................................%/

Introduction
G#$% is a gra"hical net1ork simulator that allo1s you to easily esign net1ork to"ologies an then run simulations on them. At the moment G#$% su""orts I&$ routers9 A-564rame 'elay6.thernet s1itches an PI: fire1alls. ;ou can even exten your o1n net1ork by connecting it to your virtual to"ology. -o o his magic9 G#$% is base on Dynami"s9 Pemu <inclu ing its 1ra""er= an in "art on Dynagen9 it has been evelo"e in "ython an through Py8t the G(I "art is ma e 1ith the "o1erful 8t library9 famous for its use in the >D. "ro?ect. G#$% also uses the $@G technology <$calable @ector Gra"hics= to "rovi e high Auality symbols for esigning your net1ork to"ologies.

About Dynamips
Dynami"s is a *isco router emulator 1ritten by *hristo"he 4illot. It emulates 13009 !+009 %+009 %3009 an 3!00 har 1are "latforms9 an runs stan ar I&$ images. In *hrisB o1n 1or sC This kind of emulator would be useful to: Be used as a training platform, with software used in the real world. It would allow people to become more familiar with Cisco devices, Cisco being the world leader in networking technologies; Test and experiment features of Cisco I !; Check "uickl# configurations to be deplo#ed later on real routers.

f course, this emulator cannot replace a real router, it is simpl# a complementar# tool to real labs for administrators of Cisco networks or people wanting to pass their CC$%&CC$'&CCI( exams. Although Dynami"s "rovi es a sim"le virtual s1itch9 it does not emulate Catalyst switches <although it oes emulate the #521+.$0=.

About Dynagen

Dynagen is a text2base front en for Dynami"s 1ritten by Greg Anuzelli 1hich "rovi e a se"arate &&P API use by G#$% for interfacing 1ith Dynami"s. G#$% also uses the Dynagen I#I2like configuration file format an integrates DynagenDs management *EI 1hich allo1s users to list evices9 sus"en an reloa instances9 etermine an manage i le2"c values9 "erform "acket ca"tures9 an more. If someho1 you have stumble u"on this tutorial 1ithout first fin ing the G#$%9 Dynami"s or Dynagen 1eb sites9 here they are along 1ith some other im"ortant linksC G#$%C htt"C66111.gns%.net6 Dynami"sC htt"C66111.i"flo1.utc.fr6in ex."h"6*iscoF3!00F$imulator Dynami"s Glog <1here most of the action is=C htt"C66111.i"flo1.utc.fr6blog6 Dynagen <a text2base front2en to the emulator=C htt"C66 yna2gen.sourceforge.net6 G#$% 6 Dynami"s 6 Dynagen Gug trackingC htt"C66111.i"flo1.utc.fr6bts6 7ackiBs Dynami"s 6 Dynagen 6 G#$% 4orumC htt"C663!00emu.hacki.at6in ex."h"

Installing GNS3
G#$% runs on 0in o1s9 Einux an 5ac &$ : <other "latforms not teste = an reAuires the follo1ing e"en encies to be installe if you 1ant to use it from a source archiveC 8t HI 4.%9 available on htt"C66trolltech.com6 evelo"er6 o1nloa s6At6in ex Python HI !.49 available on htt"C66111."ython.org $i" HI 4.) if you nee to com"ile Py8t9 available on htt"C66111.riverbankcom"uting.co.uk6si" Py8t HI 4.1 available on htt"C66111.riverbankcom"uting.co.uk6"yAt 0e have also "ut together an all2in2one 0in o1s installer "ackage that inclu es 0in"ca"9 Dynami"s9 Pemu1ra""er9 an a com"ile version of G#$%9 eliminating the nee to install Python9 Py8t an 8t. It also "rovi es .x"lorer JintegrationK so you can ouble2click on net1ork files in or er to run them. 0in o1s users shoul install the all2in2one 0in o1s installer "ackage. -his "rovi es everything you nee to run G#$% on local or remote machines9 exce"t an I&$ an PI:&$ image <see the next section=. Einux users shoul o1nloa Dynami"s an extract it to a suitable location. Install the G#$% e"en encies an then run G#$%. (sers on Debian6(buntu can install the

"ython2At4 "ackage or follo1 the instructions on htt"C66g"l.co e. e6os1iki6G"lco e eA"t in or er to install a G#$% . eb "ackage. #oteC If you are running Dynami"s on a 'e 7at or 4e ora system9 take a look at Dynami"s 4A8 item L! if you are ex"eriencing segfaults 1hen you try to run Dynami"s. At the moment9 5ac &$ : users have to manually com"ile the e"en encies. A binary version shoul be release soon. 7ere is a little "roce ure to install the reAuire e"en encies on 5ac &$C

1. Install the A""le Devs -ools <on your 5ac &$ : DvD or o1nloa it from an AD* account=. ;ou ?ust nee to install :co e-ools.m"kg in or er to have gcc9 make etc. !. <&nly on -iger M 10.4.x= Do1nloa "ython !.).! for 5ac&$ : on htt"C66111."ython.org6 o1nloa 6 an install it. %. Do1nloa At2mac2o"ensource24.%.4. mg on htt"C66trolltech.com6 evelo"er6 o1nloa s6At6mac an install it. 4. Do1nloa $IP on htt"C66111.riverbankcom"uting.co.uk6si"69 com"ile an install it NH"ython .6configure NHmake NHsu o make install ). Do1nloa Py8t htt"C66111.riverbankcom"uting.co.uk6"yAt69 com"ile an install it <you 1ill nee to comment &"enGE lines in the 5akefile if the com"ilation fail=. NH"ython .6configure NHmake NHsu o make install

IOS Images
Dynami"s runs real *isco I&$ images. 4rom the Dynami"s 4A8C Can #ou provide a Cisco I ! image for a )*++ to me, $o, I am not allowed to distribute I ! images. -ou will have to find one b# #ourself. This should not be a problem if #ou are a Cisco customer. &n 0in o1s9 ro" the image in C:\Program Files\Dynamips\images. ;ou can actually ro" the images any1here you 1ant9 but the sam"le labs are configure to look

here. &n Einux6(nix systems9 esignate a location to store your images an there <I like to use 6o"t6images9 but itBs your system.=

ro" them

*isco I&$ images are com"resse . -hese com"resse images 1ill 1ork ?ust fine 1ith Dynami"sO9 ho1ever the boot "rocess is slo1e significantly by this ecom"ression "rocess <?ust like on real routers=. It is recommen e that you ecom"ress the images beforehan 9 so the emulator oesnBt have to. ;ou can o this 1ith the Junzi"K utility on Einux6(nix6*yg1in as follo1sC unzip -p c7200-g6ik8s-mz.12 -2.!1."in # c7200-g6ik8s-mz. 12 -2.!1.image ;ou 1ill receive a 1arning from unzi"9 1hich you can safely ignore. &n 0in o1s you can use 0in'A' to uncom"ress images. ;ou may o1nloa a free co"y of 0in'A' at htt"C66111.1inrar.com. #ote that currently images for 1300 an !+00 routers must be uncom"resse to 1ork 1ith Dynami"s. Please9 al1ays test your I&$ image irectly 1ith Dynami"s before using it in G#$%C .$Dynamips -P %c&assis# %pa'&-'o-'&e-ios-image#

Resource Utilization
Dynami"s uses a fair amount of 'A5 an *P( in or er to accom"lish its emulation magic. If you inten to run an I&$ image that reAuires !)+ 5G of 'A5 on a real 3!00 router9 an you evote !)+ 5G of 'A5 to your virtual router instance9 it 1ill allocate !)+ 5G of 1orking set memory. Dynami"s also allocates <by efault= +4 5G of 'A5 "er instance on (nix systems <1+ 5G on 0in o1s systems= to cache PI- translations. -his 1ill be the total 1orking set sizeQ by efault the amount of your systemBs actual 'A5 use 1ill ty"ically be significantly less. -his is because9 by efault9 Dynami"s uses memory ma""e files for the routersB virtual memory. In the 1orking irectory you 1ill see tem"orary JramK files eAual to the size of the virtual routersB 'A5 size. ;our &$ 1ill naturally cache in 'A5 the sections of the mma" files that are being use . <$ee the 5emory (sage &"timizations section for configuration o"tions that can significantly re uce memory utilization=.

If you have "lenty of 'A59 an you kno1 1hat you are oing9 uncheck J.nable mma" featureK in the Dynami"s "references. Dynami"s also uses a lot of *P( "o1er9 because it is emulating a routerBs *P( instruction2by2instruction. It initially has no 1ay of kno1ing 1hen the virtual routerBs *P( is i le9 so it utifully executes all the instructions that make u" the I&$Bs i le routines 2 ?ust as it 1oul execute the instructions that "erform JrealK 1ork. Gut once you have run through the JI le2P*K "rocess for a given I&$ image9 *P( utilization ecreases rastically. 5ore on this very im"ortant to"ic later.

Configuring Dynamips references


-o use Dynami"s in G#$%9 you must configure the "ath to it an the base "ort. -hese settings 1ill be use by the 7y"ervisor 5anager an to loa .net files. Go to Preferences on the . it menuC

-he 1orking irectory is 1here all the files generate by Dynami"s are store 9 these inclu e the #@'A5 for the virtual router9 as 1ell as the bootflash9 logfiles9 an some other 1orking files &"tionsC

J.nable s"arse memory featureK is to globally use <or not= the Dynami"sDs s"arsemem feature <see 5emory (sage &"timizations section for more etails=. J.nable mma" featureK is to globally use <or not= the Dynami"sDs mma" feature <see 'esource (tilization section for more etails=. J.nable ghost I&$ featureK is to globally use <or not= the Dynami"sDs ghost feature <see 5emory (sage &"timizations section for more etails= -he 7y"ervisor 5anager is use to run your hy"ervisors internally in G#$%9 1hich means you onDt nee to start them manually. -his manager also hel"s to a ress the memory usage limit "er "rocess "roblem 1hen running many I&$ instances on a single hy"ervisor <see 4A8 to learn more about this issue= by Jloa 2balancingK instances on multi"le hy"ervisors. EetDs look at an exam"le of ho1 it 1orksC 0e 1ant to run ) I&$ instances 1hich uses !)+ 5G each an 1e configure the memory usage limit "er hy"ervisor setting to )1! 5G. 0hen 1e start the lab9 the hy"ervisor manager 1ill create % hy"ervisor "rocesses base on the follo1ing formula <you must roun to the next highest 1hole number=C number of hy"ervisors I <!)+ O ) 6 )1!= -he 7y"ervisor 5anager assigns the first ! instances to the first hy"ervisor9 the next ! to the secon hy"ervisor9 an the last instance on the thir hy"ervisor.

-here are t1o other settings in the Dynami"s "references. J(DP incrementationK tells the hy"ervisor manager ho1 to increment the Dynami"s base u " "ort for each hy"ervisor "rocess create <so if the base u " "ort is 10000 in Dynami"s "references an the incrementation is 1009 then for % hy"ervisors this 1ill set the base u " to 10000 for the first hy"ervisor9 10100 for the secon an so on=. #oteC more information on (DP issues can be foun in the J*lient 6 $erver an 5ulti2 server &"erationK section. -he o"tion J(se the hy"ervisor manager 1hen im"ortingK is use 1hen loa ing a to"ology file <.net= in G#$%. If this o"tion is checke an in the .net file you have efine hy"ervisors to run on localhost9 then G#$% consi ers that those hy"ervisors nee to be starte by the 7y"ervisor 5anager. If not checke 9 those hy"ervisors are recor e as external hy"ervisors an must be manually starte .

Configuring General references


-o allo1 you to connect to the virtual router consoles9 you also must configure the terminal comman .

G#$% 1ill "ro"ose you a efault comman but you can set a custom one. -he follo1ing substitutions are "erforme C Rh I host R" I "ort R I evice name ;ou have the choice to launch your comman through a shell <cm .exe by efault on 0in o1s or any comman line inter"reter set in R*&5$P.*R environment variable=.

Terminal Command Examples


&n 0in o1s <1ithout cm .exe=C -erra-erm $$7 usersC C:\Program Files\!!()*P)+\''ss&.e,e -& -p $./-0 $!/1 Pu--; usersC C:\Program Files\Pu!!1\pu''y.e,e -'elne' -& -p

$ecure*'- usersC s'ar' C:\Program Files\2ecureC)!\2ecureC)!.(3( $scrip' c:\Program Files\0ynamips\securecr'.4"s $arg -0 $! $'elne' -& -p &n EinuxC

5 sleep 1

Gnome usersC gnome-'erminal -' 6 7 name 7 6 -e 8'elne' 6 &os' 7 6 6 7 s'r9por': 7 68 # $0e4$null 2#51 5 &n 5ac &$ :C

0ith -erminalC $usr$"in$osascrip' -e 8'ell applica'ion 6!erminal6 'o 0o scrip' ;i'& comman0 6'elne' -& -p < e,i'68 -e 8'ell applica'ion 6!erminal6 'o 'ell ;in0o; 1 'o se' cus'om 'i'le 'o 6-068 0ith i-erm 1ith name tabsC 6usr$"in$osascrip' -e 8'ell app 6i!erm68 -e 8ac'i4a'e8 -e 8se' my'erm 'o '&e =irs' 'erminal8 -e 8'ell my'erm8 -e 8se' mysession 'o 9make ne; session a' '&e en0 o= sessions:8 -e 8'ell mysession8 -e 8e,ec comman0 6'elne' -& -p68 -e 8se' name 'o 6-068 -e 8en0 'ell8 -e 8en0 'ell8 -e 8en0 'ell8

Running a simple la!


In this section 1e are going to gui e you on ho1 to run a three routers lab ste"2by2ste". &nce G#$% is starte an if it is the first time you run it "lease see J*onfiguring Dynami"s PreferencesK section. 4irst you have to recor at least one I&$ image by selecting . it 2H I&$ images from the menu <or "ressing *-'E S $7I4- S I=. -hen set the "ath to an I&$ image9 choose the "laform an the chassis <if a""licable= an in"ut an IDE. P* value if you have it. Gy efault9 you are using the integrate hy"ervisor <the ynami"s "rocesses manage by G#$%= to run your I&$.

If you 1ant to use external hy"ervisors <starte by yourself=9 you can recor them in the J7y"ervisorsK tab <see the J*lient 6 $erver an 5ulti2server &"erationK section for more information=. All of these in icate I&$ systems an hy"ervisors are save in your gns%.ini file9 so you ?ust have to recor them once. #oteC the gns%.ini file is locate in %APPDATA% or %COMMON_APPDATA% Windows and $HOME/.gns3/ or /etc/gns3/ on Lin !/"ni!. on

#o1 you can create your net1ork to"ology by rag DnD ro""ing no es from the list on the left to the scene on the right.

&nce your to"ology is create 9 you may configure your no es <right2click a no e an choose configure=. ;ou may a""ly the same settings for every router by selecting J'outersK in the left tree or for s"ecific routers by selecting their hostname in the tree.

In the no e configurator you can select the I&$ to use an configure many other things like the startu"2config9 the 'A5 size9 the slots etc. #ext9 a links bet1een your no es <click the JA a linkK button on the menu bar9 select your source no e an then your estination no e=. ;ou 1ill notice that you can choose the ty"e of link <.thernet9 serial ...=. If you o G#$% assigns automatically the right mo ules for your corres"on ing link ty"e in the slots of your routers an chooses the first available interface to connect the link. ;ou may manually choose the interface to connect your link by choosing the manual metho from the ro"2 o1n menu. Gut kee" in min that you must then configure the slots on your routers manually as 1ell.

#oteC use interfaces are marke in greenQ unuse interfaces are marke in re . ;our net1ork to"ology 1ith all settings is then create on the hy"ervisor<s=. ;ou can start6sto"6sus"en an I&$ instance by right2clicking on a no e. If you have starte the I&$9 you may also go to a console session for the evice. #oteC multi"le no es may be selecte in or er to "erform the o"eration on those no es at the same time.

&nce connecte 1ith by console to your routers9 you can assign a""ro"riate IP a resses to the serial interfaces <you can see the connecte interfaces by looking at the to"ology summary on the right or by letting your mouse hover over a link=9 an Jno shutK them9 because they are in ee connecte .

"or#ing with the Console


#oteC the *onsole "ane at the bottom is only available 1hen you are in emulation mo e. 4rom the *onsole9 use the help comman to see a list of vali comman sC

-o get hel" on a "articular comman 9 either ty"e help command or command $. 4or exam"leC

-o J"o1er offK a virtual router9 use the stop comman . 7el" sho1s the syntax asC s'op >$all ? rou'er1 @rou'er2A ...B -o shut o1n a single router9 ty"e stop routernameC

An sure enough9 the router is no1 sto""e C

;ou can also "rovi e a list of routers to sto"9 or issue stop %all to shut o1n all router instances. -o restart '19 use the start comman C s'ar' >$all ? rou'er1 @rou'er2A ...B

-he I&$ reloa comman is not su""orte by Dynami"s in virtual routers. $o you can use the console reload comman . It "erforms a sto"9 follo1e by a start. -o reloa all routers in the entire lab9 issue a reload %all comman C

-he suspend an resume comman s have a syntax similar to sto" an start9 but they tem"orarily "ause the s"ecifie routersC

-he e&it comman sto"s an eletes all evices from the net1ork9 an s1itches to esign mo e. If you exit the *onsole9 your simulation 1ill no longer be running.

Calculating Idle' C (alues


;ou may have notice that your "revious simulations cause your systemBs *P( to "eg at 100R an stay there. -his is because Dynami"s oes not kno1 1hen the virtual router is i le an 1hen it is "erforming useful 1ork. -he Ji le"cK comman "erforms analysis on a running image to etermine the most likely "oints in the co e that re"resent an i le loo" in I&$. &nce a""lie 9 Dynami"s Jslee"sK the virtual router occasionally 1hen this i le loo" is execute 9 significantly re ucing *P( consum"tion on the host 1ithout re ucing the virtual routerBs ca"acity to "erform real 1ork. 7ere is ho1 the "rocess is "erforme . 4irst9 create a single router corres"on ing to the I&$ image you 1ant to calculate its i le"c. -hen start your router an telnet to the running router instance. If you are "resente 1ith I&$ autoconfig "rom"t9 res"on 1ith JnoK.

0ait for all of the interfaces to initialize. -hen it enter to see the I&$ "rom"t.

#o19 s1itch back to G#$% o a right click on the router an select JI le P*K ;ou 1ill see a screen that statistics are being gathere 9 an about 10 to !0 secon s later you shoul see a 1in o1 1hich contains a list of "otential i le"c valuesC

@alues that 1ill most likely "rovi e better results are marke 1ith an asterisk. $elect one of the values to try from the menu an "ress the &> button. ;ou shoul notice your host <the one running the ynami"s "rocess= *P( utilization ro" ramatically. -hen enter exit on the I&$ console9 the *P( utilization shoul not rise. If so9 youBve foun a goo i le"c value for this "articular I&$ image. If your *P( usage i not ro"9 itBs time to try a ifferent value < o a right click on the router9 you o not nee to calculate the i le "c this time= an test again 1hen logge an not logge . I le2P* values are "articular to an I&$ image. -hey 1ill be ifferent for ifferent I&$ versions9 an even for ifferent feature sets of the same I&$ version. 7o1ever I le2P* values are not "articular to your host P*9 o"erating system9 or to the version of ynami"s. It is "ossible that ynami"s 1ill not be able to fin an i le"c value for an image9 or that the values it oes fin o not 1ork. If this ha""ens9 try re"eating the "rocess again. &r you ?ust might be out of luck 1ith that "articular image <ho1ever running into this situation is rare.=

Using a )rame Relay de(ice


Dynami"s <an accor ingly G#$%= "rovi es su""ort for an integrate s1itch. Eooking at a frame relay labC frame relay

0e have connecte the routersB serial interfaces to "orts 19 !9 an % res"ectively on a 4rame 'elay s1itch name J40K.

-hrough the #o e configurator 1e assigne a local DE*I of 10! on "ort 19 1hich ma"s to a DE*I of !01 on "ort !. -he other t1o entries are configure similarly9 thereby creating a full mesh of P@*s bet1een the three routers. <10% T2H %019 an !01 T2H %0!=. #oteC -he 4rame 'elay s1itch emulate by Dynami"s uses an E5I ty"e of A#$I Annex D9 not *isco. Eaunching the lab sho1s the follo1ingC

-he 4rame 'elay s1itch 40 is liste 9 but you canBt sto"9 start9 sus"en 9 or resume it like you can 1ith virtual routers.

-he A-5 s1itch evice can be configure in the same 1ay.

Communicating with Real Networ#s


Dynami"s can bri ge virtual router interfaces 1ith real host interfaces9 allo1ing your virtual net1ork to communicate 1ith the real 1orl . &n Einux systems9 this is one 1ith the #I&FlinuxFeth #I& <#et1ork In"ut &u"ut= escri"tor. -o use this feature 1ith G#$% you must create a J*lou K evice. A clou re"resents your external connections. -hen you must configure it. In this exam"le 1e a e the #I&FlinuxFeth0 #I&C

-hen you can connect your clou to a router or a .thernet s1itch. In the follo1ing image 1e bri ge the routerBs e060 interface to the eth0 interface on the host. Packets that exit e060 are um"e out onto the real net1ork through eth09 an return "ackets are for1ar e back to the virtual router instance accor ingly.

&n 0in o1s systems9 the 0in"ca" library is use to accom"lish this bri ging. -he interface format is a little more com"lex than on Einux systems. G#$% 1ill "erform an auto2 etection 1ith the hel" of Dynami"s to list the available interfaces. If the etection i not 1ork9 use the shortcut create by the G#$% 0in o1s installer <thanks to Dynagen=. In "rogram menu9 o"en the J#et1ork Device EistK shortcutC

$o on my 0in o1s system9 I 1oul useC \De4ice\CPFD>E00FG8DD-F10E- GE -HHF -E F078 8 87B

to bri ge to my local .thernet a a"ter. ;ou ?ust nee to "ut this value in the Generic .thernet #I& text box 1hen configuring your J*lou K evice. $elect the evice from the ro" o1n box9 or "aste it into the 1hite box to the left of the A button from the J#et1ork Device EistK shortcut. -hen click the A button to "lace the "ro"er evice into the 1hite box belo1 the A button.

Using an *thernet Switch de(ice


Dynami"s also "rovi es an integrate virtual .thernet s1itch that su""orts @EA#s 1ith ,0!.1A enca"sulation. Eooking at this labC

Port 1 of the s1itch <connecte to '1 e060= is an access "ort in @EA# 1. Port ! is also an access "ort. Port 4 is a trunk "ort <s"ecifie 1ith the ot1A key1or = 1ith a native @EA# of 1. -runk "orts trunk all the @EA#s kno1n to the s1itch.

Gy efault in G#$%9 a s1itch has , access "orts configure in @EA# 1.

;ou can also connect a s1itch"ort to the Jreal 1orl K by connecting the s1itch to a J*lou K evice. 7ere 1e are connecting a trunk "ort < otA1 enca"sulation= 1ith a native vlan of 1 to the hostBs eth19 or 0in o1s net1ork evice using the #I&FgenFeth 0in"ca" #I& <see *ommunicating 1ith 'eal #et1orks section=. If this host interface is connecte to a real s1itch that is configure for trunking9 you can no1 easily connect any router instance to any @EA# you 1ish. -he console inclu es *EI comman s to sho1 an clear the 5A* a ress tables of virtual .thernet s1itches. -hose comman s are show mac Ethernet_switch_name an clear mac ethenet_switch_name.

"IC +odules
Dynami"s 0.!.,2'*1 a e su""ort for several 0I* mo ules. *urrently9 these are the 0I*21- an 0I*2!- on the 13009 !+009 !+/1 an %300 "latforms9 an the 0I*21.#.on the 1300. $ee the 7ar 1are *urrently .mulate section for s"ecific mo el info an ho1 many 0I* slots are "rovi e on each "latform. #oteC In G#$%9 once a 0I* is inserte in a router9 it cannot be remove .

Client % Ser(er and +ulti'ser(er Operation


-he Dynami"s J7y"ervisorK mo e that is use by G#$% is a -*P6IP communications channel9 so G#$% can run on a ifferent machine than the Dynami"s emulator. -his is one by manually s"ecifying a hy"ervisor in the JI&$ images an hy"ervisorsK 1in o1.

7ere 1e recor e a ne1 hy"ervisor 1hich 1ill listen on "ort 3!00 on the JremoteFhostK machine. ;ou can also s"ecify the fully Aualifie "ath to the 1orking irectory 1here the hy"ervisor 1ill store all of its generate files on the Dynami"s host. #oteC you must use a D#$ name or an IP a ress in the host text box.

JGase (DPK is the base "ort for (DP #I&s that Dynami"s uses to make the connections bet1een your no es. Dynami"s 1ill use a (DP "ort for each en of a link. 4or exam"le9 six (DP "orts are use for a full meshe lab of % routers an a base u " of 10000. 7ere is an out"ut of the netstat comman that sho1 you the connections bet1een the no es an the (DP "ort "icke u" by Dynami"sC
udp udp udp udp udp udp 0 0 0 0 0 0 0 localhost:10000 0 localhost:10001 0 localhost:10002 0 localhost:10003 0 localhost:10004 0 localhost:10005 localhost:10001 localhost:10000 localhost:10003 localhost:10002 localhost:10005 localhost:10004 ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED

#o1 letDs imagine you 1ant to run t1o connecte I&$ instances 1hich are se"arately create on ! ifferent hy"ervisors on the same host an you choose the same (DP base for the hy"ervisors. .ach hy"ervisor 1ill try to take the same (DP "ort <10000 in the "revious exam"le= for each en of the connection an 9 of course9 this 1ill Jcolli eK because Dynami"s thinks they are ifferent servers an therefore those (DP "orts are safe to re2use. JGase consoleK is the -*P base "ort that the hy"ervisor 1ill use 1hen you o"en a console on an I&$. -his value shoul nDt Jcolli eK because G#$% uses the follo1ing formula to affect a console "ort to each routerC Jbase "ortK S router i <1hich is uniAue=. $o it is safe to let the same value for every hy"ervisor. &nce your hy"ervisors are recor e 9 your can bin them to your I&$ images. $elect your image9 uncheck the J(se the hy"ervisor managerK o"tion9 an then choose your hy"ervisor in the list. #o1 every router that is configure 1ith this I&$ image is able to communicate 1ith that hy"ervisor.

#oteC be sure that any host2base fire1alls running on all your Dynami"s servers <for exam"le9 :P $P!Bs fire1all= are "ermitting the necessary traffic. -his inclu es the Dynami"s server "ort < efaults to -*P 3!00=9 the console "orts <e.g. -*P !0009 !0019 U= an the "orts use by the #I& connections bet1een interfaces9 1hich start at (DP 10000 an 1ork u" from there.

+emory Usage Optimizations


As escribe in the 'esource (tilization section9 your labs can consume a large amount of real an virtual memory. -he JghostiosK an Js"arsememK o"tions 1ere a e to a ress both of these issues9 res"ectively. -he Ghostios o"tion can significantly re uce the amount of real host 'A5 nee e for labs 1ith multi"le routers running the same I&$ image. 0ith this feature9 instea of each virtual router storing an i entical co"y of I&$ in its virtual 'A59 the host 1ill allocate one share region of memory that they 1ill all utilize. $o for exam"le9 if you are running 10 routers all 1ith the same I&$ image9 an that image is +0 5G in size you 1ill save /O+0 I )40 5G of real 'A5 1hen running your lab. .nabling ghostios is as sim"le as checking a checkbox in the Dynami"s "references. -his o"tion is activate by efault an a""lie to all router instances in the lab. 0hen enable 9 you 1ill notice a itional files in the same irectory as you router nvram files 1ith names like Jc%++02ik/o%s2mz.1!4210.image.ghostK. -his is the nma"Be file that contains the share memory region. -he other files ty"ically create 1ith a router instance are create as 1ell <log9 nvram9 an "ossibly bootflash files=. 5easuring the amount of host memory save 1ith ghostios can be a little tricky ue to the com"lexities of memory management in mo ern &$s. $ee this sticky "ost in the General section of 7ackiBs 4orum title J(n erstan ing memory usage an 'A5 GhostingK for the gory etails. -he Js"arsememK feature oes not conserve real memory9 but instea re uces the amount of virtual memory use by your router instances. -his can be im"ortant9 because &$ limits a single "rocess to ! GG of virtual memory on %!2bit 0in o1s9 an % GG on %!2bit Einux. 4or exam"le9 on 0in o1s9 after the @5 s"ace is use by cyg1in an other libraries ynami"s e"en s on9 this only leaves room for 4 router instances V !)+ 5G eachW .nabling s"arsemem only allocates virtual memory on the host that is actually use by the I&$ in that router instance9 rather than the entire amount of 'A5 configure . -his can allo1 you to run more instances "er ynami"s "rocess before you have to resort to running multi"le ynami"s "rocesses. $ee this 4A8 item for more info on this issue.

ac#et Capture

Dynami"s 6 G#$% can ca"ture "ackets on virtual .thernet or $erial interfaces an 1rite the out"ut to a ca"ture file for use 1ith a""lications like tc" um"9 0ireshark9 or any other a""lication that can rea the lib"ca" ca"ture file format. *onsi er three routers in series9 Jr1K an Jr!K are connecte via an .thernet cable9 an r! connects to r% via a "oint2to2"oint serial connection 1ith 7DE* enca"sulation. -o begin ca"turing traffic at r1Bs f060 interface an to 1rite it to the file Jr1.ca"K9 enter the follo1ing in the console 1in o1 cap'ure r1 =0$0 r1.cap or o a right2click on the link 1here you 1oul like to ca"ture the traffic <"rovi e you configure ca"ture "references=. -o vie1 the traffic in real2time9 o"en the file 1ith 0iresharkC

-he ca"ture is continuing to 1rite "ackets to the out"ut file. If 1e "ing r! from r19 then hit the Jreloa this ca"ture fileK icon 1e seeC

-o sto" ca"turing "ackets9 enter no cap'ure r1 =0$0 or o a right2click on the link 1here you are ca"turing traffic. Dynami"s 6 G#$% can ca"ture "ackets at serial interfaces too. In this case 1e must also s"ecify the enca"sulation 1e are using on our routers9 so 0ireshark 1ill kno1 ho1 to eco e the "ackets. &ur enca"sulation o"tions are 4' <4rame2'elay=9 7DE*9 or PPP. -o ca"ture some traffic on our 7DE* enca"sulate r! to r% link useC cap'ure r2 s1$0 r2.cap IDJC #o1 1e can o"en r!.ca"9 an the eco e looks like thisC

#o1 en the ca"ture 1ith Jno ca"ture r! s160K. #ote that you can have multi"le ca"tures running simultaneously against ifferent interfaces on ifferent routers.

Sa(e and load a topology

G#$% can save an loa your net1ork to"ologies in the Dynagen I#I2like configuration format <.net extension=. -his means that you can use the same files for both G#$% an Dynagen.

In the follo1ing exam"le 1e create a to"ology of % routers <!+10 chassis= an 1e save it in emulation mo e. A efault I&$ image for the !+10 chassis has been configure .

7ere is the result save in the .net fileC


au'os'ar' / False @local&os':7200A ;orking0ir / $'mp @@2610AA image / $&ome$grossmK$L+2$c2600-i-mz.12G-2 ."in.e,'rac'e0 i0lepc / 0,60"=a7H g&os'ios / !rue @@)+M!() )1AA mo0el / 2610 e0$0 / )G e0$0 slo'1 / C*- ( e1$0 / )2 e1$0 , / -1H7.N H206N11 y / -16 .1H2G881NN @@)+M!() )2AA mo0el / 2610 e0$0 / )G e1$0 slo'1 / C*- ( e1$0 / )1 e1$0 , / 172. N07HG 8H y / -21N.1H2G881NN @@)+M!() )GAA mo0el / 2610 e0$0 / )1 e0$0 slo'1 / C*- ( e1$0 / )2 e0$0 , / -G.N H206N1117

y / 111.8076118 N

;ou can no1 loa this to"ology in Dynagen or G#$%. #oteC see DynagenDs tutorial to learn more about the .net file format.

Other Commands % )eatures


7ere are some a itional comman s that can be use in the console that are not ex"laine in this tutorial. 'efer to the online hel" <command $O or &elp command= for usageC im"ort 6 ex"ort M Im"orts an ex"orts router configs from nvram to text files on your host. *an be use to get a co"y of your current configs9 or as a Jsna"shottingK feature to save your router configs before you make changes. "ush 6 save M 5uch like im"ort an ex"ort9 but the configs are store as base+4 enco e JblobsK right in your net1ork file <s"ecifie 1ith the JconfigurationK o"tion=. -his allo1s you to istribute an entire lab 1ith the net1ork to"ology an I&$ configs all in a single .net file filter M A""lies a connection filter to an interface. *urrently the only filter su""orte by ynami"s is JfreAF ro"K9 1hich ro"s x out of every y "ackets across a link <simulating intermittent "acket loss=. sen M (se to sen ra1 hy"ervisor comman s to ynami"s <see '.AD5..hy"ervisor inclu e 1ith the ynami"s source for ocumentation on hy"ervisor comman s=. -hese hy"ervisor comman s are ho1 G#$% communicates 1ith Dynami"s. -his comman 1oul ty"ically only be use if evelo"ing ne1 features in ynami"s9 ex"erimenting9 or sim"ly curious. ver M out"uts the version of Dynagen being use 9 as 1ell as the versions of each ynami"s instance Dynagen is connecte to. hist M *onsole comman history <like JhistoryK in bash= Also be sure to kee" u" on Dynami"s evelo"ment by follo1ing the technical blog at htt"C66111.i"flo1.utc.fr6blog6 for the latest evelo"ments.

,ardware Currently *mulated

Gorro1e from ggeeBs excellent "ost on 7ackiBs forumC IIIIIIIIIII1300sIIIIIIIIIII -.-/ $lotsC 0 <available= 0I* slotsC 0 *I$*&131025G214.21. <1 4ast.thernet "ort an 1 .thernet "ort9 automatically use = #ote9 interfaces o not use a slot esignation <e.g. Jf0K= -.0/ #ote9 interfaces o not use a slot esignation <e.g. Jf0K= -.0#ote9 interfaces o not use a slot esignation <e.g. Jf0K= -.1/ #ote9 interfaces o not use a slot esignation <e.g. Jf0K= -.1-.2/ $lotsC 0 <available= 0I* slotsC ! *130025G21.-7 <1 4ast.thernet "ort9 automatically use = *ar sC 2 0I*21- <1 $erial "ort= 2 0I*2!- <! $erial "orts= 2 0I*21.#.- <1 .thernet "orts= IIIIIIIIIII!+00sIIIIIIIIIII 02-/ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G21. <1 .thernet "ort9 automatically use = 02-$lotsC 1 <available=

0I* slotsC ! *I$*&!+0025G2!. <! .thernet "orts9 automatically use = 020/ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G214. <1 4ast.thernet "ort9 automatically use = 020$lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G2!4. <! 4ast.thernet "orts9 automatically use = 02-/3+ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G214. <1 4ast.thernet "ort9 automatically use = 02--3+ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G2!4. <! 4ast.thernet "orts9 automatically use = 020/3+ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G214. <1 4ast.thernet "ort9 automatically use = 020-3+ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G2!4. <! 4ast.thernet "orts9 automatically use = 021/3+ $lotsC 1 <available= 0I* slotsC ! *I$*&!+0025G214. <1 4ast.thernet "ort9 automatically use = 021-3+ $lotsC 1 <available= 0I* slotsC !

*I$*&!+0025G2!4. <! 4ast.thernet "orts9 automatically use = *ar sC 2 #521. <.thernet9 1 "ort= 2 #524. <.thernet9 4 "orts= 2 #5214.2-: <4ast.thernet9 1 "ort= 2 #521+.$0 <.thernet s1itch mo ule9 1+ "orts= 2 #52#A5 2 #52ID$ 2 0I*21- <1 $erial "ort= 2 0I*2!- <! $erial "orts= IIIIIIIIIII%+00sIIIIIIIIIII 322/ $lotsC + <available= 324/ $lotsC 4 320/ $lotsC ! *ar sC 2 #521. <.thernet9 1 "ort= 2 #524. <.thernet9 4 "orts= 2 #5214.2-: <4ast.thernet9 1 "ort= 2 #521+.$0 <.thernet s1itch mo ule9 1+ "orts= 2 #524- <$erial9 4 "orts= 2 Eeo"ar 2!4. <*isco %++0 4ast.thernet in slot 09 automatically use = IIIIIIIIIII%300sIIIIIIIIIII 025- <-he !+/1 is essentially a %300 1ith 1 slot= $lotsC 1 <available= 0I* slotsC % 3.01

$lotsC ! <available= 0I* slotsC % 3.41 $lotsC 4 <available= 0I* slotsC % *ar sC 2 #5214.2-: <4ast.thernet9 1 "ort= 2 #524- <$erial9 4 "orts= 2 #521+.$0 <.thernet s1itch mo ule9 1+ "orts= 2 G-/+10024. <! integrate "orts9 automatically use = 2 #52#A5 2 #52ID$ 2 0I*21- <1 $erial "ort= 2 0I*2!- <! $erial "orts= IIIIIIIIIII3!00sIIIIIIIIIII 3!0+ $lotsC + <available= *hassis ty"esC 2 $-D 2 @:' #P.sC 2 #P.2100 2 #P.21)0 2 #P.213) 2 #P.2!00 2 #P.2!!) 2 #P.2%00 2 #P.2400 2 #P.2G! <'eAuires the use of #P.2G! I&$ images=

*ar sC 2 *3!002I&24. <4ast.thernet9 slot 0 only= 2 *3!002I&2!4. <4ast.thernet9 ! "orts9 slot 0 only= 2 *3!002I&2G. <Gigabit.thernet9 slot 0 only= 2 PA24.2-: <4ast.thernet= 2 PA2!4.2-: <4ast.thernet9 ! "orts= 2 PA24. <.thernet9 4 "orts= 2 PA2,. <.thernet9 , "orts= 2 PA24-S <$erial9 4 "orts= 2 PA2,- <$erial9 , "orts= 2 PA2A1 <A-5= 2 PA2P&$2&*% <P&$= 2 PA2G. <Gigabit.thernet= PI: fire1all eviceC 2 ) .thernet interfaces

)67s
How do I determine idle pc values from !"#$

$ee the J*alculating I le2P*K values section in this tutorial.

%hen I try to run more than & router instances ' ()* +, each -or * instances ' .*/ +, each0 on %indows1 or more than 2 instances ' ()* +, each -or .. instances ' .*/ +, each0 on #(3bit 4inux Dynamips crashes5
-his "roblem shoul nDt occur if you use the 7y"ervisor 5anager <use by efault= 1ith correct settings -his hy"ervisor is esigne to Jloa 2balanceK your I&$ instances on multi"le Dynami"s "rocesses9 but if you use hy"ervisors on your o1n on remote hosts9 the "roblem is ue to a "er "rocess memory limit.

Gy efault9 0in o1s has a ! GG "er "rocess limit that <after inclu ing the memory use by the virtual router 'A59 cyg1in9 libraries9 an Xscratch s"aceK= that you are bum"ing u" against. %!2bit Einux has a % GG "er "rocess limit by efault. -he solution is to run multi"le instances of Dynami"s on the same system listening on ifferent control "orts like soC &n 0in o1sC start 6belo1normal 6min YDynami"sY Y ynami"s.exeY 27 3!00 start 6belo1normal 6min YDynami"sY Y ynami"s.exeY 27 3!01 &n Einux6(nixC nice ynami"s M7 3!00 Z nice ynami"s M7 3!01 Z -hen correctly recor those hy"ervisors in G#$% <see *lient 6 $erver an 5ulti2server &"eration=

I have a complex lab with several routers1 and my serial interfaces are flapping1 eigrp neighbor ad6acencies are failing1 show run and write mem ta7es forever5
-his is most likely a "erformance issue 1ith the host P*. Earge labs consume lots of 'A5 an *P(. Gy efault9 the routerBs D'A5 is simulate as a isk file of the same size as the allocate 'A5. -he host &$Bs caching features 1ill naturally try to kee" the most commonly access "ages in 'A5. Gut as your 'A5 runs lo19 isk thrashing 1ill begin. -he virtual routers then become Jstarve K for the *P( an start missing various hellos an such. -here are several o"tions for resolving thisC (se a more "o1erful host <more 'A5 an 6 or a faster *P(= Distribute your lab across several hosts (se lo1er2en virtual routers 1here "ossible. 4or exam"le9 a %+!0 running 1!.! IP base only nee s %! 5G of 'A5 an coul be use 1hen you nee to simulate a sim"le EA# router9 or Jthe InternetK.

There is a newer version of Dynamips available than the one bundled with the !"# %indows installer5 How do I use it with !"# $ 8 How do I use !"# with %indows (/// or %indows 9: ":.$
-he version of Dynami"s inclu e 1ith the 0in o1s G#$% installer reAuires 0in o1s :P $P!. In either of the above cases9 o1nloa the 0in o1s binaries from the Dynami"s site <htt"C66111.i"flo1.utc.fr6blog6=. 4or 0in o1s :P 6 !00% use J ynami"s2 1x".exeK. 4or 0in o1s !0009 use the file J ynami"s21!000.exeK instea . -hen co"y both your executable an Jcyg1in1. llK to J*C[Program 4iles[G#$%[Dynami"sK9 re"lacing the existing files.

;n 4inux 8 <nix 8 ;" 91 when I bridge a router or switch interface to my local host I can=t ping it from my host5 ,ut this wor7s on %indows$ %hat gives$
-his oes generally 1ork on 0in o1s < e"en ing on your net1ork car = but not on Einux 6 (nix. 5ost likely this is ue to ifferences bet1een lib"ca" an 0in"ca"9 an the ifferences in the net1ork stacks on (nix 6 0in o1s <e.g. #DI$=. 7o1ever9 you shoul be able to "ing your bri ge interfaces from other systems on the bri ge net1ork. If this oes not 1ork on 0in o1s for your "articular #I*9 try creating a 0in o1s loo"back a a"ter an bri ging to that. $ee this threa for more info. &n Einux you can use a ta" interface an the #I&Fta" #I& ty"e. 4or &$ : you can install tun6ta" rivers as etaile in this threa .

Can I use

!"# to ma7e my networ7 diagrams$

;es but at the moment G#$% only "ro"oses symbols that are use in the emulation "rocess9 so you can ma e your iagrams 1ith these symbols an ex"ort them as an image <?"eg9 "ng9 x"m9 bm" are su""orte formats=. In a future release of G#$%9 a "ackage of ecorative symbols 1ill be "rovi e .

I get Dynamips error message boxes but I don>t 7now what is wrong$

If you have this error message9 that means that the hy"ervisor is not listening9 you shoul look at the hy"ervisor settings in the Dynami"s "references if you are using the hy"ervisor manager or at the hy"ervisors section in the JI&$ images an hy"ervisorsK 1in o1. If the "roblem "ersists you can try toC $tart the hy"ervisor manually an see his ou"ut *heck if you have not another Dynami"s "rocess running on your system *lean the 1orking irectory of Dynami"s <es"ecially any lock files=

-his error message means that Dynami"s canDt create an (DP #I&9 this is often ue to a collision 1hen choosing (DP "orts9 check your hy"ervisors settings an see the J*lient 6 $erver an 5ulti2server &"erationK for more information.

I have a ?uestion 8 I=m having a problem 8 I thin7 I=ve found a bug5 How do I submit a ?uality post on the forum or the bug trac7ing system thereby increasing the li7elihood that someone will be able to help me out$
Ge sure to note all the follo1ing in your "ostC -he s"ecific etails of your issue -ry to "rovi e the sim"lest lab you can that recreates the issue Inclu e the exce"tion.log or exec"tionF ynagen.log files if they exists. Any out"ut from Dynami"s <1hen using it externally= #oteC It is "lanne to "rovi e a ebug mo e in a future release.

You might also like