19 April 2013

Virtual Trunking protocol (VTP)


    เป็น Protocol ที่ช่วยในการบริหารจัดการ(เพิ่ม ลบ แก้ไข) VLAN โดยผ่าน Trunk port โดยเป็นลักษณะ Client-Server

TIP : ควรสร้าง VTP ก่อนการสร้าง VLAN และใน switch จะต้องมีการทำ Trunk port เพราะ vtp advertisement  ที่ส่งผ่าน Trunk port (port ที่ยอมให้ VLAN หลายๆ VLAN ผ่านได้ นอกจาก VLAN 1 หรือ Native VLAN)  ซึ่งจะไม่ได้จัดการ การ Mapping Interface port ใน Switch ว่าอยู่ใน VLAN ใดๆ ทางผู้ติดตั้งระบบจะต้อง Manual Configure เอง โดย VTP จะจัดการเฉพาะ VLAN ให้เท่านั้น

สิ่งที่ต้องรู้


1. VTP Domain คือ ชื่อกลุ่มของ vtp เพราะว่าในการสื้อสารหรือส่ง information กันได้จะต้องมีชื่อ vtp domain ที่ตรงกัน

2. VTP Mode 
2.1 VTP Server คือ เป็นตัวจัดการ VLAN ใน Domain นั้นๆ โดยจะมีกระบวนการ vtp advertisement ไปยัง vtp client ใน Domain เดียวกัน ผ่าน trunk port ซึ่งมี VTP Server มากกว่า 1 ได้.
2.2 VTP Client คือ เป็นตัวรับข้อมูล VLAN จาก VTP Server โดยจะคอยปรับปรุง VLAN ของตนให้เหมือนกันกับ VTP Server เสมอ
2.3 VTP Transparent คือ จะไม่มีการรับข้อมูล VLAN จาก VTP Server ใดๆ โดยผู้ติดตั้งระบบจะสามารถจัดการ VLAN ได้เอง ซึ่ง VTP version 1 จะไม่มีการส่งต่อ vtp advertisement ไปให้ Switch ตัวอื่นๆ ต่อ  แต่ VTP version 2 จะสามารถส่งต่อข้อมูล VLAN ให้ switch ตัวอื่นได้ ซึ่งควร มี Domain เดียวกัน

3. Configuration Revision Number
by Default จะมีค่าเท่ากับ 0 ซึ่งเมื่อใดก็ตามที่มีการแก้ไข VLAN ค่านี้จะเพิ่มขึ้นทีละหนึ่งการแก้ไขนั้นครวบคุมไม่ว่าจะเป็น การเพิ่ม ลบ หรือการเปลี่ยนชื่อ VLAN ก็ตาม ถือว่านับเป็น 1
เมื่อ Switch ได้รับ advertisement มาจาก Switch ตัวอื่นๆ สิ่งแรกที่ทำคือการตรวจสอบค่าของ Confiugration Revision number โดยการเปรียบเทียบว่ามีค่ามากกว่า ค่าของตัวเองหรือเปล่าถ้ามากกว่า
ก็จะทำการ update database VLAN แต่ถ้าน้อยกว่าก็จะทำการ Drop กระบวนการ Update ทิ้ง

4. VTP Password
โดยปกติแล้วในการส่ง vtp advertisement ออกไปจะเป็นลักษณะ Clear text แต่เราสามารถทำการเพิ่มความปลอดภัยได้โดยการตั้งรหัสผ่าน ซึ่งใน Domain หนึ่งๆ จะต้องตั้ง vtp password ใน Switch เป็นตัวเดียวกันทั้งหมด

ลองมาทดสอบ config ง่ายๆ กันดูครับเพื่อความเข้าใจ






โดยสรุปขั้นตอนดังนี้

บน VTP Server (Switch0)
1. กำหนด Trunk port บน Switch 0 (VTP Server)
Switch0#conf t
Switch0(config)#interface range gigabitEthernet 0/1-2
Switch0(config-if)#switchport mode trunk
2. กำหนด VTP configuration
Switch0#vlan database
Switch0(vlan)#vtp server
Switch0(vlan)#vtp domain strumjub.blogspot.com
Switch0(vlan)#vtp password passw0rd
Switch0(vlan)#exit
ตรวจสอบ vtp configuration ค่าต่างๆ ว่าถูกต้องหรือไม่
Switch#sh vtp status
Switch#sh vtp counter
3 สร้าง VLAN on VTP Server
Switch0(config)#vlan 10
Switch0(config-vlan)#name SALE
Switch0(config-vlan)#exit
Switch0(config)#vlan 20
Switch0(config-vlan)#name ENGINEER
Switch0(config-vlan)#exit
บน VTP Client (Switch1,Switch4)
1. กำหนด Trunk port
Switch#conf t
Switch(config)#interface range gigabitEthernet 0/1-2
Switch(config-if)#switchport mode trunk
2. กำหนด VTP configuration
Switch#vlan database
Switch(vlan)#vtp client
Switch(vlan)#vtp domain strumjub.blogspot.com
Switch(vlan)#vtp password passw0rd
Switch(vlan)#exit
3. mapping VLAN กับ access port
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
ตรวจสอบว่ามีการ mapping VLAN กับ Interface ถูกต้อง
Switch#sh vlan br
บน VTP Transparent (Switch3,Switch2)
1. กำหนด Trunk port บน
### Switch3 ###
Switch#conf t
Switch(config)#interface gigabitEthernet 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit

### Switch 2 ###
Switch#conf t
Switch(config)#interface range gigabitEthernet 0/1-2
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
2. Create VLAN on switch 3 and switch2
Switch(config)#vlan 80
Switch(config-vlan)#name server
Switch(config-vlan)#exit
3. mapping VLAN กับ access port
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 80
Switch(config-if)#exit
ตรวจสอบว่ามีการ mapping VLAN กับ Interface ถูกต้อง
Switch#sh vlan br

บน PC ทั้งหมด ให้ทำการกำหนด IP address ดังรูปข้างต้น ซึ่งในการทดสอบให้ทำการ Ping ไปยัง PC เครื่องที่อยู่ใน VLAN เดียวกัน โดยสังเกตว่าจะอยู่ Switch คนละตัวดังภาพด้านล่าง

ทำการ Ping จากเครื่อง PC0 (192.168.80.1) ไปยัง PC1(192.168.80.2) ซึ่งอยู่ใน VLAN 80 (SERVER)

 ทำการ Ping จากเครื่อง PC4 (192.168.20.1) ไปยัง PC5(192.168.20.2) ซึ่งอยู่ใน VLAN 80 (ENGINEER)

ถ้าต้องการศึกษา Configuration โหลดจากที่นี้ได้ครับ
Download File VTP.pkt

ผมใช้ Cisco Packet Tracer v5.3.3


Good luck ..... \m/..

No comments:

Post a Comment