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>enableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface e0/3Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunk*Feb 2 03:02:43.117: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/3, changed state to downSwitch(config-if)#switchpor*Feb 2 03:02:46.121: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/3, changed state to upSwitch(config-if)#switchport trunk native vlan 1Switch(config-if)#spanning-tree portfast trunk%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 CAUTIONSwitch(config-if)#exitSwitch(config)#
Switch(config)#vlan 10Switch(config-vlan)#name StaffSwitch(config-vlan)#exitSwitch(config)#interface e0/1Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunk*Feb 2 03:03:45.621: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to downSwitch(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 upSwitch(config-if)#switchport trunk native vlan 10Switch(config-if)#spanning-tree portfast trunk%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 CAUTIONSwitch(config-if)#exitSwitch(config)#
Switch(config)#vlan 20Switch(config-vlan)#name GuestSwitch(config-vlan)#exitSwitch(config)#interface e0/2Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunk*Feb 2 03:04:44.348: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to downSwitch(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 upSwitch(config-if)#switchport trunk native vlan 20Switch(config-if)#spanning-tree portfast trunk%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 CAUTIONSwitch(config-if)#exitSwitch(config)#
Kiểm tra Native VLAN trên các interface của Cisco Switch.
Switch#show interfaces trunkPort Mode Encapsulation Status Native vlanEt0/0 on 802.1q trunking 1Et0/1 on 802.1q trunking 10Et0/2 on 802.1q trunking 20Et0/3 on 802.1q trunking 1Port Vlans allowed on trunkEt0/0 1-4094Et0/1 1-4094Et0/2 1-4094Et0/3 1-4094Port Vlans allowed and active in management domainEt0/0 1,10,20Et0/1 1,10,20Et0/2 1,10,20Et0/3 1,10,20Port Vlans in spanning tree forwarding state and not prunedEt0/0 1,10,20Et0/1 1,10,20Et0/2 1,10,20Switch#
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.254Checking for duplicate address...PC1 : 172.16.1.1 255.255.255.0 gateway 172.16.1.254Server>
Server> ping 172.16.1.25484 bytes from 172.16.1.254 icmp_seq=1 ttl=255 time=0.246 ms84 bytes from 172.16.1.254 icmp_seq=2 ttl=255 time=0.346 ms84 bytes from 172.16.1.254 icmp_seq=3 ttl=255 time=0.322 ms84 bytes from 172.16.1.254 icmp_seq=4 ttl=255 time=0.305 ms84 bytes from 172.16.1.254 icmp_seq=5 ttl=255 time=0.328 msServer>
- 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.254Checking for duplicate address...PC1 : 172.16.10.1 255.255.255.0 gateway 172.16.10.254PC1>
PC1> ping 172.16.10.25484 bytes from 172.16.10.254 icmp_seq=1 ttl=255 time=0.274 ms84 bytes from 172.16.10.254 icmp_seq=2 ttl=255 time=0.312 ms84 bytes from 172.16.10.254 icmp_seq=3 ttl=255 time=0.352 ms84 bytes from 172.16.10.254 icmp_seq=4 ttl=255 time=0.339 ms84 bytes from 172.16.10.254 icmp_seq=5 ttl=255 time=0.322 msPC1>
- 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.254Checking for duplicate address...PC1 : 172.16.20.1 255.255.255.0 gateway 172.16.20.254PC2>
PC2> ping 172.16.20.25484 bytes from 172.16.20.254 icmp_seq=1 ttl=255 time=0.285 ms84 bytes from 172.16.20.254 icmp_seq=2 ttl=255 time=0.328 ms84 bytes from 172.16.20.254 icmp_seq=3 ttl=255 time=0.362 ms84 bytes from 172.16.20.254 icmp_seq=4 ttl=255 time=0.338 ms84 bytes from 172.16.20.254 icmp_seq=5 ttl=255 time=0.344 msPC2>
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