Objective
วันนี้เราจะมาลอง Set up VTP domain สร้าง VLANs และ Inter-Switch Link (ISL) กับ 802.1Q trunking บน Cisco Catalyst 2960 และ 3560 โดย command-line
By GNS3 V0.6 on IOS: c3640-jk9s-mz.123-14.T7
!!! ซึ่งเราทั้งหมดต้องมาทำความเข้ากันก่อนเล็กน้อย เพราะเราไม่ไ้ด้ใช้ Hardware จริง ๆ ในการทำ Lab ดังนั้น command บางตัวจะไม่ตรงกับความเป็นจริง เพราะผมใช้ IOS ของ Router ในการทำครับ
เริ่มกันเลยครับ
Step 1
จากรูปด้านบนนะครับเราก็มาวาดใน GNS3 ของเราได้แบบนี้ครับ
ในที่นี้เราใช้ IOS เวอร์ชัน c3640-jk9s-mz.123-14.T7 ดังนั้นจึงเป็น Router 3600 มาจำลองเป็น switch โดยเราใส่การ์ด NM-16ESW ให้มันครับ แล้วก็ Strat เลยครับ ก็รอจนทุกตัว boot ขึ้นครบแล้ว จริง ๆ ในขั้นตอนต่อไปถ้าเป็นอุกรณ์จริง เราต้องทำการ Clearing a Switch ก่อน แต่เราไม่ต้องทำ
Step 2
ใส่ชื่อให้แต่ละ Switch ของเราเริ่มจาก DLS1 ก่อน แล้วก็ใส่ IP ให้ Vlan 1 เพื่อเราเอาไว้เป็นmanagement VLAN ครับ ทำตามนี้ครับ
Router>
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname DLS1
DLS1(config)#interface vlan 1
DLS1(config-if)#ip address 10.1.1.101 255.255.255.0
DLS1(config-if)#no shutdown
DLS1(config-if)#end
DLS1#
ส่วน switch อันอื่น ๆ ก็ทำตามแบบเดียวกันครับ
DLS2
Router>
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname DLS2
DLS2(config)#interface vlan 1
DLS2(config-if)#ip address 10.1.1.102 255.255.255.0
DLS2(config-if)#no shutdown
DLS2(config-if)#end
DLS2#
ALS1
Router>
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname ALS1
ALS1(config)#interface vlan 1
ALS1(config-if)#ip address 10.1.1.103 255.255.255.0
ALS1(config-if)#no shutdown
ALS1(config-if)#end
ALS1#
ASL2
Router>
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname ALS2
ALS2(config)#interface vlan 1
ALS2(config-if)#ip address 10.1.1.104 255.255.255.0
ALS2(config-if)#no shutdown
ALS2(config-if)#end
ALS2#
Step 3
เรามาดู Vlan ใช้ command show vlan-switch ใน privileged mode ครับ
**อย่างที่ผมบอกตอนแรกว่า command บางตัวจะไม่ตรงกับความเป็นจริง ถ้าใช้ switch จริง ๆ จะใช้ command show vlan ครับ
DLS1#sh vlan-switch
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/0, Fa0/1, Fa0/2, Fa0/3
Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
DLS1#
Step 4
ดูสถานะของ VTP โดยใช้ command "show vtp status" เพื่อดูค่าต่างๆของ vtp ของ switch เช่นที่ DLS1 ก็ได้ดังนนี้ครับ
DLS1#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xBF 0x86 0x94 0x45 0xFC 0xDF 0xB5 0x70
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 10.1.1.101 on interface Vl1 (lowest numbered VLAN interface found)
DLS1#
Step 5
เปลี่ยน VTP domain name บน DLS1 เป็น GNS3 โดยคำสัง "vtp domain" โดยทำตามตัวอย่างนี้ครับ
DLS1#vlan database
DLS1(vlan)#vtp ?
client Set the device to client mode.
domain Set the name of the VTP administrative domain.
password Set the password for the VTP administrative domain.
pruning Set the administrative domain to permit pruning.
server Set the device to server mode.
transparent Set the device to transparent mode.
v2-mode Set the administrative domain to V2 mode.
DLS1(vlan)#vtp domain ?
WORD The ascii name for the VTP administrative domain.
DLS1(vlan)#vtp domain GNS3
Changing VTP domain name from NULL to GNS3
DLS1(vlan)#
**อย่างที่ผมบอกตอนแรกว่า command บางตัวจะไม่ตรงกับความเป็นจริง ถ้าใช้ switch จริง ๆ จะสามารถ เปลี่ยน VTP domain name
DLS1(config)#vtp domain GNS3
Changing VTP domain name from NULL to GNS3
DLS1(config)#
ต่อมาเราก็เซ็ต switches DLS เป็น VTP server mode และ switches ALS เป็น VTP client mode ตามตัวอย่างนี้ครับ
DLS1#vlan database
DLS1(vlan)#vtp server
Device mode already VTP SERVER.
DLS1(vlan)#
ALS1#vlan database
ALS1(vlan)#vtp client
Setting device to VTP CLIENT mode.
ALS1(vlan)#
ลองใช้คำสัง show vtp status ที่ DLS กับ ALS เพื่อดูว่าสถานะ VTP ของเราเป็นยังไงบ้างครับ ทำตามนี้ครับ
DLS1#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name : GNS3
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xD9 0xA8 0xBC 0x32 0xB2 0xDC 0x84 0x7A
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 10.1.1.101 on interface Vl1 (lowest numbered VLAN interface found)
DLS1#
ALS1#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Client
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xBF 0x86 0x94 0x45 0xFC 0xDF 0xB5 0x70
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
ถ้าได้ตามนี้ก็แสดงว่าถูกต้องแล้วครับ
Step 6
Config port บน sw DLS1 and ALS1 โดยใช้คำสัง switchport mode trunk
DLS1
DLS1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)#interface range fastEthernet 0/7 - 10
DLS1(config-if-range)#switchport trunk encapsulation dot1q
DLS1(config-if-range)#switchport mode trunk
DLS1(config-if-range)#end
DLS1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)#interface range fastEthernet 0/11 - 12
DLS1(config-if-range)#switchport trunk encapsulation isl
DLS1(config-if-range)#switchport mode trunk
DLS1(config-if-range)#end
ALS1.
ALS1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
ALS1(config)#interface range FastEthernet 0/11 - 12
ALS1(config)#interface range FastEthernet 0/11 - 12
ALS1(config-if)#switchport mode trunk
ALS1(config-if)#end
เดียวผมมาเขียนต่อนะครับ เหนื่อยๆ กับการทำงาน
ไม่มีความเห็น