在两个VLAN外找一个端口设置为trunk模式
例如:
24口交换机
1---10端口vlan10192.168.1.0/24
11--20端口vlan20192.168.2.0/24
将21--24端口任意一个端口设置为trunk模式就可以了
trunk链路不属于任何一个VLAN.因为trunk既然要承载
多个vlan的流量.trunk链路在交换机和路由器之间起着VLAN管道的作用.
要传输多个vlan的通信,需要用专门的协议为VLAN数据封装或者加上标记,以便接收设备能区分数据帧所属的vlan.以太网有两种,一种是
cisco专用的ISL协议,支持在cisco的设备之间传送多个vlan流量.
还有一种是IEEE802.1Q的工业标准协议,支持在不同厂商设备的
trunk链路上传送多个vlan流量.
首先建立vlan10和20
Switch(config)#intrangef0/1-10进入端口1—10
Switch(config-if)#switchportmodeaccess
Switch(config-if)#switchportaccessvlan10将端口1-10加入vlan10
Switch(config)#intrangef0/11-20进入端口11—20
Switch(config-if)#switchportmodeaccess
Switch(config-if)#switchportaccessvlan20将端口11-20加入vlan20
Switch(config)#intf0/21进入端口21
Switch(config-if)#switchportmodetrunk设置端口21为trunk模式
阅读全文
收起全文