Lab 4.1: (1) Cấu hình VLAN trên Cisco Switch

By , 0 View

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>enable
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name LAN1
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name LAN2
Switch(config-vlan)#end 
Switch#

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 terminal
Switch(config)#interface range e0/0 - 1  
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast will be configured in 2 interfaces due to the range command 
 but will only have effect when the interfaces are in a non-trunking mode.
Switch(config-if-range)#exit
 
Switch(config)#interface range e0/2 - 3
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast will be configured in 2 interfaces due to the range command 
 but will only have effect when the interfaces are in a non-trunking mode.
Switch(config-if-range)#end
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.
Switch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    
10   LAN1                             active    Et0/0, Et0/1
20   LAN2                             active    Et0/2, Et0/3
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0   
10   enet  100010     1500  -      -      -        -    -        0      0   
20   enet  100020     1500  -      -      -        -    -        0      0   
1002 fddi  101002     1500  -      -      -        -    -        0      0   
1003 tr    101003     1500  -      -      -        -    -        0      0   
1004 fdnet 101004     1500  -      -      -        ieee -        0      0   
1005 trnet 101005     1500  -      -      -        ibm  -        0      0   

Remote 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/0
Building configuration...

Current configuration : 109 bytes
!
interface Ethernet0/0
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast edge
end

Switch#
 
Switch#show running-config interface e0/2
Building configuration...

Current configuration : 109 bytes
!
interface Ethernet0/2
 switchport access vlan 20
 switchport mode access
 spanning-tree portfast edge
end

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.
- 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 terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface e0/1
Switch(config-if)#switchport mode access   
Switch(config-if)#switchport access vlan 20
Switch(config-if)#end
Switch#


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. 

You Might Also Like

0 comments