侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

双IE大神带你全面理解Eth-Trunk的知识体系(可跟做)

2023-03-19 星期日 / 0 评论 / 0 点赞 / 76 阅读 / 17446 字

1、Eth-Trunk背景随着网络中部署的业务量不断增长,对于全双工点对点链路,单条物理链路的带宽已不能满足正常的业务流量需求。如果将当前接口板替换为具备更高带宽的接口板,则会浪费现有的设备资源,而且

.

1、Eth-Trunk背景

随着网络中部署的业务量不断增长,对于全双工点对点链路,单条物理链路的带宽已不能满足正常的业务流量需求。如果将当前接口板替换为具备更高带宽的接口板,则会浪费现有的设备资源,而且升级代价较大。如果增加设备间的链路数量,则在作为三层口使用时需要在每个接口上配置IP地址,从而导致浪费IP地址资源

1.1、Eth-Trunk的优点

Eth-Trunk( 链路聚合技术 )作为一种捆绑技术,可以把多个独立的物理接口绑定在一起作为一个大带宽的逻辑接口使用,这样既不用替换接口板也不会浪费IP地址资源

根据不同的链路聚合模式,Eth-Trunk接口可以实现增加带宽、负载分担等,帮助提高网络的可靠性

2、Eth-Trunk原理

Eth-Trunk可以用于二层的链路聚合,也可以用于三层的链路聚合。
缺省情况下,以太网接口工作在二层模式。
如果需要配置二层Eth-Trunk接口,可以通过portswitch命令将该接口切换成二层接口;
如果需要配置三层Eth-Trunk接口,可以通过undo portswitch命令将该接口切换成三层接口。

Eth-Trunk是一种将多个以太网接口捆绑成一个逻辑接口的捆绑技术。

Eth-Trunk链路聚合模式

手工负载分担模式
LACP模式

2.1、手工负载分担模式


当两台设备中至少有一台不支持LACP协议时,可使用手工负载分担模式的Eth-Trunk来增加设备间的带宽及可靠性。
注意:在手工负载分担模式下,加入Eth-Trunk的链路都进行数据的转发。

2.2、LACP模式

LACP模式也称为M:N模式,其中M条链路处于活动状态转发数据,N条链路处于非活动状态作为备份链路。
图中设置的活跃链路数为2,即2条链路处于转发状态,1条链路处于备份状态,不转发数据,只有当活跃的链路出现故障时,备份链路才进行转发。

LACP模式活动链路的选取

LACP模式的抢占机制

2.3、Eth-Trunk接口负载分担

Eth-Trunk接口进行负载分担时,可以选择IP地址或者包作为负载分担的散列依据;同时还可以设置成员接口的负载分担权重。成员接口的权重值占所有成员接口负载分担权重之和的比例越大,该成员接口承担的负载就越大。

执行命令system-view,进入系统视图。 执行命令interface eth-trunk trunk-id,进入Eth-Trunk接口视图。 执行命令load-balance { ip | packet-all },配置Eth-Trunk接口的散列依据。

缺省情况下,当Eth-Trunk接口根据IP进行散列。
说明:
基于IP的散列算法能保证包顺序,但不能保证带宽利用率。
基于包的散列算法能保证带宽利用率,但不能保证包的顺序。
配置负载分担权重

执行命令system-view,进入系统视图。 执行命令interface interface-type interface-number,进入以太网接口视图。 执行命令distribute-weight weight-value,配置Eth-Trunk成员接口的负载分担权重。

缺省情况下,成员接口的负载分担权重为1


3、Eth-Trunk配置

3.1、Eth-Trunk接口配置流程

Eth-trunk在同一个接口下的注意事项

在一个聚合口中,聚合链路两端的物理口(即成员口)的所有参数必须一致,包括物理口的数量,传输速率,双工模式和流量控制模式。成员口可以是二层接口或三层接口

3.2、配置手工负载分担模式


配置手工负载分担模式的步骤
 创建Eth-Trunk
 配置Eth-Trunk的工作模式
 Eth-Trunk中加入成员接口

3.3、配置LACP模式


配置LACP模式的步骤:
 创建Eth-Trunk;
 配置Eth-Trunk的工作模式;
 Eth-Trunk中加入成员接口;
 (可选)配置系统LACP优先级;
 (可选)配置活动接口数上限阈值;
 (可选)配置接口LACP优先级;
 (可选)使能LACP抢占并配置抢占延时时间。

3.4、举例如下

手工负载分担模式(默认)

SW1的配置文件

#sysname SW1#vlan batch 5#interface Eth-Trunk12 port link-type trunk port trunk allow-pass vlan 5 trunkport GigabitEthernet 0/0/1 to 0/0/3    第一种方式:把接口加入到eth-trunk12

怎么将接口加入到Eth-Trunk当中

第一种方式:把接口加入到eth-trunk12
第二种方式:在接口下面直接敲eth-trunk12

interface GigabitEthernet0/0/1 eth-trunk 12   第二种方式:在接口下面直接敲eth-trunk12#interface GigabitEthernet0/0/2eth-trunk 12   第二种方式:在接口下面直接敲eth-trunk12#interface GigabitEthernet0/0/3eth-trunk 12   第二种方式:在接口下面直接敲eth-trunk12#interface GigabitEthernet0/0/4 port link-type access port default vlan 5#

SW2的配置文件

#sysname SW2#vlan batch 5#interface Eth-Trunk12 port link-type trunk port trunk allow-pass vlan 5#interface GigabitEthernet0/0/1 eth-trunk 12#interface GigabitEthernet0/0/2 eth-trunk 12#interface GigabitEthernet0/0/3 eth-trunk 12#interface GigabitEthernet0/0/4 port link-type access port default vlan 5#

LACP负载分担模式

SW1的配置文件

#sysname SW1#vlan batch 5#interface Eth-Trunk12 port link-type trunk port trunk allow-pass vlan 5 mode lacp-static           修改我们的模式 lacp preempt enable        开启我们接口的抢占功能 max active-linknumber 2    活动链路的条数#lacp priority 4096      确定SW1为我们主动端#interface GigabitEthernet0/0/2 eth-trunk 12 lacp priority 4096     把我们G0/0/2的接口优先级设置为4096#interface GigabitEthernet0/0/3 eth-trunk 12 lacp priority 8192     把我们G0/0/3的接口优先级设置为8192#

检查

[SW1]display  eth-trunk 12Eth-Trunk12's state information is:Local:LAG ID: 12                  WorkingMode: STATIC                               Preempt Delay Time: 30      Hash arithmetic: According to SIP-XOR-DIP         System Priority: 4096       System ID: 4c1f-ccb3-41d0                         Least Active-linknumber: 1  Max Active-linknumber: 2                          Operate status: up          Number Of Up Port In Trunk: 2                     --------------------------------------------------------------------------------ActorPortName          Status   PortType PortPri PortNo PortKey PortState WeightGigabitEthernet0/0/1   Unselect 1GE      32768   2      3121    10100000  1     GigabitEthernet0/0/2   Selected 1GE      4096    3      3121    10111100  1     GigabitEthernet0/0/3   Selected 1GE      8192    4      3121    10111100  1     Partner:--------------------------------------------------------------------------------ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortStateGigabitEthernet0/0/1   32768    4c1f-cc77-6efe  32768   2      3121    10110000GigabitEthernet0/0/2   32768    4c1f-cc77-6efe  32768   3      3121    10111100GigabitEthernet0/0/3   32768    4c1f-cc77-6efe  32768   4      3121    10111100

把SW1的G0/0/2接口手动shutdown

[SW1-GigabitEthernet0/0/2]shutdown  [SW1]display  eth-trunk 12Eth-Trunk12's state information is:Local:LAG ID: 12                  WorkingMode: STATIC                               Preempt Delay Time: 30      Hash arithmetic: According to SIP-XOR-DIP         System Priority: 4096       System ID: 4c1f-ccb3-41d0                         Least Active-linknumber: 1  Max Active-linknumber: 2                          Operate status: up          Number Of Up Port In Trunk: 2                     --------------------------------------------------------------------------------ActorPortName          Status   PortType PortPri PortNo PortKey PortState WeightGigabitEthernet0/0/1   Selected 1GE      32768   2      3121    10111100  1     GigabitEthernet0/0/2   Unselect 1GE      4096    3      3121    10100010  1     GigabitEthernet0/0/3   Selected 1GE      8192    4      3121    10111100  1     Partner:--------------------------------------------------------------------------------ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortStateGigabitEthernet0/0/1   32768    4c1f-cc77-6efe  32768   2      3121    10111100GigabitEthernet0/0/2   0        0000-0000-0000  0       0      0       10100011GigabitEthernet0/0/3   32768    4c1f-cc77-6efe  32768   4      3121    10111100[SW1]

思考如下

实战如下

在路由器AR1上面的配置

# sysname AR1#vlan batch 10 30#lacp priority 1#interface Eth-Trunk1 undo portswitch mode lacp-static lacp preempt enable max active-linknumber 2 lacp preempt delay 10#interface Eth-Trunk1.10 dot1q termination vid 10 ip address 192.168.1.254 255.255.255.0  arp broadcast enable#interface Eth-Trunk1.30 dot1q termination vid 30 ip address 192.168.3.254 255.255.255.0  arp broadcast enable#interface GigabitEthernet0/0/0 eth-trunk 1 lacp priority 1#interface GigabitEthernet0/0/1 ip address 192.168.2.254 255.255.255.0 #interface GigabitEthernet0/0/2 eth-trunk 1 lacp priority 2#interface GigabitEthernet1/0/0 eth-trunk 1#

在交换机上面的配置

#sysname SW1#vlan batch 10 30#interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 10 30 mode lacp-static#interface GigabitEthernet0/0/1 eth-trunk 1#interface GigabitEthernet0/0/2 port link-type access port default vlan 10#interface GigabitEthernet0/0/3 eth-trunk 1#interface GigabitEthernet0/0/4 port link-type access port default vlan 30#interface GigabitEthernet0/0/5 eth-trunk 1#

检查如下

<AR1>display eth-trunk 1Eth-Trunk1's state information is:Local:LAG ID: 1                   WorkingMode: STATIC                               Preempt Delay Time: 10      Hash arithmetic: According to SIP-XOR-DIP         System Priority: 1          System ID: 00e0-fc97-0676                         Least Active-linknumber: 1  Max Active-linknumber: 2                          Operate status: up          Number Of Up Port In Trunk: 2                     --------------------------------------------------------------------------------ActorPortName          Status   PortType PortPri PortNo PortKey PortState WeightGigabitEthernet0/0/0   Selected 1GE      1       1      305     10111100  1     GigabitEthernet0/0/2   Selected 1GE      2       2      305     10111100  1     GigabitEthernet1/0/0   Unselect 1GE      32768   3      305     10100000  1     Partner:--------------------------------------------------------------------------------ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortStateGigabitEthernet0/0/0   32768    4c1f-cca8-21b9  32768   2      305     10111100GigabitEthernet0/0/2   32768    4c1f-cca8-21b9  32768   4      305     10111100GigabitEthernet1/0/0   32768    4c1f-cca8-21b9  32768   6      305     10110000<AR1>display trunkmembership eth-trunk 1Trunk ID: 1 Used status: VALID TYPE: ethernet Working Mode : Static Number Of Ports in Trunk = 3Number Of Up Ports in Trunk = 2Operate status: up Interface GigabitEthernet0/0/0, valid, operate up, weight=1Interface GigabitEthernet0/0/2, valid, operate up, weight=1Interface GigabitEthernet1/0/0, valid, operate down, weight=1<SW1>display  eth-trunk 1Eth-Trunk1's state information is:Local:LAG ID: 1                   WorkingMode: STATIC                               Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         System Priority: 32768      System ID: 4c1f-cca8-21b9                         Least Active-linknumber: 1  Max Active-linknumber: 8                          Operate status: up          Number Of Up Port In Trunk: 2                     --------------------------------------------------------------------------------ActorPortName          Status   PortType PortPri PortNo PortKey PortState WeightGigabitEthernet0/0/1   Selected 1GE      32768   2      305     10111100  1     GigabitEthernet0/0/3   Selected 1GE      32768   4      305     10111100  1     GigabitEthernet0/0/5   Unselect 1GE      32768   6      305     10110000  1     Partner:--------------------------------------------------------------------------------ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortStateGigabitEthernet0/0/1   1        00e0-fc97-0676  1       1      305     10111100GigabitEthernet0/0/3   1        00e0-fc97-0676  2       2      305     10111100GigabitEthernet0/0/5   1        00e0-fc97-0676  32768   3      305     10100000<SW1>display  trunkmembership eth-trunk 1Trunk ID: 1 Used status: VALID TYPE: ethernet Working Mode : Static Number Of Ports in Trunk = 3Number Of Up Ports in Trunk = 2Operate status: up Interface GigabitEthernet0/0/1, valid, operate up, weight=1Interface GigabitEthernet0/0/3, valid, operate up, weight=1Interface GigabitEthernet0/0/5, valid, operate down, weight=1

连通性测试


.

广告 广告

评论区