1:Eth-Trunk链路聚合技术简述
在组网中经常会遇到以上的问题,这时就可以采用链路聚合技术,Eth-trunk可以把多个独立的物理接口绑定在一起,作为一个大带宽的逻辑接口使用。其具有以下几个优势。
1)增加设备之间的互联带宽
2)提高设备之间的可靠性
3)对流量负载均衡,提高链路利用率
2:Eth-Trunk链路聚合模式
1)手工模式
以此图为例,在部分老旧设备中无法使用LACP模式,需要人员进行手工调配。在手工模式中,三条活动链路都参与数据转发并分担流量,当一条链路故障时,在剩余的两条活动链路分担流量。配置步骤可以分为:创建eth-trunk、选择链路聚合模式为manual load-balance、在eth-trunk中加入成员接口。
2)LACP模式
LACP模式也称为M:N模式,M条活动链路,N条备份链路,当活动链路出现故障时,备份链路才进行转发。其工作原理可以主要分为:确定主动端、确定活动链路、LACP抢占(默认不开启抢占功能)。
(1)确定LACP主动端
通过比较两端交换机的系统优先级来确定LACP主动端,系统优先级数值越小越优先,默认值是32768,如果系统优先级相同,则比较两端设备的MAC地址,越小越优先。
(2)确定LACP活动链路
活动链路的选择都以主动端为主,通过系统优先级选举出LACP主动端后,以主动端的接口优先级来选择活动接口,接口优先级数值越小越优先,默认值是32768,如果主动端设备的接口优先级相同,则根据接口号的大小来选举活动端口,(接口号越小越优先)。
(3)开启LACP抢占
[SW1]int Eth-Trunk 1 //进入链路聚合组1
[SW1-Eth-Trunk1]lacp preempt enable //开启抢占
[SW1-Eth-Trunk1]lacp preempt delay 10 //配置抢占延迟时间为10秒
3:Eth-Trunk链路聚合技术实验(环境模拟:ENSP)
实验需求:
1)PC1和PC3属于vlan 10、PC2和PC4属于vlan 20
1)设备之间配置lacp模式的链路聚合,并确保同vlan之间的主机可以互通
具体配置步骤如下:
1)PC配置IP地址
2)所有交换机创建vlan10 和vlan20
3)交换机和PC互联的接口设置为access ,并加入指定的vlan
4)配置SW1和SW2的系统优先级
5)配置Eth-Trunk,创建eth-trunk组、定义链路聚合的工作模式为lacp、在链路聚合添加成员接口、设置trunk模式,允许vlan 10 20 通过。
详细配置命令如下:
SW1配置:
[SW1]vlan batch 10 20
[SW1]lacp priority 100
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk1]quit
[SW1]int eth-trunk 2
[SW1-Eth-Trunk2]mode lacp-static
[SW1-Eth-Trunk2]trunkport g 0/0/3 to 0/0/4
[SW1-Eth-Trunk2]port link-type trunk
[SW1-Eth-Trunk2]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk2]quit
[SW1]int eth-trunk 3
[SW1-Eth-Trunk3]mode lacp-static
[SW1-Eth-Trunk3]trunkport g 0/0/5 to 0/0/6
[SW1-Eth-Trunk3]port link-type trunk
[SW1-Eth-Trunk3]port trunk allow-pass vlan 10 20
SW2配置:
[SW2]vlan batch 10 20
[SW2]lacp priority 500
[SW2]int eth-trunk 1
[SW2-Eth-Trunk1]mode lacp-static
[SW2-Eth-Trunk1]trunkport g 0/0/3 to 0/0/4
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW2-Eth-Trunk1]quit
[SW2]int eth-trunk 2
[SW2-Eth-Trunk2]mode lacp-static
[SW2-Eth-Trunk2]trunkport g 0/0/5 to 0/0/6
[SW2-Eth-Trunk2]port link-type trunk
[SW2-Eth-Trunk2]port trunk allow-pass vlan 10 20
[SW2-Eth-Trunk2]quit
[SW2]int eth-trunk 3
[SW2-Eth-Trunk3]mode lacp-static
[SW2-Eth-Trunk3]trunkport g 0/0/1 to 0/0/2
[SW2-Eth-Trunk3]port link-type trunk
[SW2-Eth-Trunk3]port trunk allow-pass vlan 10 20
SW3配置:
[SW3]vlan batch 10 20
[SW3]int g0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 10
[SW3-Ethernet0/0/1]quit
[SW3]int eth-trunk 1
[SW3-Eth-Trunk1]mode lacp-static
[SW3-Eth-Trunk1]trunkport g 0/0/2 to 0/0/3
[SW3-Eth-Trunk1]port link-type trunk
[SW3-Eth-Trunk1]port trunk allow-pass vlan 10 20
SW4配置:
[SW4]vlan batch 10 20
[SW4]int g0/0/1
[SW4-Ethernet0/0/1]port link-type access
[SW4-Ethernet0/0/1]port default vlan 20
[SW4-Ethernet0/0/1]quit
[SW4]int eth-trunk 2
[SW4-Eth-Trunk2]mode lacp-static
[SW4-Eth-Trunk2]trunkport g 0/0/2 to 0/0/3
[SW4-Eth-Trunk2]port link-type trunk
[SW4-Eth-Trunk2]port trunk allow-pass vlan 10 20
SW5配置:
[SW5]vlan batch 10 20
[SW5]int g0/0/1
[SW5-Ethernet0/0/1]port link-type access
[SW5-Ethernet0/0/1]port default vlan 10
[SW5-Ethernet0/0/1]quit
[SW5]int eth-trunk 1
[SW5-Eth-Trunk1]mode lacp-static
[SW5-Eth-Trunk1]trunkport g 0/0/2 to 0/0/3
[SW5-Eth-Trunk1]port link-type trunk
[SW5-Eth-Trunk1]port trunk allow-pass vlan 10 20
SW6配置:
[SW6]vlan batch 10 20
[SW6]int g0/0/1
[SW6-Ethernet0/0/1]port link-type access
[SW6-Ethernet0/0/1]port default vlan 20
[SW6-Ethernet0/0/1]quit
[SW6]int eth-trunk 2
[SW6-Eth-Trunk2]mode lacp-static
[SW6-Eth-Trunk2]trunkport g 0/0/2 to 0/0/3
[SW6-Eth-Trunk2]port link-type trunk
[SW6-Eth-Trunk2]port trunk allow-pass vlan 10 20
验证与测试:
pc1: ping 192.168.10.2 通
pc2:ping 192.168.20.2 通
搭建完成的拓扑文件:
ETH-TRUNK实验拓扑 提取码:9b7j