โจทย์ : จาก Network Diagram ทำการตั้งค่าบน Switch ตามหัวข้อดังต่อไปนี้
![](https://static.wixstatic.com/media/aa9017_6d8075d13a484829898834b9a0a4b15e~mv2.png/v1/fill/w_725,h_275,al_c,q_85,enc_avif,quality_auto/aa9017_6d8075d13a484829898834b9a0a4b15e~mv2.png)
1. 1. ให้สร้าง Vlan ที่ Switch ทุกตัวดังนี้
VLAN10 name User, VLAN20 name Sale, VLAN30 name Engineer
2. สร้าง Trunk Port และ Access Port ในแต่ละ Switch
ดู Video :
Download ไฟล์ LAB คลิกด้านล่างนี้ :
Network Diagram :
![](https://static.wixstatic.com/media/aa9017_2a9e0a8e2d6e490c8e3688a60200d01d~mv2.png/v1/fill/w_725,h_275,al_c,q_85,enc_avif,quality_auto/aa9017_2a9e0a8e2d6e490c8e3688a60200d01d~mv2.png)
Task and Configuration
1. ให้สร้าง Vlan ที่ Switch ทุกตัว
SWX (SW1,SW2 และ SW3)
สร้าง Vlan 10
SWX(config)#Vlan 10
ตั้งชื่อ Vlan
SWX(config-vlan)#name User
สร้าง Vlan 20
SWX(config-vlan)#name Sale
สร้าง Vlan 30
SWX(config-vlan)#name Engineer
ที่ SW1, SW2 และ SW3 ทำการตรวจสอบ Vlan ที่ได้สร้างขึ้น โดยจะต้องแสดง Vlan 10, 20 และ 30 ตามที่แสดง
SWX#show vlan brief
VLAN Name Status Ports
---- -------------------
10 User active
20 Sale active
30 Engineer active
2. สร้าง Trunk Port และ Access Port ในแต่ละ Switch
2.1 Access Port
Access Port ที่ SW3
เข้าสู้โหมด Interface
SW3(config)#interface FastEthernet0/1
กำหนดให้ Interface เป็นสมาชิกของ Vlan 30
SW3(config-if)#switchport access vlan 30
กำหนดให้ Interface เป็น Mode Access
SW3(config-if)#switchport mode access
เข้าสู้โหมด Interface
SW3(config)#interface FastEthernet0/2
กำหนดให้ Interface เป็นสมาชิกของ Vlan 20
SW3(config-if)#switchport access vlan 20
กำหนดให้ Interface เป็น Mode Access
SW3(config-if)#switchport mode access
เข้าสู้โหมด Interface
SW3(config)#interface FastEthernet0/3
กำหนดให้ Interface เป็นสมาชิกของ Vlan 10
SW3(config-if)#switchport access vlan 10
กำหนดให้ Interface เป็น Mode Access
SW3(config-if)#switchport mode access
ตรวจสอบการสร้าง Vlan ที่ Switch, Access Port และการนำ Port เข้าไปเป็นสมาชิกของแต่ละ Vlan
SW3#show vlan brief
VLAN Name Status Ports
---- -------------------
10 User active Fa0/3
20 Sale active Fa0/2
30 Engineer active Fa0/1
Access Port ที่ SW2
เข้าสู้โหมด Interface
SW2(config)#interface FastEthernet0/1
กำหนดให้ Interface เป็นสมาชิกของ Vlan 20
SW2(config-if)#switchport access vlan 20
กำหนดให้ Interface เป็น Mode Access
SW2(config-if)#switchport mode access
เข้าสู้โหมด Interface
SW2(config)#interface FastEthernet0/2
กำหนดให้ Interface เป็นสมาชิกของ Vlan 20
SW2(config-if)#switchport access vlan 20
กำหนดให้ Interface เป็น Mode Access
SW2(config-if)#switchport mode access
ตรวจสอบการสร้าง Vlan ที่ Switch, Access Port และการนำ Port เข้าไปเป็นสมาชิกของแต่ละ Vlan
SW2#show vlan brief
VLAN Name Status Ports
---- ------------------------
10 User active
20 Engineer active Fa0/1
30 Sale active Fa0/2
Access Port ที่ SW1
เข้าสู้โหมด Interface
SW1(config)#interface FastEthernet0/1
กำหนดให้ Interface เป็นสมาชิกของ Vlan 10
SW1(config-if)#switchport access vlan 10
กำหนดให้ Interface เป็น Mode Access
SW1(config-if)#switchport mode access
เข้าสู้โหมด Interface
SW1(config)#interface FastEthernet0/2
กำหนดให้ Interface เป็นสมาชิกของ Vlan 20
SW1(config-if)#switchport access vlan 20
กำหนดให้ Interface เป็น Mode Access
SW1(config-if)#switchport mode access
เข้าสู้โหมด Interface
SW1(config)#interface FastEthernet0/24
กำหนดให้ Interface เป็นสมาชิกของ Vlan 1 (Deafult จะเป็น Vlan 1 อยู่แล้ว)
SW1(config-if)#switchport access vlan 1
กำหนดให้ Interface เป็น Mode Access
SW1(config-if)#switchport mode access
ตรวจสอบการสร้าง Vlan ที่ Switch, Access Port และการนำ Port เข้าไปเป็นสมาชิกของแต่ละ Vlan
SW1#show vlan brief
VLAN Name Status Ports
---- -------------------------
10 User active Fa0/1
20 Sale active Fa0/2
30 Engineer active
2.2 TRUNK Port
TRUNK Port ที่ SW3
เข้าสู้โหมด Interface
SW3(config)#interface GigabitEthernet0/1
กำหนดให้ Interface เป็น mode Trunk
SW3(config-if)#switchport mode trunk
ตรวจสอบการสร้าง Trunk Port
SW3#show interface Trunk
Port Mode Encapsulation Status Native vlan
Gig0/2 auto n-802.1q trunking 1
Port Vlans allowed on trunk
Gig0/2 1-1005
Port Vlans allowed and active in management domain
Gig0/2 1,10,20,30
Port Vlans in spanning tree forwarding state and not pruned
Gig0/2 1,10,20,30
TRUNK Port ที่ SW2
เข้าสู้โหมด Interface Range
SW2(config)#interface range GigabitEthernet0/1-2
กำหนดให้ Interface เป็น mode Trunk
SW2(config-if)#switchport mode trunk
ตรวจสอบการสร้าง Trunk Port
SW2#show interface Trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Gig0/2 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 1-1005
Gig0/2 1-1005
Port Vlans allowed and active in management domain
Gig0/1 1,10,20,30
Gig0/2 1,10,20,30
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 1,10,20,30
Gig0/2 1,10,20,30
TRUNK Port ที่ SW1
เข้าสู้โหมด Interface Range
SW1(config)#interface range GigabitEthernet0/1-2
กำหนดให้ Interface เป็น mode Trunk
SW1(config-if)#switchport mode trunk
ตรวจสอบการสร้าง Trunk Port
SW1#show interface Trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Gig0/2 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 1-1005
Gig0/2 1-1005
Port Vlans allowed and active in management domain
Gig0/1 1,10,20,30
Gig0/2 1,10,20,30
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 1,10,20,30
Gig0/2 1,10,20,30
ใช้ command cli ดู vlan trunk ไม่ได้ครับ show interface brief ผมใช้ packet tracert V. 8.2.1.0118 ครับ ต้องแก้ใขอย่างไรครับ, ขอบคุณครับ