Professional Documents
Culture Documents
- SW2 :
Switch> enable
Switch# configure terminal
Switch(config)#hostname SW2-VTPClient
SW2-VTPClient(config)#vtp domain TTG
SW2-VTPClient(config)#vtp password 123
SW2-VTPClient(config)#vtp version 2
SW2-VTPClient(config)#vtp mode client
- SW3 :
Switch> enable
Switch# configure terminal
Switch(config)#hostname SW3-VTPClient
SW3-VTPClient(config)#vtp domain TTG
SW3-VTPClient(config)#vtp password 123
SW3-VTPClient(config)#vtp version 2
SW3-VTPClient(config)#vtp mode client
2. Cu hnh Trunking gia cc Switch :
- SW1 :
SW1-VTPServer(config)#interface g1/1
SW1-VTPServer(config-if)#switchport mode trunk
SW1-VTPServer(config-if)#exit
SW1-VTPServer(config)#interface g1/2
SW1-VTPServer(config-if)#switchport mode trunk
SW1-VTPServer(config-if)#exit
128
- SW2 :
SW2-VTPClient(config)#interface g1/1
SW2-VTPClient(config-if)#switchport mode trunk
SW2-VTPClient(config-if)#exit
- SW3 :
SW3-VTPClient(config)#interface g1/2
SW3-VTPClient(config-if)#switchport mode trunk
SW3-VTPClient(config-if)#exit
3. Cc lnh kim tra cu hnh VTP, Trunking :
- SW1-VTPServer #show vtp password
VTP Password: 123
- SW1-VTPServer#show vtp status
VTP Version
:2
Configuration Revision
:0
:7
: Server
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
Mode
Encapsulation Status
Native vlan
129
G1/1
on
802.1q
trunking
G1/2
on
802.1q
trunking
Port
G1/1
1-1005
G1/2
1-1005
Port
G1/1
1,2,3
G1/2
1,2,3
Port
G1/1
1,2,3
G1/2
1,2,3
130
132
VTP,PVST+,PVRST LAB
I. M hnh bi lab :
133
134
:2
Configuration Revision
:0
:5
: Server
: Disabled
VTP V2 Mode
: Disabled
: Disabled
MD5 digest
SW1(config)#vtp version 2
SW1(config)#vtp domain TTG
Changing VTP domain name from NULL to TTG
SW1(config)#vtp password cisco
Setting device VLAN database password to cisco
SW1(config)#vtp mode server
Device mode already VTP SERVER.
- Thng tin VTP trn SW1 sau khi cu hnh
SW1#show vtp status
VTP Version
:2
Configuration Revision
:0
:5
: Server
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
Switch(config)#hostname SW2
SW2(config)#vtp version 2
Setting device to VTP CLIENT mode.
SW2(config)#vtp domain TTG
Changing VTP domain name from NULL to TTG
SW2(config)#vtp password cisco
Setting device VLAN database password to cisco
SW2(config)#vtp mode client
- Kim tra li thng tin VTP trn SW2
SW2#show vtp status
VTP Version
:2
Configuration Revision
:1
:5
: Client
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
SW3(config)#vtp version 2
SW3(config)#vtp domain TTG
Changing VTP domain name from NULL to TTG
SW3(config)#vtp password cisco
Setting device VLAN database password to cisco
SW3(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW3#show vtp status
VTP Version
:2
Configuration Revision
:1
: 250
:5
: Client
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface fa0/22
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport nonegotiate
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface fa0/23
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport nonegotiate
SW1(config-if)#no shutdown
- SW2:
SW2(config)#interface fa0/22
SW2(config-if)# switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#switchport nonegotiate
SW2(config-if)#no shutdown
- SW3:
SW3(config)#interface fa0/23
SW3(config-if)# switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#switchport nonegotiate
SW3(config-if)#no shutdown
139
Mode
Encapsulation Status
Native vlan
Fa0/20
on
802.1q
trunking
Fa0/22
on
802.1q
trunking
Fa0/23
on
802.1q
trunking
Port
Fa0/20
1-4094
Fa0/22
1-4094
Fa0/23
1-4094
Port
Fa0/20
Fa0/22
Fa0/23
Port
Fa0/20
none
Fa0/22
Fa0/23
Router:
Router#config terminal
Enter configuration commands, one per line. End with C
Router(config)#interface fa0/0
Router(config-if)#description Gateway cho VLAN1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
140
Router(config)#interface fa0/0.2
Router(config-subif)#description Gateway cho VLAN2
Router(config-subif)#encapsulation dot1Q 2
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#exit
Router(config)#interface fa0/0.3
Router(config-subif)#description Gateway cho VLAN3
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#exit
Router(config)#interface fa0/0.4
Router(config-subif)#description Gateway cho VLAN4
Router(config-subif)#encapsulation dot1Q 4
Router(config-subif)#ip address 192.168.4.1 255.255.255.0
Router#show ip interface brief
Interface
IP-Address
Protocol
FastEthernet0/0
192.168.1.1
YES
manual up
up
FastEthernet0/0.2
192.168.2.1
YES
manual up
up
FastEthernet0/0.3
192.168.3.1
YES
manual up
up
FastEthernet0/0.4
192.168.4.1
YES
manual up
up
FastEthernet0/1
unassigned
Serial0/1/0
unassigned
Serial0/1/1
unassigned
141
SW1#show vlan
VLAN Name
Status
Ports
default
active
1002 fddi-default
act/unsup
1003 trcrf-default
act/unsup
1004 fddinet-default
act/unsup
1005 trbrf-default
act/unsup
142
SW1#show vlan
VLAN Name
Status
Ports
default
Accounting_Network
active
Engineering_Network
active
Markeeting_Network
active
1002 fddi-default
act/unsup
1003 trcrf-default
act/unsup
1004 fddinet-default
act/unsup
1005 trbrf-default
act/unsup
:2
Configuration Revision
:4
:8
: Server
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
Status
Ports
default
active
Accounting_Network
active
Engineering_Network
active
Markeeting_Network
active
1002 fddi-default
act/unsup
1003 trcrf-default
act/unsup
1004 fddinet-default
act/unsup
1005 trbrf-default
act/unsup
:2
Configuration Revision
:4
:8
: Client
: TTG
: Disabled
144
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
:2
Configuration Revision
:4
:8
: Client
: TTG
: Disabled
VTP V2 Mode
: Enabled
: Disabled
MD5 digest
Status
Ports
default
active
Accounting_Network
active
145
Engineering_Network
active
Markeeting_Network
active
1002 fddi-default
act/unsup
1003 trcrf-default
act/unsup
1004 fddinet-default
act/unsup
1005 trbrf-default
act/unsup
Status
Ports
default
active
Accounting_Network
active
Engineering_Network
active
Fa0/10
4
Markeeting_Network
active
IP-Address
Protocol
Vlan1
192.168.1.11
YES manual
up
up
IP-Address
Protocol
Vlan1
192.168.1.12
YES manual
up
up
147
IP-Address
Protocol
Vlan1
192.168.1.13
YES manual
up
up
148
SW3(config-if)#switchport nonegotiate
SW3(config-if)#no shutdown
- Kim tra SW1 hin ti c phi l rootbridge cha bn lnh show spanning-tree
SW1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee (Giao thc chy mc nh l PVST+)
Root ID Priority 32769
Address
(Roo tBrigdeID)
000a.b8f3.ec40
Cost
19
Port
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Root FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 32770
Address
000a.b8f3.ec40
Cost
19
Port
22 (FastEthernet0/22)
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Root FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0003
Spanning tree enabled protocol ieee
Root ID Priority 32771
Address
000a.b8f3.ec40
Cost
19
Port
22 (FastEthernet0/22)
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Root FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
151
VLAN0004
Spanning tree enabled protocol ieee
Root ID Priority 32772
Address
000a.b8f3.ec40
Cost
19
Port
22 (FastEthernet0/22)
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Root FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
- cu hnh cho SW1 l Root Bridge cho tt c VLAN ta tin hnh thay i Priority ca SW1
thnh gi tr thp hn gi tr mc nh 32768 ca cc switch khc
Ch : Gi tr ca Priority phi l bi s ca 4096
SW1(config)#spanning-tree vlan 1-4 priority 4096
- Kim tra li thng tin STP sau khi i Priority
SW1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address
0018.192e.ddc0
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 4098
Address
0018.192e.ddc0
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0003
Spanning tree enabled protocol ieee
Root ID Priority 4099
153
Address
0018.192e.ddc0
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0004
Spanning tree enabled protocol ieee
Root ID Priority 4100
Address
0018.192e.ddc0
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
154
155
156
- SW1:
SW3(config)#spanning-tree mode rapid-pvst
- Kim tra li cu hnh PVRST+ trn SW1
SW1#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 4097
Address
0018.192e.ddc0
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0002
Spanning tree enabled protocol rstp
Root ID Priority 4098
Address
0018.192e.ddc0
0018.192e.ddc0
157
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0003
Spanning tree enabled protocol rstp
Root ID Priority 24579
Address
000a.b8f3.ee00
Cost
19
Port
23 (FastEthernet0/23)
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Root FWD 19
128.23 P2p
VLAN0004
Spanning tree enabled protocol rstp
Root ID Priority 24580
158
Address
000a.b8f3.ee00
Cost
19
Port
23 (FastEthernet0/23)
0018.192e.ddc0
Prio.Nbr Type
Desg FWD 19
128.20 P2p
Fa0/22
Desg FWD 19
128.22 P2p
Fa0/23
Root FWD 19
128.23 P2p
0018.192e.ddc0
Cost
19
Port
23 (FastEthernet0/23)
000a.b8f3.ee00
Interface
Prio.Nbr Type
Desg FWD 19
128.21 P2p
Fa0/23
Root FWD 19
128.23 P2p
VLAN0002
Spanning tree enabled protocol rstp
Root ID Priority 4098
Address
0018.192e.ddc0
Cost
19
Port
23 (FastEthernet0/23)
000a.b8f3.ee00
Prio.Nbr Type
Desg FWD 19
128.1
P2p
Fa0/21
Desg FWD 19
128.21 P2p
Fa0/23
Root FWD 19
128.23 P2p
VLAN0003
Spanning tree enabled protocol rstp
Root ID Priority 24579
Address
000a.b8f3.ee00
Address
000a.b8f3.ee00
Prio.Nbr Type
Desg FWD 19
128.6
P2p
Fa0/21
Desg FWD 19
128.21 P2p
Fa0/23
Desg FWD 19
128.23 P2p
VLAN0004
Spanning tree enabled protocol rstp
Root ID Priority 24580
Address
000a.b8f3.ee00
000a.b8f3.ee00
Prio.Nbr Type
Desg FWD 19
128.21 P2p
Fa0/23
Desg FWD 19
128.23 P2p
161
nh
nh Tuy
Tuyn S Dng
ng Switch Layer3
I. M hnh bi Lab :
162
165
AccessSW1(config-if-range)#exit
AccessSW1(config)#interface range fa0/15 19
AccessSW1(config-if-range)#switchport access vlan 4
AccessSW1(config-if-range)#exit
AccessSW1(config)#interface range fa0/20 - 24
AccessSW1(config-if-range)#switchport access vlan 5
- AccessSW2:
AccessSW2(config)#interface range fa0/5 - 9
AccessSW2(config-if-range)#switchport access vlan 2
AccessSW2(config-if-range)#exit
AccessSW2(config)#interface range fa0/10 - 14
AccessSW2(config-if-range)#switchport access vlan 3
AccessSW2(config-if-range)#exit
AccessSW2(config)#interface range fa0/15 19
AccessSW2(config-if-range)#switchport access vlan 4
AccessSW2(config-if-range)#exit
AccessSW2(config)#interface range fa0/20 - 24
AccessSW2(config-if-range)#switchport access vlan 5
6. m bo Layer3 Switch l RootBrdge trong STP:
Layer3SW(config)#spanning-tree vlan 1-5 root primary
7. S dng cc Layer3 Switch nh tuyn gia cc VLAN:
nh tuyn gia cc VLAN trn switch Layer3 ta s t a ch cho cc interface VLAN
2,3,4,5 v dng cc interface ny lm gateway cho cc PC bn di (cc interface VLAN gi
l SVI: Switch Virtual Interface)
-Bt tnh nng nh tuyn
Layer3SW(config)#ip routing
-t a ch Ip cho cc interface VLAN theo lp mng tng ng phn trn, c th nh sau:
Layer3SW(config)#interface vlan 2
166
: 192.168.2.10
: 192.168.2.1
PCVLAN3 :
Ip Address
: 192.168.3.10
: 192.168.3.1
PCVLAN4 :
Ip Address
: 192.168.4.10
Gateway
: 192.168.4.1
PCVLAN5 :
Ip Address
: 192.168.5.10
: 192.168.5.1
- Sau t cc PC s dng lnh Ping kim tra qu trnh nh tuyn thnh cng hay khng, kt
qu cc PC phi Ping c ln nhau
8.nh tuyn gia Layer3 Switch v Router:
- Layer3SW:
Layer3SW(config)#interface fa0/5
Layer3SW(config-if)#no switchport
Layer3SW(config-if)#ip address 192.168.6.1 255.255.255.0
Layer3SW(config-if)#no shutdown
Layer3SW(config-if)#exit
- Cu hnh giao thc nh tuyn RIPv2
Layer3SW(config)#router rip
Layer3SW(config-router)#version 2
Layer3SW(config-router)#network 192.168.2.0
Layer3SW(config-router)#network 192.168.3.0
Layer3SW(config-router)#network 192.168.4.0
Layer3SW(config-router)#network 192.168.5.0
Layer3SW(config-router)#network 192.168.6.0
- Router DNG :
Router(config)#hostname DNG
DNG(config)#interface fa0/0
DNG(config-if)#ip address 192.168.6.2 255.255.255.0
DNG(config-if)#no shutdown
DNG(config-if)#exit
168
DNG(config)#router rip
DNG(config-router)#version 2
DNG(config-router)#network 192.168.6.0
- Kim tra bng nh tuyn ca Router v Layer3Switch s dng lnh show ip route
169