Professional Documents
Culture Documents
Simulating A Network Lab: by - Yogesh (Aka. Geekyogi)
Simulating A Network Lab: by - Yogesh (Aka. Geekyogi)
com/
&hi manual i intellectual property o$ "eexH'. (t mu t only be publi he) in it original $orm. * ing part or republi hing altere) part o$ thi gui)e i prohibite)
(n thi mo)ule0 we will /reate 4 ,irtual Linux boxe u ing ,-ware an) con$igure them on )i$$erent ubnet . Simulate 5 6irtual /i co router u ing "NS+ an) connect them u ing 7thernet. /on$igure /i co router $or 8(. routing. Setup an 7thernet witch to connect two Linux no)e . * e 9ire hark to ni$$ the network tra$$ic $or trouble hooting.
Licen e) ,-ware work tation. You can al o get +<1)ay trial $rom the ite http://6mware.com/ /i co (=S ;5.> 8outer +?<< or any other upporte) by "NS+. Note: u er ha6e to pro6i)e their own /i co (=S to u e with "NS+. "NS+ application to be )ownloa)e) $rom http://www.gn +.net/)ownloa) 9ire hark application to be )ownloa)e) $rom http://www.wire hark.org/
5.
+.
>.
Configuring Virtual Network on VMware: ;. @ownloa) an) (n tall ,-ware work tation. 5. 3$ter opening the ,-ware work tation... go to: e)it1A,irtual Network 7)itor. Here we will con$igure 6irtual inter$ace to work with. !Note: &he layout o$ the ,irtual Network 7)itor win)ow )i$$er with the 6er ion. Here we are u ing ,-ware 9ork tation B.< which i late t at the time o$ writing thi article#. +. Here you can ee ix column Name0 &ype0 7xternal /onnection0 Ho t /onnection0 @H/.0 an) Subnet 3))re . &here are ;< )i$$erent ,irtual Network (nter$ace !,-net< to ,-netC#. &he ,-net< an) ,-netD are el$ con$igure) $or Bri)ging an) N3& an) houl) not be mo)i$ie)0 8e t we ha6e to mo)i$y.
>. @ouble click on ,-net5 an) in the ,-net in$ormation1 /ho e Ho t1only option0 check the box Econnect a Ho t ,irtual a)apter to thi Network: an) al o check the box Eu e local @H/. er6ice to )i tribute (. a))re to ,- : .ut the ubnet (. we are going to u e: ;C5.;?D.5.< an) ubnet a : 544.544.544.<
4. /lick on @H/. Setting an) peci$y the tart (. an) the 7n) (. a))re that we want to a ign. (n thi creen hot ( ha6e a igne) the entire ubnet ho t ;C5.;?D.5.; to ;C5.;?D.5.54> $or ,-net5.
/lick =k to clo e. Now a ign imilar etting $or each ,-net $rom ,-net5 to ,-netC. @o not con$igure ,-net; an) ,-netD. /lick =k0 it may take ome time... an) )oneF
Installing Linux Box on VMware Now Let: go ahea) making a linux in tall on 6mware.. Here we are going to in tall @amn Small Linux an) *buntu @i tro in ,-ware1 /lick on: Gile 1ANew1A,irtual -achine. /ho e /u tom !3)6ance)# an) go next. Heep the )e$ault option !Highe t ,er ion# on ,-ware har)ware capability an) click next.
/ho e (n taller @i k (mage $ile!i o# an) elect open the @amn Small Linux http://www.)amn malllinux.org # i o $ile an) click next.
/ho e Linux an) in the 6er ion cho e E=ther Linux 5.?.x Hernel:. 3n) click next.
/ho e a ,irtual -achine name here (:6e cho en @SL. 3n) peci$y the path where u want to keep ,-ware $ile . /lick Next.
/ho e the proper proce or in$o.. ($ it: a proce or with 5 core then elect No. o$ .roce or : ; an) No. o$ core per .roce or: 5 an) click Next.
Since it: a 6ery mall Linux li6e /@ with no in tall0 allocate ;<< -B 83- -emory $or thi in tall an) click next.
(n the network &ype cho e E* e Bri)ge Networking: to enable internet connection to your gue t machine in ,-wareI an) click Next. /ho e the 8ecommen)e) (/= a)apter an) click Next. Select E/reate a New ,irtual @i k: an) click Next. * e the recommen)e) )i k type an) click Next. -emory @i k Space cho e ;"B. -ake ure than E3llocate all the )i k pace now: i N=& checke). /ho e EStore 6irtual )i k a a ingle $ile:. /lick Next.
Speci$y )i k $ile name.. Better Heep it )e$ault. /lick Next. Now the con$iguration i almo t complete an) we ha6e to cu tomi2e the Har)ware to make in tall a))itional ,-net that we ha) create). Virtual Network Adapters *[1] o /lick on E/u tomi2e Har)ware: an) click on 3)). o Select Network 3)apter an) click Next. o /ho e /u tom an) elect ,-net5. o /heck E/onnect on .ower on:
You woul) ee a))itional Network 3)apter being a))e) to the har)ware. /lick =H to procee) with the in tall.
Select E.ower on thi ,irtual machine a$ter creation: an) click on EG(N(SH: @amn Small Linux i now rea)y to run on 6mware.
Note: &o work with the linux box in i)e 6mware u e ctrlJg
Now you mu t be eeing the )amn mall Linux running in i)e the ,-ware.
Now let: 6eri$y the network in tall... (n the @amn mall Linux 6irtual machine.. /lick on 3&erminal $or hell. Login a uper u er by entering the comman) E u:.
* e comman) Ei$con$ig: to ee the li t o$ inter$ace an) the a igne) (. a))re e . ,eri$y the (. a))re a igne) to the 6irtual (nter$ace ,-net5 to 6eri$y @H/..
"o the the ho t machine an) check the (. a))re a to the ,-net5 an) try to ping the gue t $rom the ho t.
igne)
Now the ,irtual Linux Box !gue t# an) the Ho t machine are connecte) 6irtually an) appear to be on the ame 7thernet Switche) Network. Since we nee) 4 Linux boxe ... 9e can Ku t make 4 copie o$ the current 6irtual machine $ol)er an) we are )oneF
Note: 3ll the )i$$erent ,-net !,-net 5 to C# houl) be on )i$$erent ubnet which we are going to u e it in our routing topology.
Note: 9e ha6e to mo)i$y the Network 3)apter etting $or each ,irtual Box. !&he copie that we ha) ma)e#. 9e mu t a ign each 6irtual box with )i$$erent ,-net *[1]. Since we are going to connect them acro router 0 we mu t u e )i$$erent ,-net $or each 6irtual Linux box.
e a
@SL; L ;C5.;?D.5.5 !,-net5# @SL5 L ;C5.;?D.+.5 !,-net+# @SL+ L ;C5.;?D.>.5 !,-net># @SL> L ;C5.;?D.4.5 !,-net4#
Installing
N!"
"NS+ i a graphical network imulator that allow imulation o$ complex network u ing /i co (=S0 which i the mo t table an) popular networking )e6ice on earth. "NS+ i an excellent complementary tool to real lab $or /i co network engineer 0 a)mini trator an) people wanting to pa certi$ication uch a //N30 //N.0 //(. or //(7. (t: an open ource proKect an) ha gaine) great re pect in /i co )e6eloper : community. So let: go ahea) in talling it.
http://gn +.net/
5. @ouble click in tall with all )e$ault option .. Heep clicking MNextM until in tall i $ini he). +. =pen "NS+ $rom )e ktop.. Setup wi2ar) will open.. &hi can be clo e) a o$ now.
Now pre ctrlJ hi$tJ(.. You will get a )ialogue box M(=S image an) hyper6i or M.
4. .ut the path o$ the /i co (=S $ile !$ile type: .bin# in the image $ile: option. 3n) make ure that the plat$orm an) mo)el i appropriate to the image $ile u ha6e electe). !( woul) recommen) /i co (=S /+?>< router. Becau e it upport both routing an) witching.# 3n) click on a6e. &he abo6e tep were man)atory only $or the initial etup.
!tarting a pro$e#t: ;. .re /trlJN. .ut the proKect path where u wanna tore the proKect. (t alway a goo) practice to create a $ol)er $or e6ery ingle proKect. 3l o elect the checkboxe 1 NSa6e n6ram an) other )i k $ile an) N7xport router con$iguration $ile .
5. Now you ha6e to )rag the 8outer c+?<< icon $rom the le$t panel to the work pace.
+. &he work pace now ha the /i co +?>< router rea)y to be con$igure). :# >. 8ight click on the router 8< an) click on con$igure. 4. in the lot option. 3)) two N-1;G71&O in lot< an) lot;.!You can a)) B )i$$erent type o$ inter$ace a)apter /car) in the lot a u wi h.. here we a)) two G7PGa t 7thernetQ car) .# an) click on =k.
?. 8ight click on the router on the work pace an) click on tart to tart the router. B. Now right click on the router an) click on M/on oleM to tart &elnet e ion to con$igure the router. D. Now you are rea)y to con$igure the router a per your wi h. !Note: &hi telnet e ion i u ing con ole port o$ the router#.
C. 3$ter working on terminal $or ay 41;< min.. go back to the "NS+ topology work pace an) right click on the router an) click on M()le ./M Select the 6alue which i marke) with an N. =n )oin thi 0 the proce or utili2ation i 6ery much re)uce).
;<. &o a6e the proKect... )o /trl J S to a6e the router etting an) con$iguration $ile. &hu a ingle router i ucce $ully imulate) an) con$igure). :# Now let: buil) a multi1router topology...
;. @rag a many router a u nee) !5 $or thi mo)ule# $rom the no)e type into the topology work pace an) con$igure them a )i cu e) in the pre6iou ection $rom .t: 51;<. 5. &o connect the router click on the icon option. an) elect manual
+. Now le$t click on the router an) elect the inter$ace to be connecte). an) then click on other router to connect the wire.
>. Now the router are connecte) to each other phy ically. :#
(t: po ible to connect ,irtual -achine running on ,-ware to be connecte) to the router . &hi i )one u ing clou) in the no)e type.
;. @rag the clou)0 pre ent o$ the le$t no)e panel to the work pace. 5. 8ight click on the clou) an) click on con$igure. +. (n the E"eneric 7thernet N(=:0 elect the appropriate ,-net to be connecte) an) click on 3@@ an) click on =H.
4. Now router an) the ,irtual -achine are connecte) u ing a phy ical wire.
;. /on$igure an) connect the router !router;0 router5# with the clou) N;0 N50 N+0 an) N>. 5. /on$igure 8(. protocol to enable routing between the two router a $ollow : Since each router i connecte) to + )i$$erent wire) 7thernet wire . 9e nee) to con$igure the inter$ace on each router uch that there are atlea t + Ga t 7thernet lot . =pen telnet con ole e ion $or 8outer ;
o 3n wer ENo: $or initial con$iguration option. o EA: i non1pri6ilege) mo)e0 type Eenable: to enter into pri6ilege) mo)e ER:. o &ype E how ip int brie$: to get the brie$ li t o$ all the inter$ace pre ent on router. o &o con$igure the router type Econ$ig terminal:
o &o con$igure the inter$ace (. a))re Eint $a Sint$aceTi)A: 7g. (nt $a </< o E(p a))re
7g. ip a))re
;C5.;?D.;.; 544.544.544.<
o Similarly a
Note: u e the comman) Eno hut)own: on all the inter$ace an) Eexit: comman) to come back to the global con$iguration mo)e. 3ll the inter$ace o$ both the router mu t be a igne) appropriate (. a))re e an) no hut)own comman) i a mu t. &ype E)o write: to a6e the con$iguration. You nee) to )o thi o$ten to a6e the con$iguration o that it tay )uring next tart1up. Now to tart routing.. * e the $ollowing comman) in global con$iguration mo)e:
o
o o
E,er ion 5: to u e 8(. 65 ENetwork Sip a))re A: to enable rip on tho e particular (. con$igure) inter$ace . @o the e tep on both the router an) the routing will tart.
Note: you may ha6e to et the )e$ault gateway $or the ,irtual boxe to the router: inter$ace (.. Note: You can al o a)) 7thernet Switche pro6i)e) in the "NS+ to buil) witche) network . &hu now the ,irtual linux boxe with )i$$erent ubnet are able to communicate with each other. /ongratulation you ha6e buil) an entire Network topology on your y tem. You can te t an) play with it. /i co certi$ication $reak will lo6e it. Now to )o more... 9ire hark can al o be u e) to ni$$ the packet on the inter$ace by right clicking on the router inter$ace an) clicking on capture. Here i a brie$ intro)uction about 9ire hark1
Introdu#tion to )ires(ark
(t i the econ) be t ecurity a to in ecure.org. e ment tool accor)ing
(t allow you to examine )ata $rom a li6e network )el6ing )own into Ku t the le6el o$ packet )etail you nee). (t al o upport hun)re) o$ protocol an) me)ia type . Gollow the e tep an) get tarte)F ;. @ownloa) wire hark http://www.wire hark.org/ @irect in tall i$ you are u ing win)ow . Gor @ebian u er u)o apt1 get in tall wire hark 5. &o tart capturing the network tra$$ic click on /apture 1A (nter$ace . you will get a li t o$ inter$ace a6ailable. click on tart to capture. +. .acket mu t ha6e tarte) pouring.. &o top the capture. /apture 1A top. >. Now you are rea)y to analy2e the packet . 3 you can ee there are > )i$$erent column 1 in)icate the or)er in which the packet are recei6e). &ime: Sec. ince the la t packet. /lick on 6iew 1A &ime )i play $ormat. ource: ource (. or -3/ a))re . @e tination: @e tination (. or -3/ a))re . .rotocol: .rotocol u e) by the packet. (n$o: ummari2e) in$o o$ the packet content. Now you can click on packet you wanna examine an) the )etail are hown below. ($ it: an (. packetI you woul) ee the 6ariou &/./(. layer 1
No:
Grame : pro6i)e the phy ical layer )etail 7thernet (( : pro6i)e -3/ )etail (nternet .rotocol: pro6i)e ource logical (. an) )e tination logical (.. &/./*@.: )i play port )etail . @ata: application )ata. 7xpan) the tree an) 6iew all the )etail about the &/. / (. communication. Note: you can a6e your network capture an) keep a backup a .cap $ile or .pcap $ile.