HCL模拟器下做M-LAG测试(以及和华为配置对比)-二层架构

1.简单二层架构

1.1 拓扑图

在这里插入图片描述

1.2 配置

1.2.1 Leaf1配置

system-mac必须配置,否则会有一个node处于unknown状态,即使配置主节点的mac,主节点也需要配置system-mac为自己的mac

## M-LAG配置

[Leaf1] m-lag system-mac 0001-0001-0001			# 手动设置MAC,通常建议使用主设备的系统MAC,另一台设备配置需相同
[Leaf1] m-lag system-number 1				# 数字小的成为主设备,
[Leaf1] m-lag system-priority 130				# 两台的优先级需要一样
[Leaf1] m-lag mad exclude interface GigabitEthernet1/0/13	# 配置保留接口,这个接口会在脑裂后不会被关闭
[Leaf1] m-lag consistency-check disable			# 模拟器中配置完成后,会报一致性检测失败的错,导致接口起不来,使用这条命令能解决,但生产环境中慎用

## keepalive链路配置

[Leaf1] interface g1/0/13
[Leaf1-GigabitEthernet1/0/13]ip address 10.1.1.1 255.255.255.252
[Leaf1] m-lag keepalive ip destination 10.1.1.2 source 10.1.1.1	# 配置DAD检测接口

## peer-link接口配置

[Leaf1] interface Bridge-Aggregation10
[Leaf1-Bridge-Aggregation10] link-aggregation mode dynamic
[Leaf1]interface GigabitEthernet 1/0/11
[Leaf1-GigabitEthernet1/0/11] port link-aggregation group 10
[Leaf1]interface GigabitEthernet 1/0/12
[Leaf1-GigabitEthernet1/0/12] port link-aggregation group 10
[Leaf1] interface Bridge-Aggregation10
[Leaf1-Bridge-Aggregation10] port m-lag peer-link 1

## M-LAG接口配置

[Leaf1]int Bridge-Aggregation 5
[Leaf1-Bridge-Aggregation5] port link-type trunk
[Leaf1-Bridge-Aggregation5] port trunk permit vlan all
[Leaf1-Bridge-Aggregation5] link-aggregation mode dynamic
[Leaf1]interface GigabitEthernet 1/0/1
[Leaf1-GigabitEthernet1/0/1] port link-aggregation group 5
[Leaf1]int Bridge-Aggregation 5
[Leaf1-Bridge-Aggregation5] port m-lag group 5

华为的做法中,peer-link需要关闭STP

1.2.2 Leaf2配置

Leaf2和Leaf1的配置只有细微的差异

## M-LAG配置

[Leaf2] m-lag system-mac 0001-0001-0001			
[Leaf2] m-lag system-number 2				
[Leaf2] m-lag system-priority 130				
[Leaf2] m-lag mad exclude interface GigabitEthernet1/0/13	
[Leaf2] m-lag consistency-check disable			

## keepalive链路配置

[Leaf2] interface g1/0/13
[Leaf1-GigabitEthernet1/0/13]ip address 10.1.1.2 255.255.255.252
[Leaf2] m-lag keepalive ip destination 10.1.1.1 source 10.1.1.2	

## peer-link接口配置

[Leaf2] interface Bridge-Aggregation10
[Leaf1-Bridge-Aggregation10] link-aggregation mode dynamic
[Leaf2]interface GigabitEthernet 1/0/11
[Leaf1-GigabitEthernet1/0/11] port link-aggregation group 10
[Leaf2]interface GigabitEthernet 1/0/12
[Leaf1-GigabitEthernet1/0/12] port link-aggregation group 10
[Leaf2] interface Bridge-Aggregation10
[Leaf1-Bridge-Aggregation10] port m-lag peer-link 1

## M-LAG接口配置

[Leaf2]int Bridge-Aggregation 5
[Leaf1-Bridge-Aggregation5] port link-type trunk
[Leaf1-Bridge-Aggregation5] port trunk permit vlan all
[Leaf1-Bridge-Aggregation5] link-aggregation mode dynamic
[Leaf2]interface GigabitEthernet 1/0/1
[Leaf1-GigabitEthernet1/0/1] port link-aggregation group 5
[Leaf2]int Bridge-Aggregation 5
[Leaf1-Bridge-Aggregation5] port m-lag group 5

1.2.3 SW配置

下行交换机上只需要配置链路聚合即可

[H3C]interface Bridge-Aggregation 5
[H3C-Bridge-Aggregation5] port link-type trunk
[H3C-Bridge-Aggregation5] port trunk permit vlan all
[H3C-Bridge-Aggregation5] link-aggregation mode dynamic

[H3C] interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2
[H3C-if-range] port link-aggregation group 5

1.3 配置验证

这里只验证基本的通信即可,因此在三台交换机上都起了一个VLAN100,并测试连通性,主要查看的内容是m-lag配置是否生效,已经生成树是否达到的预期的效果

1.3.1 M-LAG

[Leaf1]dis m-lag system 
                     System information
Local system number: 1                      Peer system number: 2
Local system MAC: 0001-0001-0001            Peer system MAC: 0001-0001-0001
Local system priority: 130                  Peer system priority: 130
Local bridge MAC: a6ca-1833-0100            Peer bridge MAC: a6ca-3325-0200
Local effective role: Primary               Peer effective role: Secondary
Health level: 0
Standalone mode on split: Disabled
In standalone mode: No

                     System timer information
Timer                      State       Value (s)    Remaining time (s)
Auto recovery              Disabled    -            -
Restore delay              Disabled    300          -
Consistency-check delay    Disabled    150          -
Standalone delay           Disabled    -            -
Role to None delay         Disabled    60           -

交换机上看到的对端设备为逻辑上的一台设备

[H3C]dis link-aggregation verbose 
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing 
Port Status: S -- Selected, U -- Unselected, I -- Individual 
Port: A -- Auto port, M -- Management port, R -- Reference port 
Flags:  A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation, 
        D -- Synchronization, E -- Collecting, F -- Distributing, 
        G -- Defaulted, H -- Expired 

Aggregate Interface: Bridge-Aggregation5
Creation Mode: Manual
Aggregation Mode: Dynamic
Loadsharing Type: Shar
Management VLANs: None
System ID: 0x8000, a6a7-cb71-0300
Local: 
  Port                Status   Priority Index    Oper-Key               Flag
  GE1/0/1             S        32768    1        1                      {ACDEF}
  GE1/0/2             S        32768    2        1                      {ACDEF}
Remote: 
  Actor               Priority Index    Oper-Key SystemID               Flag   
  GE1/0/1(R)          32768    16387    40005    0x82  , 0001-0001-0001 {ACDEF}
  GE1/0/2             32768    32771    40005    0x82  , 0001-0001-0001 {ACDEF}

1.3.2 生成树

下面是Leaf1和Leaf2上关于VLAN100的生成树信息

[Leaf1-Bridge-Aggregation5]dis stp ins 0 int b5
-------[CIST Global Info][Mode MSTP]-------
 Bridge ID           : 32768.0001-0001-0001
 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
 Root ID/ERPC        : 32768.0001-0001-0001, 0
 RegRoot ID/IRPC     : 32768.0001-0001-0001, 0
 RootPort ID         : 0.0
 BPDU-Protection     : Disabled
 BPDU Filter         : Disabled
 Bridge Config-
 Digest-Snooping     : Disabled
 TC or TCN received  : 15
 Time since last TC  : 0 days 0h:6m:52s

----[Port5125(Bridge-Aggregation5)][FORWARDING][M-LAG]----
 Port protocol       : Enabled
 Port role           : Designated Port (Boundary)
 Port ID             : 128.5125
 Port cost(Legacy)   : Config=auto, Active=18
 Desg.bridge/port    : 32768.0001-0001-0001, 128.1029
 Port edged          : Config=disabled, Active=disabled
 Port filter         : Config=default, Active=disabled
 Point-to-Point      : Config=auto, Active=true
 Transmit limit      : 10 packets/hello-time
 TC-Restriction      : Disabled
 Role-Restriction    : Disabled
 Protection type     : Config=none, Active=none
 MST BPDU format     : Config=auto, Active=802.1s
 Port Config-
 Digest-Snooping     : Disabled
 Rapid transition    : True
 Num of VLANs mapped : 2
 Port times          : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 0s RemHops 20
 BPDU sent           : 208
          TCN: 0, Config: 0, RST: 0, MST: 208
 BPDU received       : 2
          TCN: 0, Config: 0, RST: 0, MST: 2
[Leaf2-Bridge-Aggregation5]dis stp ins 0 interface b5
-------[CIST Global Info][Mode MSTP]-------
 Bridge ID           : 32768.0001-0001-0001
 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
 Root ID/ERPC        : 32768.0001-0001-0001, 0
 RegRoot ID/IRPC     : 32768.0001-0001-0001, 0
 RootPort ID         : 0.0
 BPDU-Protection     : Disabled
 BPDU Filter         : Disabled
 Bridge Config-
 Digest-Snooping     : Disabled
 TC or TCN received  : 20
 Time since last TC  : 0 days 0h:9m:39s

----[Port5125(Bridge-Aggregation5)][FORWARDING][M-LAG]----
 Port protocol       : Enabled
 Port role           : Designated Port (Boundary)
 Port ID             : 128.5125
 Port cost(Legacy)   : Config=auto, Active=18
 Desg.bridge/port    : 32768.0001-0001-0001, 128.1029
 Port edged          : Config=disabled, Active=disabled
 Port filter         : Config=default, Active=disabled
 Point-to-Point      : Config=auto, Active=true
 Transmit limit      : 10 packets/hello-time
 TC-Restriction      : Disabled
 Role-Restriction    : Disabled
 Protection type     : Config=none, Active=none
 MST BPDU format     : Config=auto, Active=802.1s
 Port Config-
 Digest-Snooping     : Disabled
 Rapid transition    : True
 Num of VLANs mapped : 2
 Port times          : Hello 2s MaxAge 20s FwdDelay 15s MsgAge 0s RemHops 20
 BPDU sent           : 0
          TCN: 0, Config: 0, RST: 0, MST: 0
 BPDU received       : 0
          TCN: 0, Config: 0, RST: 0, MST: 0

可以看到,两边的桥ID都是一模一样的,说明对于VLAN100,两台leaf交换机都充当了根桥的角色,实现了逻辑上的一台设备

华为交换机的M-lag组中,主设备会把ID信息自动同步到备设备中,让下游的交换机看到的对端设备是逻辑上的一台,这才能够让LAG建立起来,对于STP,需要手工将两台设备的ID配置成一直,来保证两台交换机都是根桥。

在H3C的交换机上正好相反,需要在M-lag中手工配置MAC,STP会直接使用这个MAC作为ID的一部分。

M-LAG(Multi-Chassis Link Aggregation)是华为交换机中一种实现无缝冗余和负载均衡的技术,它可以同时使用两个交换机,让它们看起来像一个设备,从而提高网络的可靠性和性能。下面是华为设备配置 M-LAG 的具体方法和命令: 1. 配置 M-LAG 交换机的基本设置,包括交换机的名称、管理 IP 地址等: [SwitchA] sysname SwitchA [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 10.0.0.1 24 [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 20.0.0.1 24 [SwitchA] interface vlanif 30 [SwitchA-Vlanif30] ip address 30.0.0.1 24 [SwitchB] sysname SwitchB [SwitchB] interface vlanif 10 [SwitchB-Vlanif10] ip address 10.0.0.2 24 [SwitchB] interface vlanif 20 [SwitchB-Vlanif20] ip address 20.0.0.2 24 [SwitchB] interface vlanif 30 [SwitchB-Vlanif30] ip address 30.0.0.2 24 2. 配置 M-LAGLAG(Link Aggregation Group),即物理链路的聚合组。在本例中,我们将使用两个链路聚合组:LAG 1 和 LAG 2: [SwitchA] interface Eth-Trunk 1 [SwitchA-Eth-Trunk1] mode lacp [SwitchA-Eth-Trunk1] trunkport 2/0/1 to 2/0/2 [SwitchB] interface Eth-Trunk 1 [SwitchB-Eth-Trunk1] mode lacp [SwitchB-Eth-Trunk1] trunkport 2/0/1 to 2/0/2 [SwitchA] interface Eth-Trunk 2 [SwitchA-Eth-Trunk2] mode lacp [SwitchA-Eth-Trunk2] trunkport 2/0/3 to 2/0/4 [SwitchB] interface Eth-Trunk 2 [SwitchB-Eth-Trunk2] mode lacp [SwitchB-Eth-Trunk2] trunkport 2/0/3 to 2/0/4 3. 配置 M-LAG 的虚拟接口,即将两个交换机看成一个设备的接口。在本例中,我们将使用三个虚拟接口:Vlanif 10、Vlanif 20 和 Vlanif 30: [SwitchA] interface Vlanif 10 [SwitchA-Vlanif10] m-lag master local 1 [SwitchA-Vlanif10] ip address 10.0.0.1 24 [SwitchB] interface Vlanif 10 [SwitchB-Vlanif10] m-lag master local 1 [SwitchB-Vlanif10] ip address 10.0.0.2 24 [SwitchA] interface Vlanif 20 [SwitchA-Vlanif20] m-lag master local 2 [SwitchA-Vlanif20] ip address 20.0.0.1 24 [SwitchB] interface Vlanif 20 [SwitchB-Vlanif20] m-lag master local 2 [SwitchB-Vlanif20] ip address 20.0.0.2 24 [SwitchA] interface Vlanif 30 [SwitchA-Vlanif30] m-lag master local 3 [SwitchA-Vlanif30] ip address 30.0.0.1 24 [SwitchB] interface Vlanif 30 [SwitchB-Vlanif30] m-lag master local 3 [SwitchB-Vlanif30] ip address 30.0.0.2 24 4. 配置 M-LAG 的备份接口,即当主接口出现故障时,备份接口将接管其工作。在本例中,我们将使用两个备份接口:Backup 1 和 Backup 2: [SwitchA] interface M-Lag 1 backup 1 [SwitchA-M-Lag1-backup1] peer switch SwitchB [SwitchA-M-Lag1-backup1] backup-interface Vlanif 10 [SwitchA] interface M-Lag 2 backup 1 [SwitchA-M-Lag2-backup1] peer switch SwitchB [SwitchA-M-Lag2-backup1] backup-interface Vlanif 20 [SwitchA] interface M-Lag 3 backup 1 [SwitchA-M-Lag3-backup1] peer switch SwitchB [SwitchA-M-Lag3-backup1] backup-interface Vlanif 30 [SwitchB] interface M-Lag 1 backup 1 [SwitchB-M-Lag1-backup1] peer switch SwitchA [SwitchB-M-Lag1-backup1] backup-interface Vlanif 10 [SwitchB] interface M-Lag 2 backup 1 [SwitchB-M-Lag2-backup1] peer switch SwitchA [SwitchB-M-Lag2-backup1] backup-interface Vlanif 20 [SwitchB] interface M-Lag 3 backup 1 [SwitchB-M-Lag3-backup1] peer switch SwitchA [SwitchB-M-Lag3-backup1] backup-interface Vlanif 30 5. 配置 M-LAG 的状态: [SwitchA] m-lag enable [SwitchA] m-lag interface Eth-Trunk 1 [SwitchA] m-lag interface Eth-Trunk 2 [SwitchB] m-lag enable [SwitchB] m-lag interface Eth-Trunk 1 [SwitchB] m-lag interface Eth-Trunk 2 这些命令将为您配置 M-LAG。请注意,这只是一个基本配置,您可能需要根据您的网络环境和需求进行调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

-风中叮铃-

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值