cisco 2960交换机可以在trunk上封装dot1q嘛?命令是什么?

kuaidi.ping-jia.net  作者:佚名   更新日期:2024-06-27
为什么在配置思科单臂路由,交换机进入端口后可以配置trunk,但是不能封装dot1q

dot1q需要在三层交换机或路由器上封装,这是个三层的功能,二层可以被动的连接。

不同厂商的交换机,封装用dot1q协议,同为思科的,用isl

对于同时支持dot1q和isl的交换机,要先设置封装,再改mode,否则报错:
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.
对于只支持dot1q的交换机,顺序无所谓。
所以好习惯是先设置封装,不会出错。
进入接口后:
S4(config-if)#switchport trun encapsulation dot1q
S4(config-if)#switchport mode trunk
两条命令即可,默认就是允许所有vlan,switchport trunk allowed vlan all敲上也不会显示。

2960默认封装就是dot1q,不再支持cisco的私有封装ISL,因此2960系列交换机在配置trunk的时候不需要指定封装。

2960默认封装就是dot1q,不再支持cisco的私有封装ISL,因此2960系列交换机在配置trunk的时候不需要指定封装。



当然可以,因为dot1q是行业标准。

Switch0(config)#interface f0/24
Switch0(config-if)#switchport mode trunk
Switch0(config-if)#switchport trunk encapsulation dot1q // 使用dot1q封装

Switch0(config-if)#switchport trunk allowed all
Switch0(config-if)#exit

(config-if)#switchport trunk encapsulation dot1q 定义此接口的协议封装方式为dot1q
(config-if)#switchport mode trunk 定义此接口模式为trunk口