eNSP第二篇:Eth-trunk,链路聚合,常用命令,二层链路聚合和三层链路聚合

链路聚合,Eth-trunk,ip-trunk

链路聚合:顾名思义,就是将多条链路聚合成一条链路,这条链路的带宽等于所有有效链路的总和;属于可靠性技术。

主要作用是:提高带宽,增加可靠性

在eNSP中,交换机是只可以启用二层的链路聚合,路由器中则可以将链路切换到第三层;

常用命令:

interface Eth-trunk [id]

//创建聚合口,并进入聚合口接口视图,id范围0~63,id只在本设备中起作用

例如:interface Eth-trunk 0

mode lacp-static

//使用静态lacp模式

命令使用视图:链路聚合口接口视图

例如:[Huawei-Eth-Trunk1]mode lacp-static

trunkport [接口类型Ethernet | GigabitEthernet] [接口id] [to [接口id]]

//将接口加入聚合链路中

命令使用视图:链路聚合口接口视图

例如:[Huawei-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3

eth-trunk [聚合口-id]

//将接口加入聚合链路中

命令使用视图:交换机接口视图

例如:[Huawei-GigabitEthernet0/0/1]eth-trunk 1

max active-linknumber [1-8]

//配置有效链路最大数量,当聚合链路超过最大数时,将多余出来的链路作为备份链路,当有效链路中有链路down掉后,则从备用链路中选取出新的链路来替代down的链路;

命令使用视图:链路聚合口接口视图

例如:[Huawei-Eth-Trunk1]max active-linknumber 3

load-balance [负载均衡模式]

//配置链路的负载均衡模式

负载均衡模式

src-mac

源mac地址

dst-mac

目的mac地址

src-ip

源ip地址

dst-ip

目的ip地址

src-dst-mac

源和目的mac地址

src-dst-ip

源和目的ip地址(默认配置)

命令使用视图:链路聚合口接口视图

例如:[Huawei-Eth-Trunk1]load-balance src-dst-mac

undo portswitch

//切换三层路由模式

命令使用视图:链路聚合口接口视图

例如:[Huawei-Eth-Trunk1]undo portswitch

 

二层链路聚合配置思路:

  1. 创建聚合口
  2. 配置聚合链路的模式(可省略)
  3. 添加物理接口
  4. 配置接口模式:access,trunk,hybrid
  5. 配置接口模式的pvid,TG,UT相关的参数
  6. 配置负载均衡(可省略)
  7. 配置最大活跃接口数量(可省略)

 

三层链路聚合配置思路

  1. 创建聚合口
  2. 将接口切换到第三层
  3. 添加物理接口
  4. 添加IP地址及相关配置
  5. 配置负载均衡模式(可省略)
  6. 配置最大活跃接口数量(可省略)

 

配置注意事项:配置聚合链路模式前不可以先添加物理接口,添加物理接口后才可以配置接口模式及相关参数,否则会造成添加物理接口失败!

 

实验

本篇只讲关于Eth-trunk的配置,本实验中不涉及三层的链路聚合

其他相关配置:https://blog.csdn.net/weixin_46678521/article/details/126472140

bb9ce8932519453ead9a728e8635a8c1.png

 

S1

[S1]interface Eth-trunk 1

[S1-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2

Info: This operation may take a few seconds. Please wait for a moment...done.

[S1-Eth-Trunk1]port link-type trunk

[S1-Eth-Trunk1]port trunk allow-pass vlan 10 100

[S1-Eth-Trunk1]load-balance src-dst-mac

[S1-Eth-Trunk1]quit

S2

[S2]interface Eth-trunk 1

[S2-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2

Info: This operation may take a few seconds. Please wait for a moment...done.

[S2-Eth-Trunk1]port link-type trunk

[S2-Eth-Trunk1]port trunk allow-pass vlan 20 100

[S2-Eth-Trunk1]load-balance src-dst-mac

[S2-Eth-Trunk1]quit

S3

[S3]interface Eth-trunk 1

[S3-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2

Info: This operation may take a few seconds. Please wait for a moment...done.

[S3-Eth-Trunk1]port link-type trunk

[S3-Eth-Trunk1]port trunk allow-pass vlan 30 100

[S3-Eth-Trunk1]load-balance src-dst-mac

[S3-Eth-Trunk1]quit

S4

[S4]interface Eth-trunk 1

[S4-Eth-Trunk1]trunkport g 0/0/1 to 0/0/2

Info: This operation may take a few seconds. Please wait for a moment...done.

[S4-Eth-Trunk1]port link-type trunk

[S4-Eth-Trunk1]port trunk allow-pass vlan 40 100

[S4-Eth-Trunk1]load-balance src-dst-mac

[S4-Eth-Trunk1]quit

SW1

[SW1]interface Eth-trunk 1

[SW1-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW1-Eth-Trunk1]port link-type trunk

[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 100

[SW1-Eth-Trunk1]load-balance src-dst-mac

[SW1-Eth-Trunk1]quit

[SW1]interface Eth-trunk 2

[SW1-Eth-Trunk2]trunkport g 0/0/13 to 0/0/14

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW1-Eth-Trunk2]port link-type trunk

[SW1-Eth-Trunk2]port trunk allow-pass vlan 20 100

[SW1-Eth-Trunk2]load-balance src-dst-mac

[SW1-Eth-Trunk2]quit

[SW1]interface Eth-trunk 3

[SW1-Eth-Trunk3]trunkport g 0/0/23 to 0/0/24

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW1-Eth-Trunk3]port link-type trunk

[SW1-Eth-Trunk3]port trunk allow-pass vlan  6 100

[SW1-Eth-Trunk3]load-balance src-dst-ip

[SW1-Eth-Trunk3]quit

SW2

[SW2]interface Eth-trunk 1

[SW2-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW2-Eth-Trunk1]port link-type trunk

[SW2-Eth-Trunk1]port trunk allow-pass vlan 30 100

[SW2-Eth-Trunk1]load-balance src-dst-mac

[SW2-Eth-Trunk1]quit

[SW2]interface Eth-trunk 2

[SW2-Eth-Trunk2]trunkport g 0/0/13 to 0/0/14

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW2-Eth-Trunk2]port link-type trunk

[SW2-Eth-Trunk2]port trunk allow-pass vlan 40 100

[SW2-Eth-Trunk2]load-balance src-dst-mac

[SW2-Eth-Trunk2]quit

[SW2]interface Eth-trunk 3

[SW2-Eth-Trunk3]trunkport g 0/0/23 to 0/0/24

Info: This operation may take a few seconds. Please wait for a moment...done.

[SW2-Eth-Trunk3]port link-type trunk

[SW2-Eth-Trunk3]port trunk allow-pass vlan  6 100

[SW2-Eth-Trunk3]load-balance src-dst-ip

[SW2-Eth-Trunk3]quit

LSW1

[LSW1]interface Eth-trunk 1

[LSW1-Eth-Trunk1]trunkport g 0/0/23  to 0/0/24

Info: This operation may take a few seconds. Please wait for a moment...done.

[LSW1-Eth-Trunk1]port link-type trunk

[LSW1-Eth-Trunk1]port trunk allow-pass vlan 2 to 5 7

[LSW1-Eth-Trunk1]load-balance src-dst-mac

[LSW1-Eth-Trunk1]quit

LSW2

[LSW2]interface Eth-trunk 1

[LSW2-Eth-Trunk1]trunkport g 0/0/23  to 0/0/24

Info: This operation may take a few seconds. Please wait for a moment...done.

[LSW2-Eth-Trunk1]port link-type trunk

[LSW2-Eth-Trunk1]port trunk allow-pass vlan 2 to 5 7

[LSW2-Eth-Trunk1]load-balance src-dst-mac

[LSW2-Eth-Trunk1]quit

 

  • 6
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值