链路捆绑小实验

目录

链路捆绑:

命令:


链路捆绑:

简单而言就是几条链路捆绑在一个逻辑接口上,它的作用是:增加带宽,增强链路冗余性。与这个知识相关的术语有:bpdu(网桥协议数据单元)。链路捆绑我们一般有这两种模式:手工模式和LACP(链路汇聚控制协议)。我们主要应用的是LACP。

命令:

在交换机上面调优先级:lacp priority 1000

创建并进入逻辑链路接口:interface Eth-Trunk1

打开网桥协议数据单元:bpdu enable

在逻辑接口设置LACP模式:
mode lacp-static
顺便在这个地方说一下,如果在捆绑了物理接口的情况下要设置LACP模式是没法设置的,所以要进入物理接口删除逻辑接口才可以操作。
int e0/0/0
undo eth-trunk
一般在链路数比较多的情况下我们会设置最大链路活动数量:
max active-linknumber 2
多条物理接口加入到一个逻辑接口:
trunkport e 0/0/1 to 0/0/5
不同的物理接口加入到逻辑接口:
int g0/0/1
eth-trunk 1
查看链路负载的令:
dis trunkmembership eth-trunk 1

拓扑图

 首先配置交换机sw1


[sw1]vlan batch 10 20
[sw1]int e0/0/6
[sw1-Ethernet0/0/6]port link-type access 
[sw1-Ethernet0/0/6]port default vlan 10
[sw1-Ethernet0/0/6]un sh

[sw1-Ethernet0/0/6]int e0/0/7
[sw1-Ethernet0/0/6]port link-type access 
[sw1-Ethernet0/0/6]port default vlan 20
[sw1-Ethernet0/0/6]un sh
[sw1-Ethernet0/0/6]q
[sw1]lacp priority 1000
[sw1]int Eth-Trunk 1
[sw1-Eth-Trunk1]bpdu enable 
[sw1-Eth-Trunk1]mode lacp-static 
[sw1-Eth-Trunk1]trunkport Ethernet  0/0/3 to 0/0/5
[sw1-Eth-Trunk1]max active-linknumber 2
[sw1-Eth-Trunk1]port link-type trunk 
[sw1-Eth-Trunk1]port trunk allow-pass vlan all 
[sw1-Eth-Trunk1]un sh
[sw1-Eth-Trunk1]q
[sw1]interface Eth-Trunk 2  
[sw1-Eth-Trunk2]trunkport Ethernet 0/0/1 to 0/0/2
[sw1-Eth-Trunk2]port link-type access 
[sw1-Eth-Trunk2]port default vlan 10
[sw1-Eth-Trunk2]un sh

 交换机sw2

[sw2]vlan batch 10 20
[sw2]int e0/0/6
[sw2-Ethernet0/0/6]port link-type access
[sw2-Ethernet0/0/6]port default vlan 10
[sw2-Ethernet0/0/6]port link-type access 
[sw2-Ethernet0/0/6]un sh
[sw2-Ethernet0/0/6]int e0/0/7
[sw2-Ethernet0/0/7]port link-type access 
[sw2-Ethernet0/0/7]port default vlan 20
[sw2-Ethernet0/0/7]un sh
[sw2-Ethernet0/0/7]q
[sw2]int Eth-Trunk 1
[sw2-Eth-Trunk1]bpdu enable 
[sw2-Eth-Trunk1]mode lacp-static 
[sw2-Eth-Trunk1]trunkport Ethernet 0/0/3 to 0/0/5
[sw2-Eth-Trunk1]port link-type trunk 
[sw2-Eth-Trunk1]port trunk allow-pass vlan all 
[sw2-Eth-Trunk1]un sh
[sw2-Eth-Trunk1]q
[sw2]interface Eth-Trunk 2
[sw2-Eth-Trunk2]trunkport Ethernet 0/0/1 to  0/0/2
[sw2-Eth-Trunk2]port link-type access 
[sw2-Eth-Trunk2]port default vlan 20
[sw2-Eth-Trunk2]un sh

r1:


[r1]int Eth-Trunk 2
[r1-Eth-Trunk2]trunkport Ethernet 0/0/0 to 0/0/1
[r1-Eth-Trunk2]ip add 192.168.10.1 24
[r1-Eth-Trunk2]un sh
[r1-Eth-Trunk2]q
[r1]int Eth-Trunk 1
[r1-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/1
[r1-Eth-Trunk1]ip add 12.0.0.1 30
[r1-Eth-Trunk1]un sh
[r1-Eth-Trunk1]q
[r1]ip route-static 192.168.20.0 24 12.0.0.2

r2:


[r2]interface Eth-Trunk 2
[r2-Eth-Trunk2]trunkport Ethernet 0/0/0 to 0/0/1
[r2-Eth-Trunk2]ip add 192.168.20.1 24
[r2-Eth-Trunk2]un sh
[r2-Eth-Trunk2]q
[r2]int Eth-Trunk 1
[r2-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/1
[r2-Eth-Trunk1]ip add 12.0.0.2 30
[r2-Eth-Trunk1]un sh
[r2-Eth-Trunk1]q
[r2]ip route-static 192.168.10.0 24 12.0.0.1

然后把主机配置一下

去ping一下试试

能通就o啦

猜你喜欢

转载自blog.csdn.net/weixin_48190887/article/details/106967157