当前位置:文档之家› 交换机汇聚配置

交换机汇聚配置

(1)交换机的基本配置(2)在交换机上创建聚合接口(3)在交换机上配置聚合端口(4)端口聚合增加交换机之间的传输带宽,验证当一条链路断开时仍能互相通信。

第一步:交换机A的基本配置。

SwitchA(config)#vlan 10SwitchA(config-vlan)#name salesSwitchA(config-vlan)#exitSwitchA(config)#interface fastEthernet0/5SwitchA(config-if)#switchport access vlan 10验证测试:验证已创建了VLAN 10,并将0/5端口已划分到VLAN 10中。

SwitchA#show vlan id 10VLAN Name Status Ports--------------------------------------------------------------------------------------------------------10 sales active Fa0/5第二步:在交换机SwitchA上配置聚合端口。

SwitchA(config)#interface aggregateport 1 !创建聚合接口AG1 SwitchA(config-if)#switchport mode trunk !配置AG模式为trunk SwitchA(config-if)#exitSwitchA(config)#interface range fastEthernet 0/1-2 !进入接口0/1和0/2SwitchA(config-if-range)#port-group 1 !配置接口0/1和0/2属于AG1验证测试:验证接口fastEthernet0/1和0/2属于AG1。

SwitchA#show aggregatePort 1 summary !查看端口聚合组1的信息AggregatePort MaxPorts SwitchPort Mode Ports--------------------------------------------------------------------------------------------------Ag1 8 Enabled Trunk Fa0/1, Fa0/2注:AG1,最大支持端口数为8个,当前VLAN模式为Trunk,组成员有F0/1、F0/2。

第三步:交换机B的基本配置。

(具体步骤与SwitchA类似)第四步:在交换机SwitchB上配置聚合端口。

(具体步骤与SwitchA类似)第五步:验证当交换机直接的一条链路断开时,PC1与PC2仍能互相通信。

注意事项:(1)只有同类型端口才能聚合为一个AG端口。

(2)所有物理端口必须属于同一个VLAN。

(3)在锐捷交换机上最多支持8个物理端口聚合为一个AG。

(4)在锐捷交换机上最多支持6组聚合端口。

参考配置:SwitchA#show running-config !显示交换机SwitchA的全部配置Bui lding configuration…Current configuration : 497 bytesversion 1.0!Vlan 10name sales!hostname SwitchAinterface AggregatePort 1 !聚合端口1的VLAN模式为Trunk switchport mode trunk!interface FastEthernet 0/1port-group 1 !将F0/1加入聚合组1interface FastEthernet 0/2port-group 2 !将F0/2加入聚合组1!interface FastEthernet 0/5switchport access vlan 10!endSwitchB#show running-config !显示交换机SwitchB的全部配置Building configuration…Current configuration : 497 bytesversion 1.0!Vlan 10name sales!hostname SwitchBinterface AggregatePort 1 !聚合端口1的VLAN模式为Trunk switchport mode trunk!interface FastEthernet 0/1port-group 1 !将F0/1加入聚合组1interface FastEthernet 0/2port-group 2 !将F0/2加入聚合组1!interface FastEthernet 0/5switchport access vlan 10!end链路聚合有成端口聚合,断口捆绑,英文名port trunking.功能是将交换机的多个低带宽端口捆绑成一条高带宽链路,可以实现链路负载平衡。

避免链路出现拥塞现象。

通过配置,可通过两个三个或是四个端口进行捆绑,分别负责特定端口的数据转发,防止单条链路转发速率过低而出现丢包的现象。

Trunking的优点:价格便宜,性能接近千兆以太网;不需要重新布线,也无需考虑千兆网传输距离极限问题;trunking可以捆绑任何相关的端口,也可以随时取消设置,这样提供了很高的灵活性还可以提供负载均衡能力以及系统容错。

命令:port-group <port-group-number> mode {active|passive|on}no port-group <port-group-number>功能:将物理端口加入Port Channel,该命令的no 操作为将端口从Port Channel 中去除参数:<port-group-number> 为Port Channel 的组号,范围为1~16;active(0)启动端口的LACP 协议,并设置为Active 模式;passive(1)启动端口的LACP 协议,并且设置为Passive 模式;on(2)强制端口加入Port Channel,不启动LACP 协议。

举例:在Ethernet0/0/1 端口模式下,将本端口以active 模式加入port-groupSwitch(Config-Ethernet0/0/1)#port-group 1 mode active命令:interface port-channel <port-channel-number>功能:进入汇聚接口配置模式命令模式:全局配置模式举例:进入port-channel1 配置模式Switch(Config)#interface port-channel 1Switch(Config-If-Port-Channel1)#举例1:如果交换机Switch1 上的1,2,3 端口都是access 口,并且都属于vlan 1,将这三个端口以active 方式加入group 1,Switch2 上6,8,9 端口为trunk 口,并且是allow all,将这三个端口以passive 方式加入group 2,将以上对应端口分别用网线相连。

方法1配置步骤如下:Switch1#configSwitch1 (Config)#interface eth 0/0/1-3Switch1 (Config-Port-Range)#port-group 1 mode activeSwitch1 (Config-Port-Range)#exitSwitch1 (Config)#interface port-channel 1Switch1 (Config-If-Port-Channel1)#Switch2#configSwitch2 (Config)#port-group 2Switch2 (Config)#interface eth 0/0/6Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passiveSwitch2 (Config-Ethernet0/0/6)#exitSwitch2 (Config)# interface eth 0/0/8-9Switch2 (Config-Port-Range)#port-group 2 mode passiveSwitch2 (Config-Port-Range)#exitSwitch2 (Config)#interface port-channel 2Switch2 (Config-If-Port-Channel2)#配置结果:过一段时间后,shell 提示端口汇聚成功,此时Switch1 的端口1,2,3 汇聚成一个汇聚端口,汇聚端口名为Port-Channel1,Switch2 的端口6,8,9 汇聚成一个汇聚端口,汇聚端口名为Port-Channel2,并且都可以进入汇聚接口配置模式进行配置。

方法2:以ON 方式配置Port Channel.配置步骤如下:Switch1#configSwitch1 (Config)#interface eth 0/0/1Switch1 (Config-Ethernet0/0/1)# port-group 1 mode onSwitch1 (Config-Ethernet0/0/1)#exitSwitch1 (Config)#interface eth 0/0/2Switch1 (Config-Ethernet0/0/2)# port-group 1 mode onSwitch1 (Config-Ethernet0/0/2)#exitSwitch1 (Config)#interface eth 0/0/3Switch1 (Config-Ethernet0/0/3)# port-group 1 mode onSwitch1 (Config-Ethernet0/0/3)#exitSwitch2#configSwitch2 (Config)#port-group 2Switch2 (Config)#interface eth 0/0/6Switch2 (Config-Ethernet0/0/6)#port-group 2 mode onSwitch2 (Config-Ethernet0/0/6)#exitSwitch2 (Config)# interface eth 0/0/8-9Switch2 (Config-Port-Range)#port-group 2 mode onSwitch2 (Config-Port-Range)#exit配置结果:将交换机Switch1 上的1,2,3 三个端口依次加入port-group1 后我们可以看到,以on 方式加入一个组完全是强制性的,两端的交换机并不会通过交换LACP PDU 来完成汇聚,汇聚也是触发式的,当敲入将2 号端口加入port-group1 的命令时,1 和2 马上汇聚在一起形成port-channel1,当将3 号端口加入port-group1 时,1 和2 汇聚成的port-channel1 被拆散,马上1,2,3 三个端口又重新汇聚成port-channel1(需要说明的是,当有一个新的端口要加入已经汇聚成功的组时,必须先拆散原先的组,然后再能汇聚成一个新的组)。

相关主题