Está en la página 1de 50

Hng dn s dng GNS3 Dynamips / Dynagen

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

GNS3 Documentation
v3.0 beta Mt phn trong bi hng dn ny c trch ra t bi hng dn tuyt vi v Dynagen ca Greg Anuzelli Graphical Network Simulator

Mc lc
Mc lc........................................................................................................................................... 1 Gii thiu........................................................................................................................................ 2 Gii thiu v Dynamips.............................................................................................................. 2 Gii thiu v Dynagen................................................................................................................ 2 Ci t GNS3.................................................................................................................................. 3 IOS Images ..................................................................................................................................... 3 S dng ti nguyn......................................................................................................................... 4 Cu hnh Dynamips ........................................................................................................................ 5 Mt s v d v Terminal Command ......................................................................................... 7 Chy mt bi lab n gin............................................................................................................ 10 Ch thit k.......................................................................................................................... 10 Ch m phng ..................................................................................................................... 13 Lm vic vi Console................................................................................................................... 15 Tnh ton gi tr Idle-PC............................................................................................................... 18 S dng mt thit b Frame Relay................................................................................................ 22 Giao tip vi mng thc ............................................................................................................... 24 S dng thit b Ethernet Switch.................................................................................................. 28 S dng thit b Hub .................................................................................................................... 31 WIC Modules ............................................................................................................................... 31 Qu trnh hot ng Client/Server v Multi-server...................................................................... 32 Ti u ho s dng b nh........................................................................................................... 35 Bt gi tin ..................................................................................................................................... 36 Lu v np mt m hnh mng .................................................................................................... 39 Nhng ln/tnh nng khc ............................................................................................................ 42 Cc phn cng hin ti m phng c .................................................................................. 43 Cc cu hi thng gp ................................................................................................................ 46

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Gii thiu
GNS3 l mt trnh gi lp mng c giao din ho (graphical network simulator) cho php bn d dng thit k cc m hnh mng v sau chy gi lp trn chng. Ti thi im hin ti GNS3 h tr cc IOS ca Router, ATM/Frame Relay/Ethernet switch v hub. Bn thm ch c th m rng mng ca mnh bng cch kt ni n vo mng o ny. lm c iu ny, GNS3 da trn Dynamips v mt phn ca Dynagen, n c pht trin bng Python v thng thng qua PyQt v phn giao din ho th s dng th vin Qt, rt ni ting v tnh hu dng ca n trong d n KDE. GNS3 cng s dng k thut SVG (Scalable Vector Graphics) cung cp cc biu tng cht lng cao cho vic thit k m hnh mng ca bn.

Gi i thi u v Dynamips
Dynamips l mt trnh m phng router Cisco c vit bi Christophe Fillot. N m phng cc dng 1700, 2600, 3600, v 7200, v s dng cc IOS image chun. Theo li ca Chris : Phn mm m phng loi ny c th c s dng cho : c s dng nh mt cng c thc tp, vi phn mm s dng trong th gii thc. N cho php mi ngi lm quen hn vi cc thit b ca Cisco, Cisco hin ang l cng ty hng u trn th gii v k thut mng ; Th nghim v lm quen vi cc c tnh ca Cisco IOS ; Kim tra nhanh chng cc cu hnh trin khai sau ny trn cc router tht. D nhin, phn mm m phng ny khng th thay th cc router tht, n ch n gin l mt cng c b sung cho cc bi lab thc t ca cc nh qun tr mng Cisco hoc nhng ai mun vt qua cc k thi CCNA/CCNP/CCIE. Mc d Dynamips cung cp mt switch o n gin, n khng m phng Catalyst switch (mc d n c th gi lp NM-16ESW)

Gi i thi u v Dynagen
Dynagen l mt giao tip da trn nn vn bn (text-base) dnh cho Dynamips, cung cp mt b OOP API ring c s dng bi GNS3 tng tc vi Dynamips. GNS3 cng s dng tp tin cu hnh tng-t-INI ca Dynagen v c tch hp trnh qun l CLI ca Dynagen cho php ngi dng lit k cc thit b, tm ngng v np li cc cc th hin (ca cc thit b - ND), xc nh v qun l cc gi tr idle-pc, bt cc gi tin, Nu bn tnh c c bi hng dn ny trc khi tm hiu v GNS3, Dynamips hay Dynagen, th y l cc lin kt dnh cho bn : GNS3: http://www.gns3.net/ Dynamips: http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator Dynamips Blog (where most of the action is): http://www.ipflow.utc.fr/blog/
Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Dynagen (a text-based front-end to the emulator): http://dyna-gen.sourceforge.net/ GNS3 / Dynamips / Dynagen Bug tracking: http://www.ipflow.utc.fr/bts/ Hackis Dynamips / Dynagen / GNS3 Forum: http://7200emu.hacki.at/index.php

Ci t GNS3
GNS3 chy trn Windows, Linux v Mac OSX (cc nn khc cha c th nghim) v i hi cc thnh phn sau y c ci t sn trong my nu bn mun s dng n t m ngun: Qt >= 4.3, xem ti http://trolltech.com/developer/downloads/qt/index/ Python >= 2.4, xem ti on http://www.python.org/ Sip >= 4.5 nu bn mun bin dch PyQt, xem ti http://www.riverbankcomputing.co.uk/sip/ PyQt >= 4.1, xem ti http://www.riverbankcomputing.co.uk/pyqt Chng ti tp hp tt c cc phn trn thnh mt b ci tt-c-trong-mt trn Windows (allin-one Windows installer pakage), bao gm Winpcap, Dynamips, v mt phin bn c bin dch ca GNS3, gip bn khng cn phi ci Python, PyQt v Qt. N cng cung cp tnh nng Explorer tch hp nn bn c th double-click ln tp tin network chy chng. Ngi dng Windows nn ci t gi all-in-one Windows installer. N cung cp mi th bn cn c th chy c GNS3 trn my c nhn hay my xa, ngoi tr mt IOS image (xem phn k tip) Ngi dng Linux cn download Dynamips v gii nn n vo mt ch thch hp. Ci t nhng gi ph thuc ca GNS3 v sau chy GNS3. Ngi dng cng c th th phin bn binary dnh cho Linux, gip khng cn phi ci Python, PyQt v Qt. Ghi ch: Nu bn ang chy Dynamips trn mt h thng RedHat hay Fedora, hy xem qua Dynamips FAQ item#2 nu bn gp li khi chy Dynamips. Ti thi im hin ti, ngi dng Mac OS X phi t bin dch nhng gi ph thuc. Phin bn binary s c c cho ra i trong nay mai.

IOS Images
Dynamips chy h iu hnh tht ca Cisco. Trch t Dynamips FAQ: Bn c th cung cp Cisco IOS image ca router 7200 cho ti c khng? Khng, ti khng c php phn phi cc IOS images. Bn phi t tm ly chng. iu ny s khng thnh vn nu bn l mt khch hng ca Cisco.

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Trn Windows, tp tin nh vo th mc C:\Program Files\Dynamips\images. Thc t th bn c th t tp tin nh bt c ch no bn mun, nhng nhng bi lab mu c cu hnh tm kim y. Trn cc h thng Linux/Unix, chn mt ch lu tp tin nh v b chng vo (ti thng dng /opt/images, nhng iu ny l tu trn h thng ca bn) Cc tp tin Cisco IOS images c nn li. Nhng tp tin nh nn ny s lm vic tt vi Dynamips*, tuy nhin qu trnh boot s b chm li bi qu trnh gii nn (ging nh trn cc router tht). Gi l bn nn gii nn tp tin nh trc khi s dng, gip cho trnh m phng khng phi lm iu ny. Bn c th lm iu ny vi tin ch unzip trn Linux/Unix/Cygwin nh sau:
unzip p c7200-g6ik8s-mz.124-2.T1.bin > c7200-g6ik8s-mz.124-2.T1.image

Bn s nhn c mt cnh bo t trnh unzip, nhng bn c th b qua. Trn Windows bn c th s dng WinRaR gii nn tp tin nh. Bn c th download mt bn copy min ph ca WinRaR ti http://www.winrar.com Lu rng hin nay tp tin nh ca router 2600 phi c gii nn trc khi lm vic vi Dynamips. V hy lun kim tra IOS image trc tip vi Dynamips trc khi s dng chng trong GNS3:
./Dynamips P <chassis> <path-to-the-ios-image>

S dng ti nguyn
Dynamips s dng mt lng kh ln RAM v CPU cho vic m phng. Nu bn d nh chy mt IOS image i hi 256 MB RAM trn mt router 7200 tht, v bn phi dnh ra 256 MB RAM cho th hin ca router o ca bn, n s chim mt 256 MB RAM ca vng nh lm vic. Dynamips cng mc nh chim 64 MB RAM trn mi th hin trn h thng Unix (16 MB trn h thng Windows) cache nhng din dch JIT. y l tng s RAM b chim; mc nh lng RAM thc t b chim trn h thng s t hn. iu ny l bi v mc nh Dynamips s dung nhng tp tin lm b nh o cho router. Trong th mc lm vic bn s thy c nhng tp tin ram tm thi c kch thc bng vi kch thc RAM ca router gi lp. H iu hnh ca bn s t ng cache trong RAM nhng phn ca tp tin mmap ang c s dng. (Xem phn Ti u ho s dng b nh bit cch cu hnh cc tu chn nhm lm gim vic s dng b nh). Nu bn c nhiu RAM, v bn bit bn ang lm g, hy b nh du mc Use mmap trong phn cu hnh IOS router nng cao. Bm chut phi vo mt thit b v chn Configure:

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Dynamips cng s dng rt nhiu nng lc ca CPU, bi v n m phng CPU ca mt router theo tng ch lnh (instruction-by-instruction). N khng c cch no bit c khi no th CPU ca router l rnh ri, v th n thc hin mt cch y cc ch lnh to nn cc chu k rnh ri ca IOS cng ging nh thc thi mt ch lnh thc thi cng vic thc t. Nhng khi bn chy thng qua qu trnh Idle-PC cho mt IOS image, s tiu tn CPU s c gim xung mt cch ng k. Bn s c tm hiu v ch rt quan trng ny trong cc phn tip theo.

Cu hnh Dynamips
s dng Dynamips trong GNS3, bn phi cu hnh ng dn ti n v cng nn (base port). Nhng thit lp ny s c s dng bi Hypervisor Manager v np tp tin .net. Truy xut vo phn Preferences trong menu Edit:

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Th mc lm vic l ni tt c cc tp tin to bi Dynamips c lu tr, bao gm NVRAM cho router o, cng nh bootflash, logfiles, v mt vi tp tin lm vic khc. Tu chn: Automatically delete old files generated by Dynamips s xo tt c nhng tp tin c nh nvrams ca cc router (nu bn s dng mmap),khi quay tr v ch thit k. Enable IOS ghost feature s dng ton cc (hoc khng) tnh nng ghost ca Dynamips (Xem phn Ti u ho s dng b nh bit thm chi tit).

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

cho php bn kt ni ti cng console ca router o, bn cng phi cu hnh terminal command. GNS3 s a ra cho bn mt command mc nh nhng bn c th thit lp mt ci tu . Cu trc nh sau: %h = host %p = port %d = device name

M t s v d v Terminal Command
Trn Windows: Ngi s dng TerraTerm SSH: C:\progra~1\TTERMPRO\ttssh.exe %h %p /W=%d /T=1 Ngi dng PuTTy: start C:\progra~1\PuTTy\putty.exe telnet %h %p Ngi dng SecureCRT: start C:\progra~1\SecureCRT\SecureCRT.EXE /script
c:\progra~1\dynamips\securecrt.vbs /arg %d /T /telnet %h %p & sleep 1

Trn Linux: Ngi dng Gnome: gnome-terminal t + name + e telnet + host + + str(port) +
> /dev/null 2>&1 &

Trn Mac OSX: Vi Terminal: /usr/bin/osascript -e 'tell application "Terminal" to do script with command "telnet %h %p ; exit"' -e 'tell application "Terminal" to tell window 1 to set custom title to "%d"' Vi iTerm c named tabs: /usr/bin/osascript -e 'tell app "iTerm"' -e 'activate' -e 'set myterm to the first terminal' -e 'tell myterm' -e 'set mysession to (make new session at the end of sessions)' -e 'tell mysession' -e 'exec command "telnet %h %p"' -e 'set name to "%d"' -e 'end tell' -e 'end tell' -e 'end tell' Hypervisor Manager c s dng chy cc hypervisor ca bn bn trong GNS3, ngha l bn khng cn phi bt chng ln bng tay. Trnh qun l ny cng gip gii quyt vn gii hn s dng b nh cho mi tin trnh khi chy nhiu th hin IOS trn mt hypervisor (xem FAQ hiu hn v vn ny) bng cch cn bng ti cc th hin trn nhiu hypervisor.

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Hy nhn vo mt v d cch n lm vic: Chng ta mun chy 5 th hin IOS, mi ci s dng 256 MB v chng ta cu hnh gii hn b nh s dng cho mt hypervisor l 512 MB. Khi chng ta bt u bi lab, hypervisor manager s to 3 tin trnh hypervisor da trn cng thc sau y (bn phi lm trn n s t nhin ln hn k tip): S lng hypervisors = (256 * 5 / 512) Trnh Hypervisor Manager gn 2 th hin u tin vo hypervisor u tin, 2 th hin k tip vo hypervisor th 2 v th hin cui cng v hypervisor th 3.

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Ngoi ra cn c 2 tu chn khc trong Dynamips Preferences. UDP incrementation quy nh cch m Hypervisor Manager tng Dynamips base udp port cho mi tin trnh hypervisor c to (v d, nu base udp port l 10000 trong Dynamips preferences v incremenation l 100, th n s thit lp base upd port cho hypervisor u tin l 10000, 10100 cho ci th hai,) Ghi ch: c nhiu thng tin v UDP issues c th c tm thy trong phn Qu trnh hot ng Client/Server v Multiserver.

Thnh ph H Ch Minh Thng 11 nm 2007

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Tu chn Use the hypervisor manager when importing c s dng khi np mt tp tin m hnh (topology file) (.net) vo GNS3. Nu tu chn ny c chn v trong tp tin .net bn nh ngha hypervisors chy trn localhost, sau GNS3 nhn thy rng nhng hypervisor cn c khi ng bng Hypervisor Manager. Nu n khng c chn, nhng hypervisor c ghi nhn l external hypervisor v phi c khi ng bng tay.

Chy mt bi lab n gin


Trong phn ny ti s hng dn cc bn cch chy mt bi lab vi 3 router tng bc tng bc mt.

Ch thi t k
Mc nh, GNS3 khi ng ch thit k. Trong ch ny bn c th to m hnh mng bng cch ko th cc node t danh sch pha bn tay tri vo mn hnh pha bn tay phi.

K tip, thit lp ng dn n tp tin nh IOS bng cch chn menu Edit IOS images (hoc bm CTRL + SHIFT + I). Sau thit lp ng dn cho tp tin nh IOS, chn nn (platform)
Thnh ph H Ch Minh Thng 11 nm 2007

10

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

v loi (chassis)(nu c th) v in mt gi tr IDLE PC. Mc nh, bn s dng hypervisor c tch hp (dynamips c qun l bi GNS3) chy IOS ca mnh.

Nu bn mun s dng hypervisor bn ngoi (bn phi t khi ng), bn c th ghi nhn chng trong tab Hypervisors (xem phn Qu trnh hot ng Client/Server v Multi-server c thm thng tin). Tt c nhng thng tin xc nh IOS v hypervisor c lu trong tp tin gns3.ini, v th bn ch cn ghi nhn chng mt ln. Lu : tp tin gns3.ini nm trong th mc %APPDATA% hoc %COMMON_APPDATA% trn Windows v $HOME/.config/ hoc /etc/xdg/ hoc /etc/qt4/ trn Linux/Unix. Mt khi tp tin nh IOS c ghi nhn, bn c th cu hnh cc node ca mnh (bm chut phi vo mt node v chn Configure). Bn c th p dng nhng thit lp ging nhau cho tt c cc router bng cch chn Routers cy pha bn tri hoc cho mt router xc nh no bng cch chn tn ca n trn cy.
Thnh ph H Ch Minh Thng 11 nm 2007

11

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Trong phn cu hnh node, bn c th chn IOS s dng v cu hnh nhiu th khc nh startup-config, kch thc RAM, cc khe cm, v.v K tip, thm cc kt ni gia cc node (bm vo nt Add a link trn thanh menu, chn node ngun v node ch). Bn s c nhc nh rng bn c th chn li kt ni (Ethernet, serial). Nu bn GNS3 t ng gn module thch hp ph hp vi loi kt ni ca mnh trn slot ca router ca bn v chn interface thch hp u tin kt ni. Bn c th t chn interface kt ni cho lin kt ca mnh bng cch chn phng thc lm bng tay t menu drop-down. Nhng hy ghi nh trong u rng sau bn cng phi cu hnh bng tay cc slot trn router ca mnh.

Thnh ph H Ch Minh Thng 11 nm 2007

12

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Ghi ch: s dng cc interface c nh du mu xanh, ng s dng cc interface nh du mu .

Ch m ph ng
S mng ca bn c to. By gi chuyn sang ch m phng (bm vo nt Emulation Mode trn thanh menu).

Thnh ph H Ch Minh Thng 11 nm 2007

13

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

M hnh mng ca bn cng vi tt c cc thit lp sau c to trn cc hypervisor. Bn c th bt/tt/tm ngng mt th hin IOS bng cch bm chut phi vo mt node. Nu bn khi ng mt node, bn c th truy xut vo console ca thit b . Ghi ch: c th chn nhiu node thc thi thao tc trn cc node mt cch ng thi.

Thnh ph H Ch Minh Thng 11 nm 2007

14

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Mt khi kt ni vo ng console ca router, bn c th gn cc a ch IP thch hp vo cc serial interface (bn c th xem cc interface c kt ni bng cch nhn vo bng tm tt m hnh pha bn tay phi hoc chut ln mt lin kt), v no shut chng, bi v chng thc s c kt ni.

Lm vic vi Console
Ghi ch: khung Console pha di ch s dng c khi bn ang ch m phng. T mn hnh Console, s dng lnh help xem danh sch cc lnh hp l:

Thnh ph H Ch Minh Thng 11 nm 2007

15

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

c gip v mt lnh c th no , c th g help command hoc command ?. V d:

tt mt router o, s dng lnh stop. C php nh sau:


stop {/all | router1 [router2]}

tt mt router c th, dng lnh stop tn_router:

V chc chn rng router c stop:

Thnh ph H Ch Minh Thng 11 nm 2007

16

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Bn cng c th a ra mt list cc router cn stop, hoc dng lnh stop /all tt tt c cc th hin ca router. khi ng li R1, s dng lnh start:
start {/all | router1 [router2] }

Lnh reload IOS khng c h tr bi Dynamips i vi router o. V th bn c th s dng lnh reload ca console. N thc hin mt stop, theo sau bi mt start. reload tt c cc router trong bi lab, s dng lnh reload /all:

Cc lnh tm ngng (suspend) v khi phc (resume) c c php tng t nh stop v start, nhng chng tm dng mt router xc nh:

Thnh ph H Ch Minh Thng 11 nm 2007

17

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Lnh exit dng v xo tt c cc thit b ra khi mng v tr v ch thit k. Nu bn thot khi Console, s m phng cng s ngng theo.

Tnh ton gi tr Idle-PC


Bn c th nhn thy rng s m phng trc ca mnh lm cho CPU ca h thng hot ng ti 100% v lun nm ngng . iu ny l bi v Dynamips khng bit khi no router o ang ri v khi no n ang thc thi nhng cng vic hu ch. Lnh idlepc thc hin phn tch trn mt tp tin nh ang chy xc nh cc im ging nht trong m i din mt chu k ngh ca IOS. Mt khi c p dng, Dynamips ngng router o thng xuyn khi chu k ngh c thc thi, gip lm gim s tiu tn CPU trn my ch m khng lm gim kh nng x l cng vic thc t ca router. Di y m t cch m qu trnh c thc thi. u tin, to mt router n trong ch thit k, chn tp tin nh IOS s chy, v chuyn sang ch m phng. Sau bt router (o) v telnet vo n. Nu bn gp du nhc IOS autoconfig, chn no. Nu khng, ng bm bt c th g:

Thnh ph H Ch Minh Thng 11 nm 2007

18

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

i cho tt c cc interface c khi ng. Sau i mt cht chc chn rng router khng cn boot na v ang ngh. Phin lm vic ca bn trng ging nh th ny:

Thnh ph H Ch Minh Thng 11 nm 2007

19

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

By gi, quay tr li mn hnh Console ca GNS3, v dng lnh idlepc get routername. Bn s thy mt thng bo rng cc thng s ang c thu thp, v khong 10 n 20 giy sau bn s thy mt danh sch cc gi tr idlepc tim nng:

Thnh ph H Ch Minh Thng 11 nm 2007

20

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Cc gi tr c kh nng cho kt qu tt c nh du bng du hoa th (*). Chn mt trong cc gi tr trn th t menu v bm OK. Bn thy rng trn my ca mnh (my ang chy cc tin trnh dynamips) t l s dng CPU c gim ang k. Nu th, bn tm c mt gi tr idlepc tt i vi tp tin nh IOS ny.

Nu t l s dng CPU khng gim xung th bn nn th vi mt gi tr khc. G idlepc show routername hin th danh sch cc gi tr c xc nh trc , v chn mt gi tr khc. Gi tr Idle-PC l ring i vi mt tp tin nh IOS. Chng c th khc nhau i vi cc phin bn IOS khc nhau, v thm ch vi cc tp tnh nng khc nhau ca cng mt phin bn IOS. Tuy nhin gi tr Idle-PC khng ph thuc vo my ca bn, h iu hnh hay phin bn ca Dynamips.

Thnh ph H Ch Minh Thng 11 nm 2007

21

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

C th Dynamips khng th tm thy cc gi tr idlepc cho mt tp tin nh, hoc cc gi tr tm thy khng c tc dng. Nu iu ny xy ra, hy c gng th li qu trnh mt ln na. Hoc l bn khng gp may vi tp tin nh (mc d trng hp ny rt him khi xy ra). Sau khi tm c mt gi tr idlepc tt, ghi li s dng thp lc phn (v d, 0x8048ef80). Quay tr li tp tin nh IOS trn menu Edit. Bm p chut vo tn tp tin nh bn bn phi m bng thit lp ca n qua bn tri. in gi tr idlepc, v bm Save. Qu trnh ny ch cn lm mt ln i vi mi IOS. Mi khi bn m GNS3, cc gi tr s c thit lp sn. Bn ch cn in gi tr idlepc mi khi bn thit lp ln u tin cho mt phin bn IOS mi.

S dng mt thit b Frame Relay


Dynamips (v do c GNS3) cung cp h tr mt frame relay switch tch hp. Nhn vo frame relay lab:

Thnh ph H Ch Minh Thng 11 nm 2007

22

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Chng ta kt ni cc cng serial trn cc router vo cc cng 1,2 v 3 trn mt Frame Relay Switch tn F0.

Thng qua Node configurator chng ta gn mt DLCI cc b gi tr 102 vo cng 1, gn vi mt DLCI 201 trn cng 2. Hai port cn li cu hnh tng t, do to mt full mesh PVCs gia 3 router (103 301, v 201 302). Ghi ch: Frame Relay switch c m phng (emulated) bi Dynamips s dng LMI l ANSI Annex D, khng phi Cisco. Khi ng bi lab:

Thnh ph H Ch Minh Thng 11 nm 2007

23

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Frame Relay switch F0 c lit k, nhng bn khng th dng, khi ng, tm ngng hay khi phc n ging nh lm vi cc router o. ATM switch cng c th c cu hnh mt cch tng t.

Giao tip vi mng thc


Dynamips c th to cu ni gia interface trn router o vi interface trn my tht, cho php mng o giao tip vi mng tht. Trn h thng Linux, iu ny c lm vi NIO_linux_eth NIO (Network Input Output) descriptor. s dng tnh nng ny vi GNS3, bn phi to mt thit b Cloud. Mt cloud i din cho kt ni bn ngoi ca bn. Sau bn phi cu hnh n. Trong v d ny chng ti thm NIO_linux_eth1 NIO:

Thnh ph H Ch Minh Thng 11 nm 2007

24

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Sau bn c th kt ni cloud ca mnh ti mt router hoc mt Ethernet switch. Trong hnh bn di, chng ta kt ni interface e0/0 ca router ti interface eth1 trn my tnh. Packet i ra t e0/0 c chuyn vo mng tht thng qua eth1, v packet quay tr v s theo ng c quay tr v router o.

Thnh ph H Ch Minh Thng 11 nm 2007

25

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Trn h thng Windows, th vin Winpcap c s dng to kt ni ny. nh dng giao din hi phc tp hn so vi trn h thng Linux. GNS3 s thc thi mt tin trnh t ng pht hin vi s gip ca Dynamips lit k cc interface kh dng Nu khng detect c, s dng shortcut to bi GNS3 Windows installer (cm n Dynagen). Trn desktop, bm vo shortcut Network Device List:

Thnh ph H Ch Minh Thng 11 nm 2007

26

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

V th trn h thng Windows, ti s dng:


\Device\NPF_{B00A38DD-F10B-43B4-99F4-B4A078484487}

kt ni ti Ethernet adapter trn my. Bn cn a gi tr ny vo Generic Ethernet NIO khi cu hnh thit b Cloud ca mnh. Chn thit b t danh sch s xung, hoc dn n vo bn cnh nt Add. Sau bm nt Add a thit b vo trng bn di nt Add.

Thnh ph H Ch Minh Thng 11 nm 2007

27

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

S dng thit b Ethernet Switch


Dynamips cng cung cp mt Ethernet switch o tch hp c h tr VLANs vi kiu ng gi 802.1q. Xem lab bn di:

Thnh ph H Ch Minh Thng 11 nm 2007

28

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Port 1 trn switch (kt ni ti R1 e0/0) l mt access port trong VLAN 1. Port 2 cng l mt access port. Port 4 l mt trunk port (c xc nh vi t kho dot1q) vi mt native VLAN 1. Trunk port trunk tt c cc VLAN ti switch.

Thnh ph H Ch Minh Thng 11 nm 2007

29

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Mc nh trong GNS3, mt switch c 8 access port c cu hnh nm trong VLAN 1. Bn cng c th kt ni 1 switchport ti th gii thc bng cch kt ni switch ti mt thit b Cloud . y chng ta ang kt ni 1 trunk port (ng gi dot1q) vi mt native VLAN 1 ti interface eth1 ca my tnh, hoc thit b mng Windows s dng NIO_gen_eth Winpcap NIO (xem thm phn Giao tip vi mng thc). Nu interface ca my tnh ny c kt ni ti mt switch thc c cu hnh trunking, bn c th d dng kt ni ti bt c th router o no vo bt c VLAN no bn mun. Console bao gm CLI command hin th v xo bng MAC address ca Ethernet switch o. Nhng lnh ny l show mac Ethernet_switch_name v clear mac ethernet_switch_name.

Thnh ph H Ch Minh Thng 11 nm 2007

30

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

S dng thit b Hub


GNS3 cho php bn to thit b hub. Thit b hub l thit b cu hnh n gin nht bi v bn ch cn chn s lng port cho mi thit b (mc nh l 8 port). Di y l cu hnh ca 1 bi lab s dng hub:

Trong v d ny R0 v R1 chia s chung 1 ng truyn thng qua hub.

WIC Modules
Dynamips 0.2.0-RC1 h tr thm cho nhiu WIC moudule. Hin ti, h tr WIC-1T v WIC-2T trn cc nn1700, 2600, 2691 v 3700, v WIC-1ENET trn 1700. Xem phn Cc phn cng hin ti m phng c c thm thng tin v cc model v s lng khe WIC h tr cho mi nn.

Thnh ph H Ch Minh Thng 11 nm 2007

31

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Ghi ch: hin ti GNS3 cha h tr WIC module cho router 1700, nhng tnh nng ny s c tch hp trong phin bn trong tng lai.

Qu trnh hot ng Client/Server v Multi-server


Ch Dynamips Hypervisor c GNS3 s dng l mt knh giao tip TCP/IP, v th GNS3 c th chy trn mt my khc vi my ci Dynamips. iu ny c lm bng tay bng cch xc nh mt hypervisor trong ca s IOS images and hypervisors.

y chng ta c mt hypervisor s lng nghe trn cng 7210 trn my remote_host. Bn cng c th ch ng dn y ti th mc lm vic ni hypervisor s lu tt c cc tp tin n to ra trn Dynamips host. Hy chc chn s dng ng du ngn cch th mc (v d du / cho h thng Linux). Ghi ch: bn phi s dng mt DNS name hay mt a ch IP trong host. Base UDP l cng nn (base) cho UPD NIOs m Dynamips s dng to ra kt ni gia cc node. Dynamips s s dng mt cng UDP cho mi u kt ni. V d, su cng UDP s c s dng cho mt kt ni full-meshed ca 3 router v mt base upd l 10000.

Thnh ph H Ch Minh Thng 11 nm 2007

32

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Di y l output ca lnh netstat s hin th cho bn kt ni gia cc node v cng UDP c s dng bi Dynamips:
udp udp udp udp udp udp 0 0 0 0 0 0 0 0 0 0 0 0 localhost:10000 localhost:10001 localhost:10002 localhost:10003 localhost:10004 localhost:10005 localhost:10001 localhost:10000 localhost:10003 localhost:10002 localhost:10005 localhost:10004 ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED

By gi hy tng tng bn mun chy 2 IOS instances c kt ni vi nhau v c to trn 2 hypervisor khc nhau trn cng mt my v bn chn cng mt base UDP port cho cc hypervisor. Mi hypervisor s c gng ly cng mt cng UDP (10000 trong v d trc) cho mi u cui ca kt ni v, d nhin, iu ny s xung t bi v Dynamips ngh rng chng l cc server khc nhau v do nhng cng UDP ny th an ton s dng li. Base console l mt TCP base port m hypervisor s s dng khi bn m mt console trn mt IOS. Gi tr ny khng th xung t v GNS3 s dng cng thc bn di tc ng n cng console trn mi router: base port + router_id (duy nht). Th nn bn c th cc gi tr ging nhau cho cc hypervisor. Mt khi hypervisor ca bn c ghi nhn, bn c th kt ni chng vo IOS image ca mnh. Chn tp tin nh, b du chn Use the hypervisor manager, v sau chn hypervisor ca bn t danh sch. By gi mi router c cu hnh vi IOS image ny c th lin lc c vi hypervisor kia.

Thnh ph H Ch Minh Thng 11 nm 2007

33

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Ghi ch: hy chc chn rng tt c nhng host-based firewall ang chy trn tt c cc Dynamips server (v d, firewall ca XP SP2) u cho php nhng traffic cn thit. N bao gm Dynamips server port (mc nh l cng TCP 7200), console ports (vd: TCP 2000, 2001,) v nhng cng s dng bi kt ni NIO gia cc interface, bt u t UDP 10000. Bn cng c th chn hypervisor no m cc thit b non-IOS (switch v hub) s chy trn khi cu hnh chng. V d, trn mt Ethernet switch bn c th chn hypervisor t danh sch.

Thnh ph H Ch Minh Thng 11 nm 2007

34

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

y chng ti chn cho switch chy trn hypervisor tn l saturn, cng lng nghe l 8000.

Ti u ho s dng b nh
Nh c m t trong phn S dng ti nguyn, bi lab ca bn c th tiu tn mt lng ln b nh thc v o. Tu chn ghostios v sparsemem c thm vo gii quyt cc vn trn. Tu chn Ghostios c th lm gim mt cch ng k lng RAM trn my ch cn cho bi lab vi nhiu router chy cng mt IOS image. Vi tnh nng ny, thay v mi router o cha mt bn copy IOS ring trong RAM, th my ch s nh v mt vng b nh chung cho tt c. V d, nu bn chy 10 router vi cng mt IOS image v tp tin nh c kch thc 60 MB th bn tit kim c 9*60=540MB RAM thc khi chy bi lab. Bt tnh nng ny ch n gin bng cch chn vo checkbox trong Dynamips preferences. Tu chn ny c bt mc nh v c p dng cho tt c cc th hin ca router trong bi lab.
Thnh ph H Ch Minh Thng 11 nm 2007

35

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Khi c kch hot, bn s thy c thm mt s tp tin trong cng th mc vi tp tin nvram ca router c tn dng nh c3600-ik9o3s-mz.124-10.image.ghost. y l tp tin nmaped cha vng nh dng chung. Cc tp tin khc thng c to cng vi 1 th hin ca router cng c to ra (log, nvram, v c th c tp tin bootflash). o lng lng b nh ca my ch tit kim c vi ghostios c th gp 1 cht kh khn do s phc tp trong vic qun l b nh trn cc HH hin i. Xem thm bi vit ny trong phn General ca Hackis Forum tiu l Understanding memory usage and RAM Ghosting (Hiu r hn v s dng b nh v RAM Ghosting) c thm chi tit. Tnh nng sparsemem khng gip bo ton b nh, m thay vo n lm gim lng b nh o s dng bi cc router. iu ny c th l quan trng, bi v h iu hnh gii hn mt tin trnh mc 2GB b nh o trn Windows 32-bit, v 3 GB trn 32-bit Linux. V d, trn Windows, sau khi vng nh o s dng bi cygwin v cc th vin khc m dynamips ph thuc vo, ch cn ch cho 4 instance ca cc router, mi router 256MB. Bt tnh nng sparsemem ch nh v b nh o trn my ch ng bng lng RAM m IOS thc s s dng ch khng phi l ton b lng RAM c cu hnh. iu ny cho php bn chy nhiu instance hn trn mt tin trnh ca dynamips trc khi bn phi dng n cch chy nhiu tin trnh dynamips. Xem thm cu FAQ ny bit thm thng tin. Tnh nng sparsemem c kch hot mc nh trong GNS3 m hin thi khng c tu chn tt n. Ghi ch: nu ngi dng mun c mt tu chn tt tnh nng ny, hy cho chng ti bit.

Bt gi tin
Dynamips/GNS3 c th bt gi tin trn interface Ethernet hay Serial o v ghi thng tin ra mt tp tin capture s dng vi cc ng dng khc nh tcpdump, Wireshark, hay bt c ng dng no c th c c nh dng tp tin ca libpcap. Gi s c 3 router, r1 v r2 c ni vi nhau thng qua cp Ethernet, v r2 ni vi r3 thng qua kt ni serial point-to-point vi ng gi HDLC. bt u bt cc traffic trn interface f0/0 ca r1 v ghi vo tp tin r1.cap, g dng sau y vo ca s console:
capture r1 f0/0 r1.cap

xem cc traffic theo thi gian thc, m tp tin vi Wireshark:

Thnh ph H Ch Minh Thng 11 nm 2007

36

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Vic bt gi tin vn tip tc ghi cc gi vo tp tin output. Nu chng ta ping r2 t r1, sau bm vo biu tng reload this capture file s thy:

Thnh ph H Ch Minh Thng 11 nm 2007

37

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

ngng bt gi tin, g:
no capture r1 f0/0

Dynamips / GNS3 cng c th bt gi tin trn interface serial. Trong trng hp ny chng ta phi xc nh loi ng gi m chng ta ang s dng trn router, Wireshark bit cch decode packket. Chng ta c cc tu chn ng gi l FR (Frame-Relay), HDLC, hoc PPP. capture cc traffic c ng gi HDLC trn lin kt gia r2 v r3, g:
capture r2 s1/0 r2.cap HDLC

By gi chng ta c th m tp tin r2.cap, v sau khi c decode s ging nh sau:


Thnh ph H Ch Minh Thng 11 nm 2007

38

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

By gi kt thc vic bt gi tin vi no capture r2 s1/0. Ch rng bn c th bt nhiu gi tin trn nhiu interface ng thi trn cc router khc nhau.

Lu v np mt m hnh mng
GNS3 c th lu v np m hnh mng ca bn thnh nh dng tp tin cu hnh ging-INI ca Dynagen (phn m rng l .net). iu ny c ngha l bn c th s dng cc tp tin ging nhau cho c GNS3 v Dynagen. Bi v GNS s dng Dynagen nn c 2 gii hn lin quan n vic s dng tp tin .net trong GNS3: np s mng, bn phi cu hnh ng dn Dynamips trong hp thoi preferences. lu s mng ca mnh, bn phi ang trong ch m phng. Ghi ch: Trong phin tng lai ca GNS3 c kh nng lu s ca bn trong ch thit k.

Thnh ph H Ch Minh Thng 11 nm 2007

39

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Mt iu m bn phi lu l GNS3 qun l tp tin .net theo mt cch khc so vi Dynagen. V d, tt c nhng thit lp (ram, rom, nvram,) c ghi li trong sub-section ca thit b v khng phi mt phn trong m hnh mu ging nh Dynagen. GNS3 cng s ghi li gi tr idlepc v tn tp tin nh IOS trong sub-section ca thit b (bi v bn c th dng nhiu phin bn IOS khc nhau vi cng 1 loi router). ghi ln cch lm ny, bn c th thit lp mt IOS image l mc nh, sau GNS3 s to mt mu sub-section l ni n s lu tr tn tp tin IOS v gi tr idlepc.

Trong v d tip theo y, chng ta s to mt mt m hnh bao gm 3 router (i 2610) v chng ta s lu n trong ch m phng. Mt IOS image mc nh cho i 2619 cng c cu hnh.

Thnh ph H Ch Minh Thng 11 nm 2007

40

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Di y l kt qu ca tp tin .net lu li:


sparsemem = True ghostios = True [localhost:7200] udp = 10000 console = 2000 workingdir = /tmp/ [[2610]] image = /home/grossmj/IOS/c2600.image idlepc = 0x804a1cec [[ROUTER R0]] model = 2610 console = 2000 ram = 128 nvram = 128 rom = 4 disk0 = 8 disk1 = 8 mmap = True exec_area = 64 slot0 = CISCO2600-MB-1E slot1 = NM-4E

Thnh ph H Ch Minh Thng 11 nm 2007

41

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)


e0/0 = R2 e1/0 e1/0 = R1 e1/0 x = 15.0 y = -151.0 [[ROUTER R1]] model = 2610 console = 2001 ram = 128 nvram = 128 rom = 4 disk0 = 8 disk1 = 8 mmap = True exec_area = 64 slot0 = CISCO2600-MB-1E slot1 = NM-4E e0/0 = R2 e0/0 x = -255.795418536 y = -31.8822509939 [[ROUTER R2]] model = 2610 console = 2002 ram = 128 nvram = 128 rom = 4 disk0 = 8 disk1 = 8 mmap = True exec_area = 64 slot0 = CISCO2600-MB-1E slot1 = NM-4E x = 41.6776695297 y = 107.837049096

By gi bn c th np tp tin ny vo Dynagen hoc GNS3. Ghi ch: xem thm bi hng dn v Dynagen bit v cu trc ca tp tin .net

Nhng ln/tnh nng khc


Di y l mt vi lnh khc m bn c th s dng trong ca s console m s khng c gii thch trong bi hng dn ny. Xem hng dn trc tuyn (command /? hoc help command) v cch s dng: import / export Nhp v xut cc cu hnh router t nvram thnh tp tin dng text trn my ca bn. C th s dng ly mt bn copy ca cu hnh hin thi, hoc nh l mt tnh nng snapshotting lu li cu hnh router trc khi bn to nhng thay i.

Thnh ph H Ch Minh Thng 11 nm 2007

42

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

push / save Kh ging vi import v export, nhng tp tin cu hnh c lu di dng base64 encoded blobs ngay trong tp tin network. iu ny cho php bn phn phi ton b 1 bi lab vi s mng v cu hnh IOS trong mt tp tin .net duy nht. filter p dng mt lc kt ni vo mt interface. Hin ti filter duy nht c h tr bi dynamips l freq_drop, tc l n s loi b x packet ra khi y packet trn mt lin kt ( gi lp vic packet b tht lc). send S dng gi nhng lnh hypervisor th ti dynamips (xem README.hypervisor c nh km cng vi source ca dynamips bit v cc lnh ca hypervisor). Cc lnh hypervisor ny iu khin cch m GNS3 giao tip vi Dynamips. Lnh ny thng thng ch c s dng nu pht trin mt tnh nng mi trong dynamips, th nghim, hay n gin ch l t m. ver xut ra phin bn ang s dng ca Dynagen, cng nh l phin bn ca mi th hin ca dynamips m Dynagen ang kt ni ti. hist Lnh console history (ging nh history trong bash). Ngoi ra cng nn theo di s pht trin ca Dynamips bng cc truy cp vo blog http://www.ipflow.utc.fr/blog/ c c nhng thng tin mi nht.

Cc phn cng hin ti m phng c


Mn t mt bi gi ca ggee trong forum Hacki:
===========1700s=========== 1710 Slots: 0 (available) WIC slots: 0 CISCO1710-MB-1FE-1E (1 FastEthernet port and 1 Ethernet port, automatically used) Note, interfaces do not use a slot designation (e.g. f0) 1720 Note, interfaces do not use a slot designation (e.g. f0) 1721 Note, interfaces do not use a slot designation (e.g. f0) 1750 Note, interfaces do not use a slot designation (e.g. f0) 1751 1760 Slots: 0 (available) WIC slots: 2 C1700-MB-1ETH (1 FastEthernet port, automatically used) Cards: - WIC-1T (1 Serial port) - WIC-2T (2 Serial ports) - WIC-1ENET (1 Ethernet ports) ===========2600s=========== 2610 Slots: 1 (available) WIC slots: 3

Thnh ph H Ch Minh Thng 11 nm 2007

43

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)


CISCO2600-MB-1E (1 Ethernet port, automatically used) 2611 Slots: 1 (available) WIC slots: 3 CISCO2600-MB-2E (2 Ethernet ports, automatically used) 2620 Slots: 1 (available) WIC slots: 3 CISCO2600-MB-1FE (1 FastEthernet port, automatically used) 2621 Slots: 1 (available) WIC slots: 3 CISCO2600-MB-2FE (2 FastEthernet ports, automatically used) 2610XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-1FE (1 FastEthernet port, automatically used) 2611XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-2FE (2 FastEthernet ports, automatically used) 2620XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-1FE (1 FastEthernet port, automatically used) 2621XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-2FE (2 FastEthernet ports, automatically used) 2650XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-1FE (1 FastEthernet port, automatically used) 2651XM Slots: 1 (available) WIC slots: 3 CISCO2600-MB-2FE (2 FastEthernet ports, automatically used) Cards: - NM-1E (Ethernet, 1 port) - NM-4E (Ethernet, 4 ports) - NM-1FE-TX (FastEthernet, 1 port) - NM-16ESW (Ethernet switch module, 16 ports) - NM-NAM - NM-IDS - WIC-1T (1 Serial port) - WIC-2T (2 Serial ports) ===========3600s=========== 3660 Slots: 6 (available) 3640 Slots: 4 3620

Thnh ph H Ch Minh Thng 11 nm 2007

44

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)


Slots: 2 Cards: - NM-1E (Ethernet, 1 port) - NM-4E (Ethernet, 4 ports) - NM-1FE-TX (FastEthernet, 1 port) - NM-16ESW (Ethernet switch module, 16 ports) - NM-4T (Serial, 4 ports) - Leopard-2FE (Cisco 3660 FastEthernet in slot 0, automatically used) ===========3700s=========== 2691 (The 2691 is essentially a 3700 with 1 slot) Slots: 1 (available) WIC slots: 3 3725 Slots: 2 (available) WIC slots: 3 3745 Slots: 4 (available) WIC slots: 3 Cards: - NM-1FE-TX (FastEthernet, 1 port) - NM-4T (Serial, 4 ports) - NM-16ESW (Ethernet switch module, 16 ports) - GT96100-FE (2 integrated ports, automatically used) - NM-NAM - NM-IDS - WIC-1T (1 Serial port) - WIC-2T (2 Serial ports) ===========7200s=========== 7206 Slots: 6 (available) Chassis types: - STD - VXR NPEs: - NPE-100 - NPE-150 - NPE-175 - NPE-200 - NPE-225 - NPE-300 - NPE-400 - NPE-G2 (Requires the use of NPE-G2 IOS images) Cards: - C7200-IO-FE (FastEthernet, slot 0 only) - C7200-IO-2FE (FastEthernet, 2 ports, slot 0 only) - C7200-IO-GE (GigabitEthernet, slot 0 only) - PA-FE-TX (FastEthernet) - PA-2FE-TX (FastEthernet, 2 ports) - PA-4E (Ethernet, 4 ports) - PA-8E (Ethernet, 8 ports) - PA-4T+ (Serial, 4 ports) - PA-8T (Serial, 8 ports)

Thnh ph H Ch Minh Thng 11 nm 2007

45

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)


- PA-A1 (ATM) - PA-POS-OC3 (POS) - PA-GE (GigabitEthernet)

Cc cu hi thng gp
Lm sao ti xc nh c gi tr idle pc t GNS3? Xem phn Tnh Idle-PC trong bi hng dn ny. Khi ti c gng chy nhiu hn 4 router (vi 256 MB dnh cho mi ci) (hoc 6 router vi 160 MB dnh cho mi ci) trn Windows, hoc hn 7 router vi 256 MB dnh cho mi ci (hoc 11 router vi 160MB dnh cho mi ci) trn mi trng Linux 32-bit th Dynamips b li. Vn ny s khng xy ra nu bn s dng Hypervisor Manager (mc nh) vi thit lp ng. Hypervisor c thit k cn bng ti cc th hin ca IOS trn nhiu tin trnh ca Dynamips, nhng nu bn s dng nhiu hypervisor trn my ch xa, vn ny l do gii hn b nh dnh cho 1 tin trnh. Theo mc nh, hn ch v b nh cho mt tin trnh trn Windows l 2GB (bao gm c b nh s dng cho b nh RAM ca router o, cywin, cc th vin, v khng gian linh tinh) m bn s dng. Linux 32-bit mc nh c gii hn v b nh cho 1 tin trnh l 3 GB. Gii php l chy nhiu th hin ca Dynamips trn cng mt h thng v lng nghe trn cc cng khc nhau, v d: Trn Windows:
start /belownormal /min Dynamips dynamips.exe H 7200 start /belownormail /min Dynamips dynamips.exe H 7201

Trn Linux:
nice dynamips H 7200 & nice dynamips H 7201 &

V sau ghi li chnh xc nhng hypervisor vo GNS3 (xem phn Qu trnh hot ng Client/Server v Multi-server). Ti c 1 bi lab phc tp vi nhiu router, v cng serial b flapping, cc eigrp neighbor adjacencies b li, show run v write mem chy rt lu. iu ny hu nh l do vn hiu sut trn my PC ch. Mt bi lab ln tiu tn nhiu RAM v CPU. Mc nh, b nh DRAM ca router c gi lp nh l mt tp tin trn a c kch thc bng vi kch thc lng RAM. Tnh nng cache ca HH trn my ch t ng gi nhng phn hay c truy xut nht trong RAM. Nhng v RAM ca bn chy chm, s tc
Thnh ph H Ch Minh Thng 11 nm 2007

46

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

nghn trong cng s bt u. Router o s tr nn starved i vi CPU v bt u tht lc nhiu gi tin hello. C nhiu tu chn gii quyt vn ny: Dng 1 my ch mnh hn (nhiu RAM hn / CPU nhanh hn) Phn tn bi lab ca bn trn nhiu my ch. S dng router o dng thp nu c th. V d, mt router 3620 chy IOS phin bn 12.2 v ch chy nn IP ch cn c 32 MB RAM v c th s dng khi bn cn gi lp mt bi lab n gin, hoc l Internet C mt phin bn ca Dynamips mi hn phin bn i km vi b ci t GNS3 trn Windows. Lm cch no ti c th s dng n vi GNS3? / Lm sao s dng GNS3 trn Windows 2000 hay Windows XP SP1? Phin bn ca Dynamips trong b ci GNS3 trn Windows i hi phi c Windows XP SP2. Trong nhng trng hp trn, ti bn ci t trn Windows t website Dynamips (http://www.ipflow.utc.fr/blog). V d vi Windows XP/2003 s dng dynamips-wxp.exe. i vi Windows 2000, s dng dynamips-w2000.exe. Sau copy tt c cc tp tin thc thi v cygwin1.dll vo th mc C:\Program Files\GNS3\Dynamips, thay th cc tp tin ang tn ti. Trn Linux/Unix/OS X, khi ti kt ni mt interface trn router hay trn switch vo my cc b, ti khng th ping c n t my ch. Nhng n li lm vic trn Windows? iu g xy ra vy? Thng thng n chy trn Windows (ph thuc vo card mng ca bn) nhng khng chy trn Linux, Unix. Nhiu kh nng l do s khc bit gia 2 th vin libpcap v Winpcap, v s khc bit v cc Network stack trn Unix/Windows (vd: NDIS). Tuy nhin, bn c th ping interface t mt ht hng khc trong cng mng. Nu n khng lm vic trn Windows ring vi loi card mng ca bn, hy th to mt card mng loopback trn Windows v to kt ni vi n. Xem bi vit ny c nhiu thng tin hn. Trn Linux, bn c th dng mt tap interface v loi NIO_tap. i vi OS X bn c th ci tun/tap driver nh c m t chi tit y. Ti c th s dng GNS3 to s mng cho mnh? C th nhng hin nay GNS3 ch h tr nhng biu tng c s dng trong qu trnh m phng, v th bn c th to s mng vi nhng biu tng ny v xut chng ra di dng nh (jpeg, png, xpm, bmp l nhng nh dng c h tr). Trong phin bn tng lai ca GNS3, mt gi dng m t cc biu tng v mt cch vit vn bn ln vng v s c ci t. Ti gp mt thng bo li ca Dynamips nhng ti khng hiu n b ci g?

Thnh ph H Ch Minh Thng 11 nm 2007

47

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Nu bn gp li ny ngha l hypervisor hin gi ang khng lng nghe, bn xem li phn thit lp ca hypervisor trong Dynamips preferences nu bn s dng hypervisor manager hoc trong phn hypervisor trong ca s IOS images and hypervisors. Nu vn vn cn, hy th: Khi ng hypervisor bng tay v xem kt xut ca n. Kim tra xem bn c mt tin trnh Dynamips no khc ang chy trn h thng hay khng Xo th mc lm vic ca Dynamips (c bit l cc tp tin b kho)

Li ny c ngha l Dynamips khng th to mt UDP NIO, thng l do mt xung t khi chn cng UDP, kim tra thit lp hypervisor ca bn v xem phn Client/Server v Multi-server Operation c thm thng tin. Ti c mt cu hi / Ti c mt vn / Ti ngh ti tm ra mt li. Lm cch no ti c th gi mt bi vit c cht lng ln forum hoc ln bug tracking tng kh nng c mt ai gip ? Hy chc chn rng bn ghi y nhng iu sau y trong bi gi ca bn: Chi tit c th v vn ca bn. C gng cung cp mt bi lab n gin nht m bn c th m to ra li . nh km tp tin exception.log nu n tn ti. Bt c g xut ra t Dynamips (khi bn s dng n bn ngoi).

Thnh ph H Ch Minh Thng 11 nm 2007

48

Bi Quc Hon Din n AdminVietnam (www.adminvietnam.vn)

Ghi ch: Chng ti ang c d nh s cung cp ch debug trong phin bn tng lai.

Thnh ph H Ch Minh Thng 11 nm 2007

49