当访问端口接受到一个帧时,交换机根据VLAN的端口配置为这个帧内部分配一个VLAN标签,一旦参考网桥做出了帧转发的策略,该帧便被转发到合适的输出端口,这时帧的内部VLAN标签被去掉,还原为原始帧,然后从输出端口发送出去
中继封装:
Cisco ISL 26字节头部*包含10比特vlan-id和4字节尾部对原始帧的循环冗余检验和
IEEE802.1Q 头部位于帧内部,2字节的802.1Q标签,16比特Tag Protocol Identifier (0x8100),3比特Priority(802.1p),1比特Canonical Format Indicator,12比特vlan-id
配置VTP服务器
VLAN配置模式 Switch(vlan)# vtp { domain domain-name | password password | pruning*禁用 | v2-mode | { server | client | transparent } }
v2-mode *启动VTP版本2 要用exit保存配置
验证配置 Switch# show vtp status
每次修改VTP域名,其数据库配置修订号会复位至零
全局配置模式 Switch(config)# vtp version 2
启动VTP版本2不同,其他相同
配置VTP客户机 与配置VTP服务器相同
VTP的建议
优点:中央化配置和管理,减少开销;确保交换机VLAN数据库相同;VTP修剪允许VLAN进行动态清楚,提高网络效率
缺点:服务器错误将对整个网络产生影响;修订号高的客户机,会重写服务器的VTP配置;没有配置VTP密码,容易受DoS攻击;不允许VTP对中继手动修剪,而这是有益的
VLAN1协议: VTP*VLAN中继协议; CDP*Cisco发现协议;
PagP*端口汇聚协议; DTP*动态中继协议
对ISL中继,DTP消息总是在VLAN1上传送;对802.1Q中继,DTP消息总是在native VLAN上传送。当VLAN1被清楚,除四种协议外其余被阻塞
native VLAN:属于native VLAN的所有流量在被中继传送时不需要802.1Q标签,为了与非802.1Q端口进行相互操作,因为在native VLAN中流量没有被标记,所以如果一个被配置成802.1Q中继的端口接收到未标记的流量,交换机就会假定流量属于native VLAN并转发
配置端口DTP模式 Switch(config-if)# switchport mode { access | dot1q-tunnel | dynamic { auto | desirable} | trunk* }
*若设置trunk必须 Switch(config-if)# switchport nonegotiate
配置中继参数 Switch(config-if)# switchport trunk { allowed vlan vlan-list } | { encapsulation*中继封装 { dot1q | isl | negotiate*协商封装 } } | { native*只用在802.1Q,定义中继的native VLAN vlan vlan-id } | { pruning*VTP剪裁 vlan vlan-list}
启用VTP修剪 Switch(config)# vtp pruning
配置prune eligible表 Switch(config)# interface interface-id
Switch(config)# switchport trunk pruning vlan vlan-list*允许清除list
验证配置 Switch# show interface interface-id switchport
Switch# show interface trunk
配置EtherChannel
EtherChannel:Cisco的私有带宽汇聚协议,所有交换机都支持,通过使用PagP*端口汇聚协议 形成束,束中每个端口运行在一个特定的PagP模式下
PagP协商:只有两端模式组合为desirable和desirable、desirable和auto、on和on才成功形成通道;推荐使用desirable和desirable,确保不会产生ErrDisable状态,还确保场景所描述的链路故障不会影响生成树拓扑
配置物理端口参数:端口速度/双工设置;VLAN配置;中继配置;生成树配置;SPAN目的端口;安全端口;动态VLAN端口;协议过滤;服务质量(QoS)配置;超长帧(Jumbo frame)
例子 Switch(config)# interface range FastEthernet0/1-2
Switch(config-if-range)# speed 100
Switch(config-if-range)# dulex full
Switch(config-if-range)# switchport trunk encapsulation dot1q
Switch(config-if-range)# switchport mode dynamic desirable
Switch(config-if-range)# switchport trunk native vlan 10
Switch(config-if-range)# switchport trunk allowed vlan 2-5
Switch(config-if-range)# switchport trunk pruning vlan 2-4
配置EtherChannel束 Switch(config)# port-channel load-balance { src-mac | dst-mac | src-dst-mac | src-ip | dst-ip | src-dst-ip | src-port | dst-port | src-dst-port }
l 29/35系列只支持基于第二层MAC地址的负载分配方法
l 带PFC1的60/65系列支持基于第二层MAC地址和第三层IP地址的负载分配方法
l 40的Supervisor3/4和带PFC2的60/65系列支持第二层MAC地址、第三层IP地址和第四层TCP/UDP端口的负载分配方法
验证EtherChannel Switch# show etherchannel { summary*束 | port*端口 }
验证负载分担和冗余 Switch# show interfaces counters