EthernetChannel——以太网通道
功能:多条链路负载均衡、提高带宽、容错。
以太网通道捆绑规则:
1) 参与捆绑的端口必须属于同一个VLAN
2) 如果端口配置的是中继模式,那么应该在链路两端将通道中的所有端口配置成相同的中继模式
3) 所有参与捆绑的端口的物理参数设置必须相同
以太网通道捆的分装类型:
1) PAgP(端口聚合协议)-------- Cisco私有以太网通道协议
PAgP模式
开启(On)
关闭(Off)
自动(Auto)
企望(Desirable )
2) LACP(链路聚合控制协议)------IEEE 802.3ad标准协议
LACP模式
开启(On)
关闭(Off)
被动(Passive)
主动(Active)

以太网通道的配置:
1)配置PAgP协议以太网通道:
Switch(config-if)#interface internet-id  //进入接口
Switch(config-if)#channel-protocol pagp  //使用pagp协议封装
Switch(config-if)#channel-group number mode { on | auto | desirable }  //配置以太网通道的模式
2)配置LACP以太网通道:
Switch(config-if)#interface internet-id
Switch(config-if)#channel-protocol lacp 
Switch(config-if)#channel-group number mode { on | passive | active }
注:每个端口必须使用同样的协议
查看以太网通道状态:
Switch#show etherchannel summary 
Flags:  D - down(端口没有连接或关闭状态)        P - bundled in port-channel(表示协商成功,以太网通道成功建立)
        I - stand-alone(表示没有协商成功) s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port
Number of channel-groups in use: 1
Number of aggregators:           1
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------
1      Po1(SU)         PAgP      Fa0/1(P)    Fa0/2(P)  //查看是否正常
 
VTP(VLAN Trunking Protocol)虚拟局域网中继协议****************
功能:从一个控制点,维护整个企业网上VLAN的添加、删除和重命名工作
VTP域的组成
具有相同域名,通过Trunk相连的一组交换机
VTP的运行模式:
1.服务器模式(Server)
可以创建、删除和修改VLAN
学习、转发相同域名的VTP通告
2.客户机模式(Client)
学习、转发相同域名的VTP通告
不可以创建、删除和修改VLAN
3.透明模式(Transparent)
可以创建、删除和修改VLAN,但只在本地有效
转发但不学习VTP通告
VTP修剪:
减少中继链路上不必要的广播流量

VTP的配置步骤:
创建VTP域
Switch(config)# vtp domain domain_name
配置交换机的VTP模式
Switch(config)# vtp mode {server | client | transparent}
配置VTP口令
Switch(config)# vtp password password
配置VTP修剪
Switch(config)# vtp pruning
配置VTP版本
Switch(config)# vtp version 2
查看VTP配置信息
Switch# show vtp status
 
应用实例:
 
配置方法:
1.配置以太网通道
sw1(config)#interface range f0/1 - 2
sw1(config-if-range)#switchport mo trunk
sw1(config-if)#channel-protocol lacp  //指定封装协议
sw1(config-if-range)#channel-group 1 mode on //定义以太网所属的组和模式
sw1(config-if-range)#no shutdown
sw2(config)#interface range f0/1 - 2
sw2(config-if-range)#switchport mo trunk
aw2(config-if)#channel-protocol lacp
sw2(config-if-range)#channel-group 1 mode on
sw2(config-if-range)#no shutdown
注:封装协议和所属组必须相同,才能构成正确的以太网通道
2.查看以太网通道的状态:
Router#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1     Po1(SU)     Fa0/1(P)   Fa0/2(P)
3.配置vtp并创建vlan
sw1(vlan)#vtp domain goutao  //配置vtp域名
sw1(vlan)#vtp server   //配置vtp模式
sw1(vlan)#vtp password 123 //配置vtp密码
sw1(vlan)#vlan 2
VLAN 2 added:
    Name: VLAN0002
sw1(vlan)#vlan 3
VLAN 3 added:
    Name: VLAN0003
sw1(vlan)#exit
4.查看vlan配置:
sw1#show vlan brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
2    VLAN0002                         active
3    VLAN0003                         active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

sw2(vlan)#vtp client
sw2(vlan)#vtp domain goutao
sw2(vlan)#vtp password 123
5.查看vtp及vlan信息(查看sw2上是否学习到了vlan信息)
sw2#show vtp status
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 256
Number of existing VLANs        : 7
VTP Operating Mode              : client
VTP Domain Name                 : goutao
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x8D 0x37 0xC4 0x71 0x6B 0x5E 0x6F 0xAD
Configuration last modified by 0.0.0.0 at 3-1-02 00:14:01
Local updater ID is 0.0.0.0 (no valid interface found)
 
sw2#show vlan-switch br
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/
                                                Fa0/10, Fa0/11, Fa0/12, F
                                                Fa0/14, Fa0/15
2    VLAN0002                         active
3    VLAN0003                         active            //确认sw2已经学习到了vlan信息
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active
注:vtp的域名,密码必须相同才能学习到vlan信息
6.将端口按照拓扑结构划入不同的vlan
sw1(config)#interface f0/3
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 2
sw1(config-if)#no shutdown
sw1(config-if)#exi
sw1(config)#interface f0/4
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 3
sw1(config-if)#no shutdown
sw1(config-if)#exit

sw2(config)#interface f0/3
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 2
sw2(config-if)#no shutdown
sw2(config-if)#exit
这样我们的配置就完成了,可以连接pc机进行测试了!