Mục tiêu thực hành:
- Khởi tạo Vlan10 & Vlan20 và đặt tên cho các Vlan này trên Cisco Switch.
- Gán các interface vào Vlan tương ứng theo sơ đồ mạng trên Cisco Switch.
- Kiểm tra các Vlan hiện có và danh sách các interface tương ứng với Vlan10 và Vlan20.
- Kiểm tra cấu hình Vlan trong file cấu hình running-config trên Cisco Switch.
- Khảo sát tình huống các thiết bị thuộc cùng Vlan thì mới giao tiếp được với nhau.
Truy cập vào "Lab 4-1 - Cau hinh VLAN tren Cisco Switch v1" tại Public Unetlab Server 24/7 để thực hành.
Khởi tạo Vlan10 & Vlan20 và đặt tên cho các Vlan này trên Cisco Switch.
Switch>enableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#name LAN1Switch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#name LAN2Switch(config-vlan)#endSwitch#
Gán các interface vào Vlan tương ứng theo sơ đồ mạng trên Cisco Switch.
- Các interface kết nối tới PC hoặc Router nên cấu hình tính năng spanning-tree portfast để các thiết bị có thể truyền dữ liệu ngay lập tức mà không cần phải đợi 30s để chạy thuật toán chống loop STP.
Switch#configure terminalSwitch(config)#interface range e0/0 - 1Switch(config-if-range)#switchport mode accessSwitch(config-if-range)#switchport access vlan 10Switch(config-if-range)#spanning-tree portfast%Warning: portfast should only be enabled on ports connected to a singlehost. Connecting hubs, concentrators, switches, bridges, etc... to thisinterface when portfast is enabled, can cause temporary bridging loops.Use with CAUTION%Portfast will be configured in 2 interfaces due to the range commandbut will only have effect when the interfaces are in a non-trunking mode.Switch(config-if-range)#exit
Switch(config)#interface range e0/2 - 3Switch(config-if-range)#switchport mode accessSwitch(config-if-range)#switchport access vlan 20Switch(config-if-range)#spanning-tree portfast%Warning: portfast should only be enabled on ports connected to a singlehost. Connecting hubs, concentrators, switches, bridges, etc... to thisinterface when portfast is enabled, can cause temporary bridging loops.Use with CAUTION%Portfast will be configured in 2 interfaces due to the range commandbut will only have effect when the interfaces are in a non-trunking mode.Switch(config-if-range)#endSwitch#
Kiểm tra các Vlan hiện có và danh sách các interface tương ứng với Vlan10 và Vlan20.
Switch#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active10 LAN1 active Et0/0, Et0/120 LAN2 active Et0/2, Et0/31002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 010 enet 100010 1500 - - - - - 0 020 enet 100020 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 01003 tr 101003 1500 - - - - - 0 01004 fdnet 101004 1500 - - - ieee - 0 01005 trnet 101005 1500 - - - ibm - 0 0Remote SPAN VLANs------------------------------------------------------------------------------Primary Secondary Type Ports------- --------- ----------------- ------------------------------------------Switch#
Kiểm tra cấu hình Vlan trong file cấu hình running-config trên Cisco Switch.
Switch#show running-config interface e0/0Building configuration...Current configuration : 109 bytes!interface Ethernet0/0switchport access vlan 10switchport mode accessspanning-tree portfast edgeendSwitch#
Switch#show running-config interface e0/2Building configuration...Current configuration : 109 bytes!interface Ethernet0/2switchport access vlan 20switchport mode accessspanning-tree portfast edgeendSwitch#
Khảo sát tình huống các thiết bị thuộc cùng Vlan thì mới giao tiếp được với nhau.
- VPC1 có thể ping được tới 172.16.10.254 là vì VPC1 và R1's e0/1 cùng thuộc Vlan10, nếu gán Switch's e0/1 thuộc Vlan20 thì VPC1 sẽ không còn ping được 172.16.10.254 được nữa.
Switch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface e0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20Switch(config-if)#endSwitch#
Tham khảo các videos lý thuyết Hướng dẫn thực hành CCNA R&S để biết thêm thông tin chi tiết.
0 comments