一、VLAN
作用:交换机可以隔离冲突域,但不能隔离广播域。VLAN可以划分
二、Trunk
当一个VLAN跨过不同交换机时,连接在不同交换机端口的同一VLAN就可以通过trunk实现通信
两种常见的Trunk帧标记技术:ISL和IEEE802.1Q
negotiate可以强制把接口设置为trunk模式,不主动发送协商包
三、EtherChannel(以太通道)
作用:增加带宽,负载均衡
目前有2个协商协议:端口聚合协议PAGP(思科私有)和链路聚合控制协议LACP
四、VTP
目的:为了管理vlan
一台交换机只能属于一个VTP域,不同域的交换机不能共享VLAN信息。链路自动协商Trunk时,交换机的VTP域名要一样。
根据交换机在VTP域中的作用不同,可分为3种工作模式:
(1)服务器(server)模式
每一个VTP域至少有一个服务器
(2)客户机(client模式)
(3)透明模式
五、配置命令
1.VLAN配置命令
(1)配置vlan名字
S1(config-vlan)#name v2
(2)配置交换机端口为(access)模式
S1(config-if)#switchport mode access
(3)将端口划分到指定VLAN
S1(config-if)#switchport access vlan 2
(4)查看VLAN信息
1)查看vlan信息
S1#show vlan
2)查看vlan信息摘要
S1#show vlan brief
3)查看vlan汇总信息
S1#show vlan summary
4)查看接口作为交换端口的有关信息
S1#show interfaces interfaces swichport
2.Trunk配置命令
1)配置trunk链路的封装类型
S1(config-if-range)#swichport trunk encapsulation { negotiate | dot1q | isl }
2)关闭trunk自动协商
S1(config-if-range)#switchport nonegotiate
3)配置可以通过的vlan流量
S2(config-if)#switchport trunk allowed vlan 2,3,45
4)查看trunk链路上的本征VLAN(通常是不存在的VLAN)
S2(config-if)#switchport trunk native vlan 99
5)查看trunk信息
S2#show int trunk
3.EtherChannel配置命令
(1)创建以太通道
S1(config)#interface port-channel 1
(2)配置EtherChannel的负载均衡方式
S1(config)#port-channel load-balance src-ip
负载均衡方式有6种:dst-ip,dst-mac,src-dst-ip,src-dst-mac,src-ip,src-mac
(3)配置协商EtherChannel的协议类型
S1(config-if-range)#channel-protocol { lacp | pagp }
(4)把接口加入到以太网通道中,并指明以太通道模式
S1(config-if-range)#channel-group 1 mode { active | auto | passive }
(5)查看EtherChannel信息
1)查看EtherChannel简要信息
S1#show etherchannel summary
2)查看指定的EtherChannel包含的接口
S1#show etherchannel port-channel
3)查看协商EtherChannel的协议
S1#show etherchannel portocol
4)查看EtherChannel的负载平衡方式
S1#show etherchannel load-balance
4.VTP配置命令
(1)配置VTP域名
S1(config-if-range)#vtp domain 1
(2)配置交换机为VTP模式
S1(config-if-range)#vtp mode { server | client | transparent }
(3)配置VTP密码
S1(config-if-range)#vtp password cisco123
(4)查看VTP运行情况
1)查看VTP密码
S1#show vtp password
2)查看VTP状态
S1#show vtp status
3)查看VLAN信息同步情况
S1#show vlan brief