Lab 4.2: (2) Hiệu chỉnh Native VLAN trên đường Trunk

By , 0 View


interface e0/0
  switchport trunk encapsulation dot1q
  switchport mode trunk
  spanning-tree portfast trunk
  exit

interface e0/0
  no shutdown
  exit
interface e0/0.1
  encapsulation dot1q 1 native
  ip address 172.16.1.254 255.255.255.0
  ip nat inside
  no shutdown
  exit
interface e0/0.10
  encapsulation dot1q 10
  ip address 172.16.10.254 255.255.255.0
  ip nat inside
  no shutdown
  exit
interface e0/0.20
  encapsulation dot1q 20
  ip address 172.16.20.254 255.255.255.0
  ip nat inside
  no shutdown
  exit

Hiệu chỉnh Native VLAN trên Cisco Switch.
- Native VLAN mặc định là VLAN 1.

Sw1#show interfaces trunk 

Port        Mode             Encapsulation  Status        Native vlan
Et0/0       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Et0/0       1-4094

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

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

- Hiệu chỉnh Native VLAN trên cổng Trunk của Switch.

Sw1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Sw1(config)#interface e0/0
Sw1(config-if)#switchport trunk native vlan 10
Sw1(config-if)#end
Sw1#

- Kiểm tra Native VLAN sau khi hiệu chỉnh.
Sw1#show interface trunk

Port        Mode             Encapsulation  Status        Native vlan
Et0/0       on               802.1q         trunking      10

Port        Vlans allowed on trunk
Et0/0       1-4094

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

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

- PC1 không thể ping được tới Gateway 172.16.10.254 vì Native VLAN không đồng nhất giữa Switch với Router.
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

host (172.16.10.254) not reachable

PC1> 

Hiệu chỉnh Native VLAN trên Cisco Router.
- Hiệu chỉnh VLAN 10 là Native VLAN trên R1.
R1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface e0/0.10
R1(config-subif)#encapsulation dot1q 10 native
R1(config-subif)#end
R1#

R1#show vlans

Virtual LAN ID:  1 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.1

   Protocols Configured:   Address:              Received:        Transmitted:

Ethernet0/0.1 (1)
           IP              172.16.1.254                 0                   0
        Other                                           0                  22

   538 packets, 36552 bytes input
   22 packets, 7884 bytes output

Virtual LAN ID:  10 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.10

 This is configured as native Vlan for the following interface(s) :
Ethernet0/0

   Protocols Configured:   Address:              Received:        Transmitted:

Ethernet0/0.10 (10)
           IP              172.16.10.254                0                   0
        Other                                           0                   2

   1084 packets, 69312 bytes input
   2 packets, 92 bytes output

Virtual LAN ID:  20 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.20

   Protocols Configured:   Address:              Received:        Transmitted:

Ethernet0/0.20 (20)
           IP              172.16.20.254                0                   0
        Other                                           0                   2

   534 packets, 36312 bytes input
   2 packets, 92 bytes output

R1#

- Sau khi hiệu chỉnh Native VLAN đồng nhất giữa Router và Switch thì PC1 đã có thể ping được 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.238 ms
84 bytes from 172.16.10.254 icmp_seq=2 ttl=255 time=0.322 ms
84 bytes from 172.16.10.254 icmp_seq=3 ttl=255 time=0.311 ms
84 bytes from 172.16.10.254 icmp_seq=4 ttl=255 time=0.333 ms
84 bytes from 172.16.10.254 icmp_seq=5 ttl=255 time=0.314 ms

PC1>

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