Professional Documents
Culture Documents
Lab 5
Lab 5
HCM
BI THC HNH S 5
H tn sinh vin: .......................................................
Nhm: ..............................MSSV: ............................
1 Mc tiu
2 Cu hnh VLAN c bn
+ Khi trin khai VLAN trong mt h thng mng cc b, ngi qun tr c th thit k VLAN
theo hai cch thc:
* Thit k VLAN theo dng end-to-end: cn gi l campus-wide.
Trong kiu chia VLAN ny, VLAN s tri rng trn ton campus. Mt thnh vin ca VLAN
di chuyn trong mng, thuc tnh l thnh vin ca VLAN khng thay i. iu ny c
ngha l, mi VLAN phi sn c tng switch, c bit l nhng switch nm layer access
trong m hnh 3-layer: core-distribution-access.
Nh vy, trong end-to-end VLAN, cc ngi dng s c nhm vo thnh nhng nhm da
theo chc nng, theo nhm d n hoc theo cch m nhng ngi dng s dng ti nguyn
mng.
*Chia VLAN dng cc b:
VLAN c gii hn trong mt switch hoc mt khu vc a l hp (trong mt wiring closet).
Ly do dng dng VLAN ny l cc VLAN dng end-to-end tr nn kh duy tr. Cc ngi
dng thng xuyn yu cu nhiu ti nguyn khc nhau. Cc ti nguyn ny thng nm trong
nhu VLAN khc nhau.
Thc hi n
1.Tao c s d li u VLAN
Mi VLAN c m t s phn bi t l vlan-id, c th t 1 n 1001. to c s d li u VLAN
(VLAN database) thc hi n cc bc nh sau:
Vo mode cu hnh cho VLAN database:
Switch#vlan database
To mi VLAN bng cu l n h vlan vlan-id [name name]. Nu khng t tn cho VLAN th
tn s c ly m c nh
Switch(vlan)# vlan 20 name marketing
C p nh t d li u VLAN vo c s d liu VLAN, v thot v priviledge mode.
Trang 1/15
Switch(vlan)# exit
Kim tra cu hnh VLAN bng l nh show vlan
Switch# vlan database
Switch(vlan)# vlan 20 name marketing
VLAN 20 added:
Name: marketing
Switch(vlan)# exit
APPLY completed.
Exiting....
Switch# show vlan name marketing
VLAN Name Status Ports
---- -------------------------------- ----------------------------20 marketing active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- ----------20 enet 100003 1500 - - - - 0 0
Vic to ra cc VLAN khc s c thc hi n tng t.
2.Gan cac port cho VLAN tng ng
Trc tin cn cu hnh tt c cc port l access ports. Cc port trn switch 2950 c th 1
trong 3 ch : trunk port, multi-VLAN port v access port. Trunk port v multi-VLAN port
c dng ni vi switch khc (ho c thit b khc c to VLAN trunking). Do kt ni cc
workstation vi cc port ny nn cn phi cu hnh tt c cc port ny ch access port.
Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access
Gn cc port vo VLAN theo yu cu bng cch s dng l nh switchport access vlan n (n l s
hi u VLAN)
Switch(config)#interface fa0/4
Switch(config-if)#switchport access
Switch(config)#interface fa0/5
Switch(config-if)#switchport access
Switch(config)#interface fa0/6
Switch(config-if)#switchport access
Switch(config)#interface fa0/7
Switch(config-if)#switchport access
Switch(config)#interface fa0/8
Trang 2/15
vlan 10
vlan 10
vlan 10
vlan 20
Switch(config-if)#switchport access
Switch(config)#interface fa0/9
Switch(config-if)#switchport access
Switch(config)#interface fa0/10
Switch(config-if)#switchport access
Switch(config)#interface fa0/11
Switch(config-if)#switchport access
Switch(config)#interface fa0/12
Switch(config-if)#switchport access
vlan 20
vlan 20
vlan 30
vlan 30
vlan 30
M c nh cc port c gn vo VLAN 1.
3. Cu hnh VLAN trunking
M hnh lab
Thc hi n
Cu hnh trn Switch DL1 lm VTP Server
1. t hostname, mt khu v cu hnh cng vlan trn DL1:
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname DL1
DL1(config)#enable password cisco
DL1(config)#line vty 0 15
DL1(config-line)#password cisco
DL1(config-line)#login
DL1(config-line)#exit
DL1(config)#int vlan 1
DL1(config-if)#ip address 192.168.1.3 255.255.255.0
DL1(config-if)#end
DL1#
Trang 3/15
Trang 4/15
access
cu hinh cng vao vlan 10DL1(config-if)#switchport access
vlan 10
! Mi access port chi phuc vu cho m
t VLAN
DL1(config-if)#int f0/5
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 10
DL1(config-if)#int f0/6
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 10
DL1(config)#int f0/7
DL1(config-if)#switchport
DL1(config-if)#switchport
DL1(config-if)#int f0/8
DL1(config-if)#switchport
DL1(config-if)#switchport
DL1(config-if)#int f0/9
DL1(config-if)#switchport
DL1(config-if)#switchport
DL1(config)#int f0/10
DL1(config-if)#switchport
DL1(config-if)#switchport
DL1(config-if)#int f0/11
DL1(config-if)#switchport
DL1(config-if)#switchport
DL1(config-if)#int f0/12
DL1(config-if)#switchport
DL1(config-if)#switchport
mode access
access vlan 20
mode access
access vlan 20
mode access
access vlan 20
mode access
access vlan 30
mode access
access vlan 30
mode access
access vlan 30
Trang 5/15
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/5
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/6
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config)#int f0/7
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/8
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/9
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config)#int f0/10
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/11
AL1(config-if)#switchport
AL1(config-if)#switchport
AL1(config-if)#int f0/12
AL1(config-if)#switchport
AL1(config-if)#switchport
mode access
access vlan 10
mode access
access vlan 10
mode access
access vlan 10
mode access
access vlan 20
mode access
access vlan 20
mode access
access vlan 20
mode access
access vlan 30
mode access
access vlan 30
mode access
access vlan 30
Trang 7/15
Trang 8/15
Trang 9/15
Trang 10/15
C ba 2950 switch c dng trong bi lab. Chung ta s cu hnh VLAN trn cc switch 2950
v dng 2600A router din t vic nh tuyn.Chung ta s to ba VLAN trn cc switch
2950A, 2950B, and 2950C. Chung ta s dng subnet 192.168.100.0/24.
1. Cu hnh Router 2600
Router>enable
Router#config t
Router(config)#hostname 2600A
2600A(config)#enable secret todd
2600A(config)#line console 0
2600A(config-line)# password todd
2600A(config-line)#login
2600A(config-line)#line aux 0
2600A(config-line)#password todd
2600A(config-line)#login
2600A(config-line)#line vty 0 4
2600A(config-line)#password todd
2600A(config-line)#login
2600A(config-line)#interface fastethernet 0/0
2600A(config-if)#ip address 192.168.100.1 255.255.255.0
2600A(config-if)#description connection to LAN 100
2600A(config-if)#no shutdown
2600A(config-if)#exit
Trang 11/15
Switch>enable
Switch#config t
Switch(config)#hostname 2950B
2950B(config)#enable password todd
2950B(config)#enable secret routersim
Trang 12/15
Trang 13/15
10. Tao port f0/1 trn cac Switch l thnh vin ca VLAN 2
2950A#config t
2950A(config)#interface fastethernet 0/1
2950A(config-if)#switchport access vlan 2
2950A(config-if)#switchport mode access
2950B#config t
2950B(config)#interface fastethernet 0/1
2950B(config-if)#switchport access vlan 2
2950B(config-if)#switchport mode access
2950C#config t
2950C(config)#interface fastethernet 0/1
2950C(config-if)#switchport access vlan 2
2950C(config-if)#switchport mode access
11. HostA, HostD v HostG s thuc VLAN 2 (Sales), l mt vng a chi mng con ca
192.168.100.0/24. HostA l 192.168.100.5, HostD l 192.168.100.8 v HostG l
192.168.100.11. Default gateway l 192.168.100.1.
12. Kim tra vic cu hnh ung cc VLAN bng cch ping t HostA n HostD V HostA n
HostG.
13. HostB, HostE v HostH s thuc VLAN 3 (Marketing), l mt vng a chi mng con ca
192.168.100.0/24. HostB l 192.168.100.6, HostE l 192.168.100.9 v HostH l
192.168.100.12. Default gateway l 192.168.100.1.
14. Cu hnh port f0/2 trn 2950A switch l thnh vin ca VLAN 3.
2950A#config t
2950A(config)#interface fastethernet 0/2
2950A(config-if)#switchport access vlan 3
2950A(config-if)#switchport mode access
Trang 14/15
15. Kim tra vic cu hnh ung cc VLAN bng cch ping t HostB n HostE V HostB n
HostH.
16. HostC, HostF v HostI s thuc VLAN 3 (Finance), l mt vng a chi mng con ca
192.168.100.0/24. HostC l 192.168.100.7, HostF l 192.168.100.10 v HostI l
192.168.100.13. Default gateway l 192.168.100.1.
17. Cu hnh port f0/3 trn 2950A switch l thnh vin ca VLAN 4.
2950A#config t
2950A(config)#interface fastethernet 0/3
2950A(config-if)#switchport access vlan 4
2950A(config-if)#switchport mode access
18. Kim tra vic cu hnh ung cc VLAN bng cch ping t HostC n HostF V HostC n
HostI.
-HT-
Trang 15/15