配置trunk 端口
1、进入全局模式
 switch#configure terminal
2、指定欲设置的trunk的端口。(交换机的级联端口)
  switch(config)#interface interface-id
3、将交换机配置为第二层trunk。只有接口是第二层访问接口,或着指定trunk模式时,才需要使用该命令。dynamic auto,如果相邻接口被配置为trunk或desirable模式,将该接口置为trunk连接。dynamic desirable,如果相邻接口设置为trunk,desirable或auto模式,将该接口志为trunk连接。trunk,将接口设置为永久的trunk模式,协商将连接转换为trunk连接,即使相邻接口不是trunk接口。
    switch(config-if)#switchport 膜的{dynamic{auto|desirable|trunk}}
4、指定默认vlan,即当trunk失效后,允许哪一个vlan使用trunk链路继续通信,即可指定某一个vlan,也可以指定一个vlan范围。访问vlan不能作为本地vlan使用。
  switch(config-if)#switchport access vlan vlan-id
5、为802.1Qtrunk指定本地vlan,不指定默认是vlan1
  switch(config-if)#switchport trunk native vlan  vlan-id
6、配置trunk 上允许的vlan列表,默认状态下,trunk端口允许所有vlan是发送和接收传输。当然,根据需要,也可以将拒接某些vlan通过trunk传输,从而将vlan限制与其他交换机的通信,或者拒绝某些land多敏感数据的访问。需要注意的是,不能从trunk中移除默认的trunk1。使用add、all、except、和remove关键字,可以定义允许在trunk上传输的vlan。vlan列表即可以是一个vlan,也可以是一个vlan组。当同时制定若干vlan时,不要 在“,”者“-”间使用空格。
   switch(config-if)#switchport trunk allowed vlan {add|all|except|remove} vlan-list
7、还回特权模式
  switch(config-if)# end
8、查看校验配置模式
  switch#show interface interface-id switchport
  switch#show interface interface-id trunk
9、保存配置
 switch#copy running-config startup-config
 
 
配置本地vlan的非标签传输
1、进入全局模式
  switch#configure terminal
2、制定欲配置的端口
  switch(config)# interface interface-id
3、在trunk端口上,配置制定的vlan接收和发送非标签传输
  switch(config-if)#switchport trunknative vlan vlan-id
4、还回特权模式
  switch(config-if)# end
5、查看校验配置模式
  switch#show interface interface-id switchport
6、保存配置
 switch#copy running-config startup-config