前言
有关链路聚合的实验。之前学的时候,实验做得不是很通顺,于是再次梳理一遍,使自己思路更清晰些。
实验
拓补如图所示:实验环境:HCL模拟器
实验要求:
1.SW1和SW2使用静态聚合,SW2和RT1使用动态
2.SW1和SW2三条线路只让他选中1和2口,5口作为1和2口的备份,或者1和2口出现故障时选择5
3.调整SW1的负载分担模式为目的IP和目的端口
4.保证三个环回口地址互通
实验步骤
首先,配一点简单的。
[RT1]
int l0
ip add 1.1.1.1 24
[SW1]
int l0
ip add 2.2.2.2 24
[SW2]
int l0
ip add 3.3.3.3 24
配置链路聚合
-------------静态-----------------------
[SW2]int Bridge-Aggregation 1//二层聚合端口,默认静态聚合
[SW2-Bridge-Aggregation1]qu
[SW2]int g1/0/2
[SW2-GigabitEthernet1/0/2]port link-aggregation group 1
[SW2-GigabitEthernet1/0/2]int g1/0/5
[SW2-GigabitEthernet1/0/5]port link-aggregation group 1
[SW2-GigabitEthernet1/0/5]int g1/0/1
[SW2-GigabitEthernet1/0/1]port link-aggregation group 1
[SW2]dis link-aggregation verbose
Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Static
Loadsharing Type: Shar
Port Status Priority Oper-Key
--------------------------------------------------------------------------------
GE1/0/1 S 32768 1
GE1/0/2 S 32768 1
GE1/0/5 S 32768 1
[SW2]
静态聚合模式下,不启动LACP,与对端交互信息,所以只看自己端口有没有问题,没问题就都SELECT
[SW1]interface Bridge-Aggregation 2---------这边的组号什么的是没有影响的
[SW1-Bridge-Aggregation2]qu
[SW1]int g1/0/2
[SW1-GigabitEthernet1/0/2]port link-aggregation group 2
[SW1-GigabitEthernet1/0/2]int g1/0/5
[SW1-GigabitEthernet1/0/5]port link-aggregation group 2
[SW1-GigabitEthernet1/0/5]int g1/0/1
[SW1-GigabitEthernet1/0/1]port link-aggregation group 2
-----动态------------
[SW1]int Bridge-Aggregation 1
[SW1-Bridge-Aggregation1]link-aggregation mode dynamic
[SW1-Bridge-Aggregation1]qu
[SW1]int g1/0/3
[SW1-GigabitEthernet1/0/3]port link-aggregation group 1
[SW1-GigabitEthernet1/0/3]int g1/0/4
[SW1-GigabitEthernet1/0/4]port link-aggregation group 1
查看信息--Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Dynamic
Loadsharing Type: Shar
System ID:
Local:
Port Status Priority Oper-Key Flag
--------------------------------------------------------------------------------
GE1/0/3 S 32768 2 {ACDEFG}
GE1/0/4 U 32768 2 {ACG}
Remote:
Actor Partner Priority Oper-Key SystemID Flag
--------------------------------------------------------------------------------
GE1/0/3 0 32768 0 0x8000, 0000-0000-0000 {DEF}
GE1/0/4 0 32768 0 0x8000, 0000-0000-0000 {DEF}
[SW1]
[RT1]int Route-Aggregation 1
[RT1-Route-Aggregation1]link-aggregation mode dynamic
[RT1]int g0/0
[RT1-GigabitEthernet0/0]port link-aggregation group 1
[RT1-GigabitEthernet0/0]int g0/1
[RT1-GigabitEthernet0/1]port link-aggregation group 1
再次查看信息[RT1]dis link-aggregation verbose
Aggregate Interface: Route-Aggregation1
Creation Mode: Manual
Aggregation Mode: Dynamic
Loadsharing Type: Shar
System ID:
Local:
Port Status Priority Oper-Key Flag
--------------------------------------------------------------------------------
GE0/0 S 32768 1 {ACDEF}
GE0/1 S 32768 1 {ACDEF}
Remote:
Actor Partner Priority Oper-Key SystemID Flag
--------------------------------------------------------------------------------
GE0/0 4 32768 2
GE0/1 5 32768 2
[RT1]
链路聚合是把多条物理链路聚合形成一条逻辑链路,主要目的是增加带宽,同时提高链路可靠性。
使网络连通
SW1
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan all
link-aggregation mode dynamic
interface Bridge-Aggregation2
port link-type trunk
port trunk permit vlan all
interface Vlan-interface1
ip address 172.16.1.3 255.255.255.0
interface Vlan-interface2
ip address 192.168.1.1 255.255.255.0
ip route-static 3.3.3.0 24 192.168.1.2
ip route-static 1.1.1.0 24 172.16.1.2
SW2
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan all
interface Vlan-interface2
ip address 192.168.1.2 255.255.255.0
ip route-static 0.0.0.0 0 192.168.1.1
RT1
#
interface Route-Aggregation1
ip address 172.16.1.2 255.255.255.0
link-aggregation mode dynamic
#
ip route-static 0.0.0.0 0 172.16.1.3
-----------------经过尝试,发现交换机和路由链路聚合连通时,只有交换机int vlan 1时,把交换机端口trunk后(不用trunk,也能通)才可和路由器连通。在交换机与交换机进行链路聚合连通,发现都是vlan1时,不用进行之后其他配置,即可连通,为其他vlan时需要端口开启trunk。
2.SW1和SW2三条线路只让他选中1和2口,5口作为1和2口的备份,或者1和2口出现故障时选择5
[SW1]int g1/0/1
[SW1-GigabitEthernet1/0/1]link-aggregation port-priority 1
[SW1-GigabitEthernet1/0/1int g1/0/2
[SW1-GigabitEthernet1/0/2]link-aggregation port-priority 1
[SW1-GigabitEthernet1/0/2int g1/0/5
[SW1-GigabitEthernet1/0/5]link-aggregation port-priority 64
[SW1-GigabitEthernet1/0/5]
-------------SW2也配置相应的,不然就ping不通。如果不配的话直接配置后面最大端口,只有两边都限制最大端口才会通
[SW1]int Bridge-Aggregation 2
[SW1-Bridge-Aggregation2]link-aggregation selected-port maximum 2
[SW2]int Bridge-Aggregation 1
[SW2-Bridge-Aggregation2]link-aggregation selected-port maximum 2
两边都要设置最大端口,不然两端端口一个down,另一个机子还是全S的
SW1查看
Aggregate Interface: Bridge-Aggregation2
Aggregation Mode: Static
Loadsharing Type: Shar
Port Status Priority Oper-Key
--------------------------------------------------------------------------------
GE1/0/1 S 1 1
GE1/0/2 S 1 1
GE1/0/5 U 64 1
[SW1]
在SW1上g1/0/1shutdown
查看现象:
Aggregate Interface: Bridge-Aggregation2
Aggregation Mode: Static
Loadsharing Type: Shar
Port Status Priority Oper-Key
--------------------------------------------------------------------------------
GE1/0/1 U 1 1
GE1/0/2 S 1 1
GE1/0/5 S 64 1
[SW1]
负载均衡
[SW1]int Bridge-Aggregation 1
[SW1-Bridge-Aggregation1]link-aggregation load-sharing mode destination-ip
类似这种就行。
结语
如果说的不对,请指正。