VLAN

 
本文最后更新于

Cisco交换机端口转发vlan标签的规则

Access port

剥离pvid转发

Trunk port

  • pvid 与 native vlan 相同,则剥离标签(untaged)转发
  • pvid 与 native vlan 不相同,则带原标签转发
  • 无 pvid ,则打上 native vlan 的tag转发。

推荐阅读:TRUNK中的native vlan-新浪博客cisco native vlan和huawei的pvid 区别Native VLAN 配置讲解

配置举例

Switch(config)#interface g0/1
Switch(config-if)#switchport trunk encapsulation <dot1q | isl>
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 1-100
Switch(config-if)#switchport trunk native vlan 999
# 调整 native vlan 是为了不让数据以untaged的方式转发
Switch(config)#interface fe0/2
Switch(config-if)#switchport access vlan 10
Switch(config-if)#switchport mode access

生成树协议STP&RSTP&MSTP

(略)