Lab 4.2: (3) Thiết lập VLAN trên Interface thông qua Native VLAN

By , 0 View

Mục tiêu thực hành:
- Cấu hình VLAN trên các interface của Cisco Switch thông qua kiến trúc Native VLAN.
- Kiểm tra Native VLAN trên các interface của Cisco Switch.
- Kiểm tra kết nối tới Gateway tại các node mạng tương ứng với mỗi Subnet.

Truy cập vào "Lab 4-2 - Thiet lap VLAN tren Interface cua Cisco Switch thong qua Native VLAN v1" tại Public Unetlab Server 24/7 để thực hành.

Cấu hình VLAN trên các interface của Cisco Switch thông qua kiến trúc Native VLAN.
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface e0/3
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
*Feb  2 03:02:43.117: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/3, changed state to down
Switch(config-if)#switchpor
*Feb  2 03:02:46.121: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/3, changed state to up
Switch(config-if)#switchport trunk native vlan 1
Switch(config-if)#spanning-tree portfast trunk
%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

Switch(config-if)#exit
Switch(config)#

Switch(config)#vlan 10
Switch(config-vlan)#name Staff
Switch(config-vlan)#exit
Switch(config)#interface e0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
*Feb  2 03:03:45.621: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to down
Switch(config-if)#switchport trunk native vlan 10
*Feb  2 03:03:48.623: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to up
Switch(config-if)#switchport trunk native vlan 10
Switch(config-if)#spanning-tree portfast trunk
%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

Switch(config-if)#exit
Switch(config)#

Switch(config)#vlan 20
Switch(config-vlan)#name Guest
Switch(config-vlan)#exit
Switch(config)#interface e0/2
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
*Feb  2 03:04:44.348: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to down
Switch(config-if)#switchport trunk native vlan 20
*Feb  2 03:04:47.356: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to up
Switch(config-if)#switchport trunk native vlan 20
Switch(config-if)#spanning-tree portfast trunk
%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

Switch(config-if)#exit
Switch(config)#

Kiểm tra Native VLAN trên các interface của Cisco Switch.
Switch#show interfaces trunk 

Port        Mode             Encapsulation  Status        Native vlan
Et0/0       on               802.1q         trunking      1
Et0/1       on               802.1q         trunking      10
Et0/2       on               802.1q         trunking      20
Et0/3       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Et0/0       1-4094
Et0/1       1-4094
Et0/2       1-4094
Et0/3       1-4094

Port        Vlans allowed and active in management domain
Et0/0       1,10,20
Et0/1       1,10,20
Et0/2       1,10,20
Et0/3       1,10,20

Port        Vlans in spanning tree forwarding state and not pruned
Et0/0       1,10,20
Et0/1       1,10,20
Et0/2       1,10,20
          
Switch#

Kiểm tra kết nối tới Gateway tại các node mạng tương ứng với mỗi Subnet.
- Kiểm tra kết nối từ Server thuộc VLAN 1 tới Gateway 172.16.1.254.
Server> ip 172.16.1.1/24 172.16.1.254
Checking for duplicate address...
PC1 : 172.16.1.1 255.255.255.0 gateway 172.16.1.254

Server> 

Server> ping 172.16.1.254

84 bytes from 172.16.1.254 icmp_seq=1 ttl=255 time=0.246 ms
84 bytes from 172.16.1.254 icmp_seq=2 ttl=255 time=0.346 ms
84 bytes from 172.16.1.254 icmp_seq=3 ttl=255 time=0.322 ms
84 bytes from 172.16.1.254 icmp_seq=4 ttl=255 time=0.305 ms
84 bytes from 172.16.1.254 icmp_seq=5 ttl=255 time=0.328 ms

Server> 

- Kiểm tra kết nối từ PC1 thuộc VLAN 10 tới Gateway 172.16.10.254.
PC1> ip 172.16.10.1/24 172.16.10.254
Checking for duplicate address...
PC1 : 172.16.10.1 255.255.255.0 gateway 172.16.10.254

PC1>

PC1> ping 172.16.10.254

84 bytes from 172.16.10.254 icmp_seq=1 ttl=255 time=0.274 ms
84 bytes from 172.16.10.254 icmp_seq=2 ttl=255 time=0.312 ms
84 bytes from 172.16.10.254 icmp_seq=3 ttl=255 time=0.352 ms
84 bytes from 172.16.10.254 icmp_seq=4 ttl=255 time=0.339 ms
84 bytes from 172.16.10.254 icmp_seq=5 ttl=255 time=0.322 ms

PC1> 

- Kiểm tra kết nối từ PC2 thuộc VLAN 20 tới Gateway 172.16.20.254.
PC2> ip 172.16.20.1/24 172.16.20.254
Checking for duplicate address...
PC1 : 172.16.20.1 255.255.255.0 gateway 172.16.20.254

PC2> 

PC2> ping 172.16.20.254

84 bytes from 172.16.20.254 icmp_seq=1 ttl=255 time=0.285 ms
84 bytes from 172.16.20.254 icmp_seq=2 ttl=255 time=0.328 ms
84 bytes from 172.16.20.254 icmp_seq=3 ttl=255 time=0.362 ms
84 bytes from 172.16.20.254 icmp_seq=4 ttl=255 time=0.338 ms
84 bytes from 172.16.20.254 icmp_seq=5 ttl=255 time=0.344 ms

PC2> 

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