Chuong2 Dinh Nghia Vlan

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Chng 2 -

NH NGHA VLANs

Bi 2.1 Cu hnh VLANs v trunks cho switch layer2 v switch layer 3 2.1.1 S lun l

Hnh 2.1.1-1: Hnh v s lun l

2.1.2 Tn thit b
Switch 3560 Switch 2950 PC1 PC2

Bng a ch VLAN 10
Fa0/2 Fa0/9 Fa0/2 Fa0/8 -

a ch IP
192.168.2.10/24 192.168.2.11/24 192.168.1.10/24 192.168.1.11/24

VLAN 20
Fa0/10 Fa0/16 Fa0/9 Fa0/14 -

VLAN 30
Fa0/17 Fa0/24 Fa0/15 Fa0/24 -

2.1.3

Mc tiu ca bi thc hnh Cu hnh VLAN 99, VLAN 10, VLAN 20 v VLAN 30 trn cc switch. Cu hnh ng trunk gia cc switch trn cc cng Fa0/1. Dng lnh ping kim tra kt ni gia 2 pc khi kt ni vi switch trn cc VLAN 10, 20 v 30 Kim tra v xem xt hot ng ca thit b c cu hnh

2.1.4

Hng dn cu hnh v hnh v minh ha Bc 1: kt ni cc thit b theo s lun l

22

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Bc 2: dng my tnh kt ni n cng console ca thit b v s dng phn mm Hyper terminal hoc SecureCRT kt ni n thit b qua cng console 0 Bc 3: thc hin vic cu hnh c bn cho thit b nh cc bi thc hnh trc theo yu cu. Cu hnh c bn cho SW2950 Switch(config)#hostname SW2950 SW2950(config)#enable password cisco SW2950(config)#no ip domain-lookup SW2950(config)#banner motd ^CSwitch 2950^C SW2950(config)#line console 0 SW2950(config-line)# logging synchronous SW2950(config-line)# password cisco SW2950(config-line)# login SW2950(config)#line vty 0 4 SW2950(config-line)# password cisco SW2950(config-line)# login Cu hnh c bn cho SW3560 Switch(config)#hostname SW3560 SW3560(config)#enable password cisco SW3560(config)#no ip domain-lookup SW3560(config)#banner motd ^CSwitch 3560^C SW3560(config)#line console 0 SW3560(config-line)# logging synchronous SW3560(config-line)# password cisco SW3560(config-line)# login SW3560(config)#line vty 0 4 SW3560(config-line)# password cisco SW3560(config-line)# login Bc 4: cu hnh VLAN cho cc switch Cu hnh VLAN cho SW2950

SW2950(config)#vlan 10 SW2950(config-vlan)#name VLAN10 SW2950(config-vlan)#exit

23

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

SW2950(config)#vlan 20 SW2950(config-vlan)#name VLAN20 SW2950(config-vlan)#exit SW2950(config)#vlan 30 SW2950(config-vlan)#name VLAN30 SW2950(config-vlan)#exit

Hnh 2.1.4-1: Show vlan trn Switch 2950

Cu hnh VLAN cho SW3560 SW3560(config)#vlan 10 SW3560(config-vlan)#name VLAN10 SW3560(config-vlan)#exit SW3560(config)#vlan 20 SW3560(config-vlan)#name VLAN20 SW3560(config-vlan)#exit SW3560(config)#vlan 30 SW3560(config-vlan)#name VLAN30 SW3560(config-vlan)#exit

24

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.1.4-2: Show vlan trn Switch 3560

Bc 5: cu hnh interface trunk cho cc switch interface Fa0/1. Cu hnh interface trunk cho SW2950 SW2950(config)# interface fastEthernet0/1 SW2950(config-if)# switchport mode trunk

Hnh 2.1.4-3: Show interface trunk trn Switch 2950

Cuhnh interface trunk cho SW3950 SW3560(config)#interface fastEthernet 0/1 SW3560(config-if-range)#switchport trunk encapsulation dot1Q SW3560(config-if-range)#switchport mode trunk

25

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.1.4-4: Show interface trunk trn Switch 3560

Bc 6: thc hin kim tra cu hnh v hot ng ca cc thit b v PC. Bc 7: Xa cu hnh, khi ng li thit b, hon tr li thit b v hon tt bi lab. Trn SW2950 SW2950#dir flash: Directory of flash:/ SW2950#dir flash: Directory of flash:/ 2 -rwx 3706496 Mar 01 1993 00:20:41 +00:00 c2950_cpryto.bin 13 -rwx 616 Mar 01 1993 03:10:29 +00:00 vlan.dat 17 -rwx 1150 Mar 01 1993 03:10:31 +00:00 config.text 7741440 bytes total (4031488 bytes free) SW2950#delete config.text Delete filename [config.text]? Delete flash:config.text? [confirm] SW2950#delete vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] SW2950#reload Proceed with reload? [confirm] TrnSW3560 SW3560#dir flash: Directory of flash:/

26

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

7 drwx 35.SE5 469 -rwx 470 -rwx 472 -rwx

192

Mar 1 1993 00:06:52 +00:00 c3560-ipbase-mz.122-

704 Mar 1 1993 01:24:35 +00:00 vlan.dat 1413 Mar 1 1993 00:14:04 +00:00 config.text 5 Mar 1 1993 00:14:04 +00:00 private-config.text

32514048 bytes total (23435776 bytes free) SW3560#delete config.text Delete filename [config.text]? Delete flash:config.text? [confirm] SW3560#delete vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] SW3560#reload Proceed with reload? [confirm]

27

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Bi 2.2 Cu hnh Trunks s dng ISL v VLANs trn switch layer 3 2.2.1 S lun l

2.2.2

Mc tiu ca bi thc hnh Cu hnh VLAN 10, VLAN 20 v VLAN 30 trn cc switch. Cu hnh ng trunk gia cc switch trn cc cng Fa0/1 s dng ISL protocol. Dng lnh ping kim tra kt ni gia 2 pc khi kt ni vi switch trn cc VLAN 10, 20 v 30 Kim tra v xem xt hot ng ca thit b c cu hnh

2.2.3

Hng dn cu hnh v hnh v minh ha Bc 1: kt ni cc thit b theo s lun l Bc 2: dng my tnh kt ni n cng console ca thit b v s dng phn mm Hyper terminal hoc SecureCRT kt ni n thit b qua cng console 0 Bc 3: thc hin vic cu hnh c bn cho thit b nh cc bi thc hnh trc theo yu cu.

Cu hnh c bn cho SW1_3560 Switch(config)#hostname SW1_3560 SW1_3560 (config)#enable password cisco SW1_3560 (config)#no ip domain-lookup SW1_3560 (config)#banner motd ^CSwitch 3560 01^C SW1_3560 (config)#line console 0 SW1_3560 (config-line)# logging synchronous SW1_3560 (config-line)# password cisco

28

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

SW1_3560 (config-line)# login SW1_3560 (config)#line vty 0 4 SW1_3560 (config-line)# password cisco SW1_3560 (config-line)# login Cu hnh c bn cho SW2_3560 Switch(config)#hostname SW2_3560 SW2_3560 (config)#enable password cisco SW2_3560 (config)#no ip domain-lookup SW2_3560 (config)#banner motd ^CSwitch 3560_02^C SW2_3560 (config)#line console 0 SW2_3560 (config-line)# logging synchronous SW2_3560 (config-line)# password cisco SW2_3560 (config-line)# login SW2_3560 (config)#line vty 0 4 SW2_3560 (config-line)# password cisco SW2_3560 (config-line)# login Bc 4: cu hnh VLAN cho cc switch theo yu cu trn. Cu hnh VLAN cho SW1_3560 SW1_3560(config)#vlan 10 SW1_3560 (config-vlan)#name VLAN10 SW1_3560 (config-vlan)#exit SW1_3560 (config)#vlan 20 SW1_3560 (config-vlan)#name VLAN20 SW1_3560 (config-vlan)#exit SW1_3560 (config)#vlan 30 SW1_3560 (config-vlan)#name VLAN30 SW1_3560 (config-vlan)#exit

29

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.2.3-1: Show vlan trn SW1_3560

Cu hnh VLAN cho SW2_3560 SW2_3560 (config)#vlan 10 SW2_3560 (config-vlan)#name VLAN10 SW2_3560 (config-vlan)#exit SW2_3560 (config)#vlan 20 SW2_3560 (config-vlan)#name VLAN20 SW2_3560 (config-vlan)#exit SW2_3560 (config)#vlan 30 SW2_3560 (config-vlan)#name VLAN30 SW2_3560 (config-vlan)#exit

30

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.2.3-2: Show vlan trn SW2_3560

Bc 5: cu hnh interface trunk cho cc switch interface Fa0/1 s dng ISL protocol Cu hnh Interface trunk cho SW1_3560 SW1_3560(config)#interface fastEthernet 0/1 SW1_3560(config-if-range)#switchport trunk encapsulation isl SW1_3560(config-if-range)#switchport mode trunk

Hnh 2.2.3-3: Show interfaces trunk trn SW1_3560

Cu hnh Interface trunk cho SW2_3560

31

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

SW2_3560(config)#interface fastEthernet 0/1 SW2_3560(config-if-range)#switchport trunk encapsulation isl SW2_3560(config-if-range)#switchport mode trunk

Hnh 2.2.3-4: Show interfaces trunk trn SW2_3560

Bc 6: thc hin kim tra cu hnh v hot ng ca cc thit b v PC. Bc 7: Xa cu hnh, khi ng li thit b, hon tr li thit b v hon tt bi lab.

32

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Bi 2.3 Cu hnh VTP, Trunks v VLANs trn switch layer 2 v layer 3 2.3.1 S lun l

Hnh 2.3.1-1: Hnh v s lun l

2.3.2

Mc tiu ca bi thc hnh Cu hnh Trunk, VTP s dng 820.1Q v ISL v VLAN cho cc switch theo m hnh lun l

2.3.3

Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn cho cc switch

Cu hnh c bn cho SW1_3560 Switch(config)#hostname SW1_3560 SW1_3560(config)#enable password cisco SW1_3560(config)#no ip domain-lookup SW1_3560(config)#banner motd ^CSwitch 3560_01^C SW1_3560(config)#line console 0 SW1_3560(config-line)# logging synchronous SW1_3560(config-line)# password cisco SW1_3560(config-line)# login SW1_3560(config)#line vty 0 4 SW1_3560(config-line)# password cisco SW1_3560(config-line)# login

33

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Cu hnh c bn cho SW2_3560 Switch(config)#hostname SW2_3560 SW2_3560 (config)#enable password cisco SW2_3560 (config)#no ip domain-lookup SW2_3560 (config)#banner motd ^CSwitch 3560_02^C SW2_3560 (config)#line console 0 SW2_3560 (config-line)# logging synchronous SW2_3560 (config-line)# password cisco SW2_3560 (config-line)# login SW2_3560 (config)#line vty 0 4 SW2_3560 (config-line)# password cisco SW2_3560 (config-line)# login Cu hnh c bn cho SW1_2950 Switch(config)#hostname SW1_2950 SW1_2950 (config)#enable password cisco SW1_2950 (config)#no ip domain-lookup SW1_2950 (config)#banner motd ^CSwitch1_2950_01^C SW1_2950 (config)#line console 0 SW1_2950 (config-line)# logging synchronous SW1_2950 (config-line)# password cisco SW1_2950 (config-line)# login SW1_2950 (config)#line vty 0 4 SW1_2950 (config-line)# password cisco SW1_2950 (config-line)# login Cu hnh c bn cho SW2_2950 Switch(config)#hostname SW2_2950 SW2_2950 (config)#enable password cisco SW2_2950 (config)#no ip domain-lookup SW2_2950 (config)#banner motd ^CSwitch 2950_02^C SW2_2950 (config)#line console 0 SW2_2950 (config-line)# logging synchronous SW2_2950 (config-line)# password cisco SW2_2950 (config-line)# login SW2_2950 (config)#line vty 0 4 SW2_2950 (config-line)# password cisco SW2_2950 (config-line)# login

34

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Bc 2: cu hnh trunk 802.1Q gia cc switch 2950 v gia cc switch 2950 v 3560. Cu hnh Trunk 802.1Q trn SW1_3560 SW1_3560(config)#interface fastEthernet 0/2 SW1_3560(config-if)#switchport trunk encapsulation dot1q SW1_3560(config-if)#switchport mode trunk Cu hnh Trunk 802.1Q trn SW2_3560 SW2_3560(config)#interface gigabitEthernet 0/2 SW2_3560(config-if)#switchport trunk encapsulation dot1q SW2_3560(config-if)#switchport mode trunk Cu hnh Trunk 802.1Q trn SW1_2950 SW1_2950(config)#interface range fastEthernet 0/1 - 2 SW1_2950(config-if-range)#switchport mode trunk Cu hnh Trunk 802.1Q trn SW2_2950 SW2_2950(config)#interface range fastEthernet 0/1 - 2 SW2_2950(config-if-range)#switchport mode trunk Bc 3: Cu hnh trunk ISL gia cc switch 3560 Cu hnh Trunk ISL trn SW1_3560 SW1_3560(config)#interface fastEthernet 0/1 SW1_3560 (config-if-range)#switchport trunk encapsulation isl SW1_3560config-if-range)#switchport mode trunk Cu hnh Trunk ISL trn SW2_3560 SW2_3560(config)#interface fastEthernet 0/1 SW2_3560 (config-if-range)#switchport trunk encapsulation isl SW2_3560 (config-if-range)#switchport mode trunk

Hnh 2.3.3-1: Show interfaces trunk trn SW1_2950

35

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.3.3-2: Show interfaces trunk trn SW2_2950

Hnh 2.3.3-3: Show interfaces trunk trn SW1_3560

Hnh 2.3.3-4: Show interfaces trunk trn SW2_3560

Bc 4: cu hnh cc Switch 3560 l VTP Server, cc switch 2950 l VTP client vi domain tn l Cisco. Cu hnh VTP trn SW1_3560 SW1_3560 (config)#vtp mode server Setting device to VTP SERVER mode SW1_3560 (config)#vtp domain pronet.edu.vn Changing VTP domain name from NULL to pronet.edu.vn SW1_3560 (config)#vtp password cisco Setting device VLAN database password to cisco SW1_3560 (config)#vtp version 2 Cu hnh VTP trn SW2_3560 SW2_3560 (config)#vtp mode server Setting device to VTP SERVER mode SW2_3560 (config)#vtp password cisco Setting device VLAN database password to cisco

36

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Cu hnh VTP trn SW1_2950 SW1_2950 (config)#vtp mode client Setting device to VTP CLIENT mode. SW1_2950 (config)#vtp password cisco Setting device VLAN database password to cisco Cu hnh VTP trn SW2_2950 SW2_2950 (config)#vtp mode client Setting device to VTP CLIENT mode. SW2_2950 (config)#vtp password cisco Setting device VLAN database password to cisco Bc 5: Cu hnh VLAN 10, 20, 30 cho cc switch trn switch VTP server v cu hnh cc port trn switch thuc v VLAN 10, 20 v 30. Cu hnh VLAN trn SW1_3560 SW1_3560 (config)#vlan 10 SW1_3560 (config-vlan)#name VLAN10 SW1_3560 (config-vlan)#exit SW1_3560 (config)#vlan 20 SW1_3560 (config-vlan)#name VLAN20 SW1_3560 (config-vlan)#exit SW1_3560 (config)#vlan 30 SW1_3560 (config-vlan)#name VLAN30 SW1_3560 (config-vlan)#exit

Hnh 2.3.3-5: Show vtp status trn SW1_3560

37

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.3.3-6: Show Vlan trn SW1_3560

Hnh 2.3.3-7: Show vtp status trn SW2_3560

Hnh 2.3.3-8: Show Vlan trn SW2_3560

Cu hnh port switch trn SW1_2950

38

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

SW1_2950(config)#interface fastEthernet 0/18 SW1_2950(config-if)#switchport mode access SW1_2950(config-if)#switchport access vlan 10

Hnh 2.3.3-9: Show vtp status trn SW1_2950

Hnh 2.3.3-10: Show Vlan trn SW1_2950

Cu hnh port switch trn SW2_2950 SW2_2950(config)#interface fastEthernet 0/18 SW2_2950(config-if)#switchport mode access SW2_2950(config-if)#switchport access vlan 10

Hnh 2.3.3-11: Show vtp status trn SW2_2950

39

Gio trnh thc hnh BCMSN

Chng 2 nh ngha VLANs

Hnh 2.3.3-12: Show Vlan trn SW2_2950

Bc 6: t i ch IP cho PC1 v PC2 tng ng l 192.168.1.10/24 v 192.168.1.11/24. Kim tra kt ni gia cc PC khi cm cc PC vo cc VLAN 10, 20 v 30. Bc 7: Dng lnh show cn thit kim tra cu hnh v hot ng ca thit b. Bc 8: Xa cu hnh, khi ng li thit b, hon tr li thit b v hon tt bi lab.

40

You might also like