Trunk

概述

虚拟局域网中继(协议)干道。

交换网络中的链路类型
接入链路、中继链路。
VLAN跨交换机通信过程
使用一条链路,使用标识来区分不同VLAN的数据,交换机给每个去往其他交换机的数据帧打上VLAN标识。
在以太网上实现中继,有两种封装类型ISL(Cisco私有标准)、802.1q为公共标准。
Trunk的模式
接入(Access) 
干道(Trunk)
动态企望(Dynamic desirable)
动态自动(Dynamic auto)  
非协商(Nonegotiate)

Trunk的配置
配置步骤与命令
进入接口配置模式
Switch(config)#interface interface-id
选择封装类型
Switch(config-if)#switchport trunk encapsulation { isl | dot1q | negotiate }
将接口配置为Trunk
Switch(config-if)#switchport mode {dynamic {desirable | auto} | trunk | access}
指定Native VLAN(可选)
Switch(config-if)#switchport trunk native vlan vlan-id
禁止Trunk传送某个VLAN的数据,删除这个VLAN:
Switch(config-if)#switchport trunk allowed vlan remove vlan-id
允许Trunk传送某个VLAN的数据,添加这个VLAN:
Switch(config-if)#switchport trunk allowed vlan add vlan-id    
默认允许全部VLAN的数据通过
查看接口模式、状态 :
Switch#show interface interface-id switchport