CCNP實戰之802.1Q及VLAN的實現(續)

接上回ide

實驗二:  理解trunk接口對數據幀收發處理過程的處理測試

業務規劃以下:ui

image

(注:爲保證明驗效果,請暫時關閉兩臺交換機的CDP和STP)  spa

SW2(config)#no cdp run  blog

SW2(config)#no spanning-tree vlan 1-4094  接口


在SW1上建立 vlan 10,並將e0/0接口劃分入 vlan 10  ip

SW1(config)#vlan 10
SW1(config-vlan)#interface e0/0
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
get


在SW2上建立 vlan 20,並將e0/0接口劃分入 vlan 20  it

SW2(config)#vlan 20
SW2(config-vlan)#interface e0/0
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 20
io


將SW1的e1/0接口配置爲turnk並修改PVID爲 10  

SW1(config)#interface e1/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk native vlan 10


將SW2的e1/0接口配置爲turnk並修改PVID爲 20  

SW2(config)#interface e1/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#switchport trunk native vlan 20


在R1和R2上配置IP地址,並作連通性測試:  

R1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms


經過在SW1和SW2之間的接口上抓取報文觀察,報文確實沒有攜帶802.1Q標記

image


實驗三: 瞭解全局配置模式下的命令 vlan dot1q tag native  的做用

在上述實驗環境中的兩臺交換機上配置這條命令

SW1(config)# vlan dot1q tag native 


再次作連通性測試:

R1#ping 12.1.1.2        
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
 

 

如下展現思科對這條命令的解釋  

Usage Guidelines

Typically, you configure 802.1Q trunks with a native VLAN ID, which strips tagging from all packets on that VLAN.

To maintain the tagging on the native VLAN and drop untagged traffic, use the vlan dot1q tag native command. The switch will tag the traffic received on the native VLAN and admit only 802.1Q-tagged frames, dropping any untagged traffic, including untagged traffic in the native VLAN.

Control traffic continues to be accepted as untagged on the native VLAN on a trunked port, even when the vlan dot1q tag native command is enabled.  

注意我標註的句子,這意味着一旦使用了這條命令,將會影響交換機trunk接口對數據幀的處理規則。  

稍微解釋一下就是:  

發送數據幀的時候交換機將會爲來自全部native VLAN的數據幀打上標記;  

僅僅接收攜帶802.1Q標記的數據幀,丟棄全部不攜帶標記的數據幀,即便該數據幀是來自native VLAN的;  


謝謝你們!我是達叔。

相關文章
相關標籤/搜索