Sunteți pe pagina 1din 80

Introduction to Routing and Switching Simulate with GNS3

Nguyn Quc nh
Faculty of IT !o "hi #inh "ity $ni%er&ity of Indu&try Se't ()*3

Schedule for *) +ee,&


-art *. Starting with GNS3 -art (. Static routing -art 3. /01N -art 2. 01N with ST-art 3. RI- 4%( ng5 -art 6. 7S-F -art 8. 9G-art :. #ultica&ting -art ;. 1cce&& "ontrol 0i&t -art *). Re%iew 47h great5
2

-art * Starting with GNS3


Nguyn Quc nh

+hy not -ac,et Tracer<

!ow different<

-ac,et Tracer. &imulation 'rogram GNS3. emulation 'rogram

7n -T you =u&t can>t fully o'erate 9G- STmultica&t 9ut the u'&ide of -T 4&o it>d ?e there5

0ightweight @a&ily to configure and &ee the re&ult


4

To get &tarted with GNS3 &ee

GNS3. Gra'hical Networ, Simulator


?y #i,e Fu&Aner %*B)

Note&. Setu'

For thi& 'art and al&o later 'art& u&e I7S 362) #a,e &ure to ha%e %irtual -" 4%'c5 for your te&ting 4iBeB 'ing5 GNS3 and it& com'onent& run fa&ter under 0inuC than under +indow&

1?o%e all alway& &et IDLE PC to &a%e your com'uter com'utation

Try to remem?er all command& may o%erload your little ?rain u&e < for command& &u''orted
6

Note. Sa%ing configuration

"onfiguration& in two location& D R1# and N/R1#B The running configuration i& &tored in R1#B 1ny configuration change& to the router are made to the runningDconfiguration and ta,e effect immediately after the command i& enteredB The &tartu'Dconfiguration i& &a%ed in N/R1# and i& loaded into the router>& runningDconfiguration when the router ?oot& u'B To &a%e the runningDconfiguration to the &tartu' configuration ty'e the following from 'ri%ileged @E@" mode 4iBeB at the FRouterGF 'rom'tB5

#copy running-config startup-config


7

Ti'. Sa%e your wor,ing freHuently with


#copy running-config startup-config

Target.

Read 4and do5 u' to 'age G2) of #i,e>& tutorial Iou ha%e to &etu' and configure I- addre&& of -"& in thi& networ,

PC1

PC2

PC3

Q. "ould -"* 'ing F)J) of +e&t< +hy Q. "ould -"* 'ing S)J* of +e&t< +hy Q. "ould -"* 'ing -"(< +hy

10

-art ( Static Routing


Nguyn Quc nh

11

+hy &tatic routing<

Static routing %& Kynamic routing


!ow different< +hat &cale<

Static routing. toy game for tiny networ,

12

"ommand&

config t interface Fa)J) i' addre&& Li'Daddre&&M L&u?netDma&,M &how i' route. di&'lace routing ta?le in a router i' route Lde&tinationDnetwor,Daddre&&M L&u?netD ma&,M LneCtDho'DI-Daddre&&M. configure &tatic route &tatement &h i' int ?rief. di&'lace ?rief interface& information
13

0a? *

Target. $&e &tatic routing to connect all -"& in thi& networ, I- addre&&e& of interface and -"& are &hown in the 'icture
14

Hint. configure &tatic routing ta?le in each

West

4config5Gi' route *;(B*6:B*B) (33B(33B(33B) *)B)B)B( 4config5Gi' route *;(B*6:B(B) (33B(33B(33B) *)B)B)B(

Central

4config5Gi' route *;(B*6:B)B) (33B(33B(33B) *)B)B)B* 4config5Gi' route *;(B*6:B(B) (33B(33B(33B) *)B)B*B(

East

4config5Gi' route *;(B*6:B)B) (33B(33B(33B) *)B)B*B* 4config5Gi' route *;(B*6:B*B) (33B(33B(33B) *)B)B*B*

15

"ommand Nshow ip routeO on +e&t @a&t and "entral Koe& it re%eal &omething< Try to eC'lain the re&ult& See more re&ult& with ping traceroute 4router5 and tracert 4-"5

16

"hec, your under&tanding ?y configure following networ,


7 8

6 4 5

17

ReHuirement& for 're%iou& &cenario

Grand addre&&e& 172.(15+X).0.0/16 for EDth &u?netB $&er &tatic routing

1ll -"& could communicate through the networ, &how i' route 'ing to the internet tracert from -"
18

"hec,ing 4alway& chec,ing5


-art 2 01N with STNguyn Quc nh

19

7?=ecti%e

0earn how to identify which &witch i& elected a& the root ?ridgeB 0earn how to determine the o'timum ?ridge 'lacementB 0earn to o'timiAe S'anning Tree con%ergenceB 0earn to change connection co&tB

20

To u&e &witch PGNS3

GNS3 doe&n>t include layerD( and layerD3 &witche&B


we could utiliAe router a& &witch in&tead ?y u&ing N#D*6@S+ module in routerB In thi& way you can configure &witching 'rotocol& li,e /01N ST- /T- ectB To ma,e a &witch &ym?ol &ee following &lide

!ow<

21

To u&e &witch PGNS3


3

1
You got a switc s!"#ol $ro" c36%% &c364%' (se it in t e $ollowing )L*+ la#s

22

4*5 Networ, &cenario

-ut the &witch in order a& &hown in the 'ictureB In which the R2 i& 'ut in the la&t

2 ( 3
23

9y default ST- i& ?uild in /01N *B 1nd R* i& the rootB +hy< R*G&how &'anningDtree

/01N* i& eCecuting the ieee com'ati?le S'anning Tree 'rotocol 9ridge Identifier ha& 'riority 3(86: addre&& cc))B3;8eB)))) "onfigured hello time ( maC age () forward delay *3 +e are the root of the &'anning tree To'ology change flag not &et detected flag not &et Q -ort * 4Fa&t@thernet)J)5 of /01N* i& forwarding -ort 'ath co&t *; -ort 'riority *(: -ort Identifier *(:B*B Ke&ignated root ha& 'riority 3(86: addre&& cc)*B6)ceB)))) Ke&ignated ?ridge ha& 'riority 3(86: addre&& cc)*B6)ceB)))) Ke&ignated 'ort id i& *(:B* de&ignated 'ath co&t ) Q 9-K$. &ent (2 recei%ed ) -ort ( 4Fa&t@thernet)J*5 of /01N* i& forwarding -ort 'ath co&t *; -ort 'riority *(: -ort Identifier *(:B(B
24

R*G&how &'anningDtree

/01N* i& eCecuting the ieee com'ati?le S'anning Tree 'rotocol 9ridge Identifier ha& 'riority 3(86: addre&& cc))B3;8eB)))) "onfigured hello time ( maC age () forward delay *3 +e are the root of the &'anning tree To'ology change flag not &et detected flag not &et Q

R(G&how &'anningDtree

/01N* i& eCecuting the ieee com'ati?le S'anning Tree 'rotocol 9ridge Identifier ha& 'riority 3(86: addre&& cc)*B3;8eB)))) "onfigured hello time ( maC age () forward delay *3 "urrent root ha& 'riority 3(86: addre&& cc))B3;8eB)))) Root 'ort i& ( 4Fa&t@thernet)J*5 co&t of root 'ath i& 3: Q
25

+here>& the root

R* i& the rootB 9y default a Root 9ridge i& elected and the one ha& &lowe&t 9ridge IK 4determined ?y the 9ridge -riority and the #1" addre&&5 i& the winnerB +ant to ma,e

R2 to ?e the root ?ridge

26

"hange the root ?ridge

9y default all ?ridge ha& 'riority of 32768 To change 'riority of one ?ridge.
Switch (config)# spanning-tree vlan <vlan-list> priority <bridge-priority>

To ma,e one ?ridge ?e rootD?ridge 4'riority R :*;(5


Switch (config)# spanning-tree vlan <vlan-list> root primary

To ma,e one ?ridge ?e &econdary rootD?ridge for redundancy 4'riority R *63:25


Switch (config)# spanning-tree vlan <vlan-list> root secondary
27

0et>& ma,e &ome change&

#a,e R2 ?ecome the root.


R4(config)# spanning-tree vlan 1 root primary

#a,e R3 ha& one 'ort to ?e ?loc,ed 4why we ha& following &etting<5


R3(config)#spanning-tree vlan 1 priority 61440

28

4(5 "hange the co&t of each lin,

Kefault 'ath co&t&


*)9a&eT. *))9a&eT. *)))9a&et. *)) *; 2

To change the co&t in each lin,


switch (config-if)# spanning-tree vlan <vlanlist> cost <cost>

+hat ha''en& when the 'ort of R2 which lin,& to R( ha& the co&t of *3<
29

435 S'anning tree con%ergence

ST- u&e& &e%eral timer& to reco%er from to'ology change& #odifying ST- timer&

spanning-tree vlan vlan-list hello-time seconds spanning-tree vlan vlan-list forward-time seconds spanning-tree vlan vlan-list max-age seconds

30

-art 2 /01N
Nguyn Quc nh

32

Note& on /01N

/01N& are a&&igned on the &witch 'ortB There i& no N/01NO a&&ignment done on the ho&t 4u&ually5B 1&&igning a ho&t to the correct /01N i& a (D&te' 'roce&&.
*B "onnect the ho&t to the correct 'ort on the &witchB (B 1&&ign to the ho&t the correct I- addre&& de'ending on the /01N meme?er&hi'

Remem?er. /01N R Su?net

Following la?& we u&e &tatic /01N&


33

"ommand& Related to /01N


To add more item& to %lan data?a&e. #vlan database (vlan)#vlan 20 name engineering To ma,e a ho&t connect to current 'ort ?elong to %lan (). (config-if)#switchport mode access (config-if)#switchport acess vlan 20 To turn current 'ort to trun,ing mode. (config-if)#switchport mode trunk (config-if)#switchport trunk allowed vlan all
34

"ommand& Related to /01N 4cont5


1nd to &how %lan &ummary. #show vlan? #show vlan-switch #show interfaces fa0/1 switchport #sh vtp status Following &lide& eC'lain more in few command&

35

"onfigure Range& of /01N&


Switch(config)#interface range fastethernet 0/8 fastethernet 0/12 Switch(config-if)#switchport access vlan ! Switch(config-if)#e"it

,lan 3

36

#ode 1ce&&
Switch(config)#interface fastethernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#e"it Note. The &witch'ort mode acce&& command &hould ?e configured on all 'ort& that the networ, admini&trator doe& not want to ?ecome a trun, 'ortB

37

Face #i&ta,e to Remo%e


Keleting a -ort /01N #em?er&hi'
Switch(config-if)#no switchport access vlan vlan_number

Keleting a /01N
Switch#vlan database Switch(vlan)#no vlan <vlan_number> Switch(vlan)#exit
38

/01N Tagging
+o )L*+ -agging

)L*+ -agging

To turn current 'ort to trun,ing mode. (config-if)#switchport mode trunk (config-if)#switchport trunk allowed vlan all 7r more &electi%e (config-if)#switchport trunk allowed vlan 10 20
39

0a? *. 1&&ign /01N -ort


-arget. "reate thi& /01N ta?le PR*. /01N *. default /01N *). engineering /01N (). rDd /01N 3). accounting /01N 2). &ale /01N *) own& *8(B*6:B*)B)J(2 &u?net /01N () own& *8(B*6:B**B)J(2 &u?net /01N 3) own& *8(B*6:B*(B)J(2 &u?net /01N 2) own& *8(B*6:B*3B)J(2 &u?net

40

0a? *. 1&&ign /01N -ort 4cont5


1&&ign following. ") owned ?y an engineer "* owned ?y an engineer "( owned ?y a &eller Their I- addre&&e& a&&igned ?y your own "onfigure the networ,B Then an&wer. "an ") 'ing "*< +hy< "an ") 'ing "(< +hy<
41

0a? (. /01N Trun,ing

switchport mode trunk switchport mode access


42

0a? (. /01N Trun,ing 4cont5

1&&ign following. ") owned ?y an engineer "* owned ?y an engineer "( owned ?y a &eller "3 owned ?y an engineer "2 owned ?y a &eller

Their I- addre&&e& a&&igned ?y your own


"hec, if all engineer&J&eller& a&&igned to the &ame &u?net
43

0a? 3 4o'tion5. Te&ting your under&tanding with /01N Trun,ing

For guidance &ee attached documentation 4'art3Dla?3B'df5 from TruongTan In&tB

44

0a? 2 4o'tion5. Routing ?etween /01N&

For guidance &ee attached documentation 4'art3Dla?2B'df5 from TruongTan In&tB

45

-art 3 RINguyn Quc nh

46

Recall

Ki&tance %ector routing RI- RI-%( RI-ng

47

Fir&t eCam'le
9uild a &y&tem with I-& of router& and -"& a& &hown at the figure

48

Setu' RI-%( a& routing algorithm


West(config-if)#router rip West(config-router)#version 2 West(config-router)#networ !"#$!%&$'$' West(config-router)#networ !'$'$'$' (entral(config-if)#router rip (entral(config-router)#version (entral(config-router)#networ (entral(config-router)#networ (entral(config-router)#networ

2 !"#$!%&$!$' !'$'$'$' !'$'$!$'

)ast(config-if)#router rip )ast(config-router)#version 2 )ast(config-router)#networ !"#$!%&$#$' )ast(config-router)#networ !'$'$!$'


49

Su?net ma&,<

Since cla&& in networ, addre&& i& hi&tory do not u&e RI-%* RI-%( wor, with "IKRS ?ut you didn>t &ee &u?net ma&, on a?o%e command&B

!ow<

50

"hec,ing chec,ing

"hec, RI- with following command

show ip route show ip route protocols show ip rip database tracert tracerouter show ip protocol

Try to read the re&ult


51

@Ctend your &imulation

52

@Ctend your &imulation

1dd the new lin, to RI

Now you ha%e ( way& to go from *;(B*6:B)B)J(2 to *;(B*6:B(B)J(2 networ,


"hec,
Show ip route Show ip protocols Tracert

Tear down @a&t>& e)J* D &witch lin, Tear down +e&t>& &*J) T "entral>& &*J) lin,

See what ha''en try to eC'lain the re&ult


53

"hec, your under&tanding ?y configure following networ,


7 8

6 4 5

54

"hec, your under&tanding ?y configure following networ,

ReHuirement&

Iou are allow to utiliAe *)B)B)B)J: networ, Su?net E are a&&igned with *)B4*3UE5B)B)J*6 addre&& &'ace& $&e RI-%( for thi& autonomou& &y&tem #a,e &ure all -"& could connect to the Internet "hec, your networ, connection

55

!ow a?out RI-ng<


I-%6 %er&ion of RI"ommand&.

#using ipv6 unicasting (config)#ipv6 unicast-routing #assign an IPv6 address to current interface (config-if)#ipv6 address <ip address> #enable RIPng under process-name (config-if)#ipv6 rip <process name> enable
56

@Cam'le

9e&ide NtraditionalO interface eBgB fa&t ethernet we ado't loo'?ac, interface notationB
57

E/a"0le o$ West con$iguration


West(config)#ipv6 unicast-routing West(config)#int e0/0 West(config-if)#ipv6 address 2001:db8:0:12::1/64 West(config-if)#ipv6 rip tree enable West(config-if)#no shut West(config)#int loopback 0 West(config-if)#ipv6 address 2001:db8:0:10::1/64 West(config-if)#ipv6 rip tree enable West(config-if)#no shut Q

Then Q try to find your way to configure Central and EastB Te&t your networ, with show ipv6 route, show ipv6
protocols, tracert, etc.
58

-art 6 7S-F
Nguyn Quc nh

59

Recall

+hat i& 7S-F< #ulti'le area networ,

60

@Cam'le

61

@Cam'le
*rea %

*rea 1

*rea 2

62

"ommand&

router ospf process-*+


'roce&&DIK i& from * to 63333 may defer from node to node

networ *,-address wildcard-mas area area-#


wildcardDma&, R not 4networ, ma&,5 areaDG i& 'reDdefined num?er ma,e &ure ?ac,?one area named Narea 0O

63

"ommand&
R1 Network 192.168.23.0 0.0.0.255 area 0 Network 10.0.1.0 0.0.0.255 area 1 R2 network 192.168.23.0 0.0.0.255 area 0 Network 172.16.34.0 0.0.0.255 area 2 R3 network 10.0.1.0 0.0.0.255 area 1 network 10.0.2.0 0.0.0.255 area 1 R4 network 172.16.34.0 0.0.0.255 area 2 network 172.16.35.0 0.0.0.255 area 2
64

!el'ful command& for 7S-F


s ow i0 0rotocol s ow i0 route s ow i0 os0$ s ow i0 os0$ inter$ace s ow i0 os0$ #or1er2routers s ow i0 os0$ neig #or s ow i0 os0$ neig #or 1etail clear i0 route 3 clear i0 route a4#4c41 clear i0 o0s$ counters clear i0 os0$ 1e#ug i0 os0$ e,ents ?etween ad=acent 1e#ug i0 os0$ 0ac6ets Ki&'lay& 7-SF 'ac,et&
65

Ki&'lay& 'arameter& for all 'rotocol& running on the router Ki&'lay& a com'lete I- routing ta?le Ki&'lay& ?a&ic information a?out 7S-F routing 'roce&&e& Ki&'lay& 7S-F info a& it relate& to all interface& Ki&'lay& ?order and ?oundary router information Ki&'lay& a detailed li&t of neigh?or& 0i&t& all 7S-F neigh?or& and their &tate& "lear& entire routing ta?le forcing it to re?uild "lear& &'ecific route to networ, aB?BcBd Re&et& 7S-F counter& Re&et& entire 7S-F 'roce&& forcing 7S-F to reDcreate Ki&'lay& all 7S-F e%ent&

neigh?or& 'roce&& data?a&e and routing ta?le 1e#ug i0 os0$ a15acenc! routers Ki&'lay& %ariou& 7S-F &tate& and KRJ 9KR election

"hec, your under&tanding


+ith following &ide networ, -ay attention.


J(: 4not J(2 any more5 Recalculate &u?netDid Recalculate wildcardDma&,

66

67

-art 8 9GNguyn Quc nh

68

9G- in o%er%iew

multihomed transit
69

9G- command& in GNS3

Keclare your own 1S num?er ?y


router bgp <as-number>

Kefine neigh?or& with


neighbor <address> remote-as <asnumber>

Kefine the networ,& you own ?y


network <address> mask <mask>

70

0a? *

71

0a? *

72

0a? *
Router 0
Router0(config)#router bgp 1 Router0(config-router)#neighbor 4.4.4.2 remote-as 2 Router0(config-router)#network 1.1.1.0 mask 255.255.255.0

Router 1
Router1(config)#router bgp 2 Router1(config-router)#neighbor 4.4.4.1 remote-as 1 Router1(config-router)#neighbor 5.5.5.3 remote-as 3 Router1(config-router)#network 2.2.2.0 mask 255.255.255.0

Router 3
Router2(config)#router bgp 3 Router2(config-router)#neighbor 5.5.5.2 remote-as 2 Router2(config-router)#network 3.3.3.0 mask 255.255.255.0
73

0a? *

$&e following de?ugging command to chec, your &y&tem

show ip protocols show ip route show ip bgp tracert tracerouter

74

"hec, your under&tanding networ, with 9G- 0a? (

75

*ll su#nets are 724

76

Inter 1S. 9G1S* Run multiarea 7S-F

1S( Run RI-

1S3 Run RI-

77

89P: area %

;IP,2

89P: area 2 89P: area 1

;IP,2

78

"hec, your under&tanding networ, with 9G- 0a? 3 4V5

4V5 Thi& networ, i& ta,en from htt'.JJ?uilding?g'la?B?log&'otBcom


79

80

-art : #ultica&ting
Nguyn Quc nh

81

S-ar putea să vă placă și