2. 配置VLANTrunks
配置VLANTrunks的步骤如下。

举例如下:
Switch#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z。
Switch(config)#interfacefastetheme2/4
Switch(config-if)#switchportmodetrunk
Switch(config-if)#switchporttrunkencapsulationdotlq
Switch(config-if)#end
(1)定义trunk允许的VLAN.缺省情况下trunk允许所有的VLAN通过。可以使用switchporttrunkallowedvlanremovevlan-list来去掉某一VLAN。

回到允许所有VLAN通过时,可用noswitchporttrunkallowedvlan端口配罝命令。
举例如下:
Switch(config)#interfacefastethemet2/l
Switch(config-if)#switchporttrunkallowedvlanremove2
Switch(config-if)#end
(2)配置NativeVLAN(IEEE802.1q)封装IEEE802.1q的trunk端口可以接受带有标签和不带标签的数据流,交换机向nativevlan传送不带标签的数据流,缺省情况下nativeVLAN是1。

使用noswitchporttrunknativevlan端口配置命令回到缺省的状态。
返回目录:通信工程师考试培训互联网交换技术
编辑相关推荐:
你适合考什么证书?扫码一查便知

热门:中级通信传输与接入有线7天题库会员 | 中级通信动力与环境7天题库会员
推荐:2027年通信工程师考试时间 | 2026年通信工程师真题及答案解析
备考:通信历年真题在线自测 | 通信备考资料免费下载 | 通信课程免费试听