- 将SwitchA和SwitchB配置为根桥,配置相同的桥ID,保证M-LAG主备设备在二层网络中处于根桥地位。
- 分别在SwitchA和SwitchB上配置管理网口的IP地址,且保证能够三层互通,用于M-LAG主备设备间心跳报文的传输。
- 分别在SwitchA和SwitchB上配置M-LAG特性,实现服务器的双归接入。
- 在SwitchC和SwitchD上创建VLANIF接口并配置IP地址,在VLANIF接口上创建VRRP备份组,作为M-LAG主备设备的网关。
操作步骤
1.switchA和switchB配置根桥和相同桥ID
switchA
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] stp root primary
[*SwitchA] stp bridge-address 39-39-39
[*SwitchA] interface eth-trunk 1
[*SwitchA-Eth-Trunk1] trunkport 10ge 1/0/5
[*SwitchA-Eth-Trunk1] trunkport 10ge 1/0/6
[*SwitchA-Eth-Trunk1] stp edged-port enable
[*SwitchA-Eth-Trunk1] commit
[~SwitchA-Eth-Trunk1] quit
switchB
<HUAWEI> system-view
[~HUAWEI] sysname SwitchB
[*HUAWEI] commit
[~SwitchB] stp root primary
[*SwitchB] stp bridge-address 39-39-39
[*SwitchB] interface eth-trunk 1
[*SwitchB-Eth-Trunk1] trunkport 10ge 1/0/5
[*SwitchB-Eth-Trunk1] trunkport 10ge 1/0/6
[*SwitchB-Eth-Trunk1] stp edged-port enable
[*SwitchB-Eth-Trunk1] commit
[~SwitchB-Eth-Trunk1] quit
2.分别配置SwitchA和SwitchB管理网口的IP,用于双主检测
[~SwitchA] interface meth 0/0/0
[~SwitchA-MEth0/0/0] ip address 10.1.1.1 24
[*SwitchA-MEth0/0/0] quit
[*SwitchA] commit
[~SwitchB] interface meth 0/0/0
[~SwitchB-MEth0/0/0] ip address 10.1.1.2 24
[*SwitchB-MEth0/0/0] quit
[*SwitchB] commit
3.在SwitchA和SwitchB上分别创建DFS并绑定管理网口的IP地址
[~SwitchA] dfs-group 1
[*SwitchA-dfs-group-1] source ip 10.1.1.1
[*SwitchA-dfs-group-1] priority 150
[*SwitchA-dfs-group-1] quit
[*SwitchA] commit
[~SwitchB] dfs-group 1
[*SwitchB-dfs-group-1] source ip 10.1.1.2
[*SwitchB-dfs-group-1] priority 120
[*SwitchB-dfs-group-1] quit
[*SwitchB] commit
4.配置SwitchA和SwitchB之间的Peer-link
[~SwitchA] interface eth-trunk 0
[*SwitchA-Eth-Trunk0] trunkport 10ge 1/0/3
[*SwitchA-Eth-Trunk0] trunkport 10ge 1/0/4
[*SwitchA-Eth-Trunk0] undo stp enable
[*SwitchA-Eth-Trunk0] mode lacp-static
[*SwitchA-Eth-Trunk0] peer-link 1
[*SwitchA-Eth-Trunk0] quit
[*SwitchA] commit
[~SwitchB] interface eth-trunk 0
[*SwitchB-Eth-Trunk0] trunkport 10ge 1/0/3
[*SwitchB-Eth-Trunk0] trunkport 10ge 1/0/4
[*SwitchB-Eth-Trunk0] undo stp enable
[*SwitchB-Eth-Trunk0] mode lacp-static
[*SwitchB-Eth-Trunk0] peer-link 1
[*SwitchB-Eth-Trunk0] quit
[*SwitchB] commit
5.配置SwitchA和SwitchB前面配置好的连接服务器Eth-Trunk1接口加入VLAN 11并绑定DFS Group
[~SwitchA] vlan batch 11
[*SwitchA] interface eth-trunk 1
[*SwitchA-Eth-Trunk1] mode lacp-dynamic
[*SwitchA-Eth-Trunk1] port link-type access
[*SwitchA-Eth-Trunk1] port default vlan 11
[*SwitchA-Eth-Trunk1] dfs-group 1 m-lag 1
[*SwitchA-Eth-Trunk1] quit
[*SwitchA] commit
[~SwitchB] vlan batch 11
[*SwitchB] interface eth-trunk 1
[*SwitchB-Eth-Trunk1] mode lacp-dynamic
[*SwitchB-Eth-Trunk1] port link-type access
[*SwitchB-Eth-Trunk1] port default vlan 11
[*SwitchB-Eth-Trunk1] dfs-group 1 m-lag 1
[*SwitchB-Eth-Trunk1] quit
[*SwitchB] commit
6.配置SwitchA和SwitchC之间为聚合链路以及SwitchB和SwitchD之间为聚合链路,并配置接口类型和通过的VLAN
[~SwitchA] interface eth-trunk 2
[*SwitchA-Eth-Trunk2] mode lacp-static
[*SwitchA-Eth-Trunk2] port link-type trunk
[*SwitchA-Eth-Trunk2] port trunk allow-pass vlan 11
[*SwitchA-Eth-Trunk2] trunkport 10ge 1/0/1
[*SwitchA-Eth-Trunk2] trunkport 10ge 1/0/2
[*SwitchA-Eth-Trunk2] undo stp enable
[*SwitchA-Eth-Trunk2] quit
[*SwitchA] commit
[~SwitchB] interface eth-trunk 2
[*SwitchB-Eth-Trunk2] mode lacp-static
[*SwitchB-Eth-Trunk2] port link-type trunk
[*SwitchB-Eth-Trunk2] port trunk allow-pass vlan 11
[*SwitchB-Eth-Trunk2] trunkport 10ge 1/0/1
[*SwitchB-Eth-Trunk2] trunkport 10ge 1/0/2
[*SwitchB-Eth-Trunk2] undo stp enable
[*SwitchB-Eth-Trunk2] quit
[*SwitchB] commit
<HUAWEI> system-view
[~HUAWEI] sysname SwitchC
[*HUAWEI] commit
[~SwitchC] vlan batch 11
[*SwitchC] interface eth-trunk 2
[*SwitchC-Eth-Trunk2] mode lacp-static
[*SwitchC-Eth-Trunk2] port link-type trunk
[*SwitchC-Eth-Trunk2] port trunk allow-pass vlan 11
[*SwitchC-Eth-Trunk2] trunkport 10ge 1/0/1
[*SwitchC-Eth-Trunk2] trunkport 10ge 1/0/2
[*SwitchC-Eth-Trunk2] quit
[*SwitchC] commit
<HUAWEI> system-view
[~HUAWEI] sysname SwitchD
[*HUAWEI] commit
[~SwitchD] vlan batch 11
[*SwitchD] interface eth-trunk 2
[*SwitchD-Eth-Trunk2] mode lacp-static
[*SwitchD-Eth-Trunk2] port link-type trunk
[*SwitchD-Eth-Trunk2] port trunk allow-pass vlan 11
[*SwitchD-Eth-Trunk2] trunkport 10ge 1/0/1
[*SwitchD-Eth-Trunk2] trunkport 10ge 1/0/2
[*SwitchD-Eth-Trunk2] quit
[*SwitchD] commit
7.在SwitchC和SwitchD上创建VLANIF接口并配置IP地址,在VLANIF接口上创建VRRP备份组
[~SwitchC] interface vlanif 11
[*SwitchC-Vlanif11] ip address 10.2.1.1 24
[*SwitchC-Vlanif11] vrrp vrid 1 virtual-ip 10.2.1.111
[*SwitchC-Vlanif11] vrrp vrid 1 priority 120
[*SwitchC-Vlanif11] quit
[*SwitchC] commit
[~SwitchD] interface vlanif 11
[*SwitchD-Vlanif11] ip address 10.2.1.2 24
[*SwitchD-Vlanif11] vrrp vrid 1 virtual-ip 10.2.1.111
[*SwitchD-Vlanif11] quit
[*SwitchD] commit
8.验证配置结果
[~SwitchA] display dfs-group 1 m-lag
* : Local node
Heart beat state : OK
Node 1 *
Dfs-Group ID : 1
Priority : 150
Address : ip address 10.1.1.1
State : Master
Causation : -
System ID : 00e0-fc95-7c31
SysName : SwitchA
Version : V200R020C00
Device Type : CE9860EI
Node 2
Dfs-Group ID : 1
Priority : 120
Address : ip address 10.1.1.2
State : Backup
Causation : -
System ID : 00e0-fc95-7c11
SysName : SwitchB
Version : V200R020C00
Device Type : CE9860EI