基于华为交换机的三层Clos架构(Leaf-Spine)配置指南
目录
1. 设计原则
- 非阻塞架构:全互联拓扑,Leaf与Spine全连接。
 - 华为特性适配 :
- 使用 M-LAG 替代传统MLAG实现服务器双活接入。
 - 支持 BGP EVPN 作为VXLAN控制平面。
 - 可选 OSPF (中小规模)或 BGP(大规模+多租户)。
 
 - 高可靠性:通过BFD、ECMP、M-LAG实现快速故障切换。
 
2. 配置步骤
步骤1:物理连接与基础配置
Leaf与Spine全互联
            
            
              plaintext
              
              
            
          
          Leaf1 <Eth-Trunk1> --> Spine1
Leaf1 <Eth-Trunk2> --> Spine2
...
Leaf2 <Eth-Trunk1> --> Spine1
Leaf2 <Eth-Trunk2> --> Spine2
        Eth-Trunk配置(链路聚合)
            
            
              bash
              
              
            
          
          # Leaf交换机配置(示例)
sys
interface Eth-Trunk1
  description To_Spine1
  mode lacp-static
  trunkport GigabitEthernet 0/0/1 to 0/0/4  # 4条物理链路聚合
  ip address 10.1.1.1 255.255.255.252
        步骤2:路由协议配置(以OSPF为例)
Leaf交换机配置
            
            
              bash
              
              
            
          
          sys
ospf 1 router-id 1.1.1.1
  area 0.0.0.0
    network 10.1.1.0 0.0.0.3    # Eth-Trunk1接口网段
    network 192.168.0.0 0.0.255.255  # 服务器网段
ip load-balance ecmp 8  # 启用8路径ECMP
        Spine交换机配置
            
            
              bash
              
              
            
          
          sys
ospf 1 router-id 2.2.2.2
  area 0.0.0.0
    network 10.1.0.0 0.0.255.255  # Leaf-Spine互联全网段
        步骤3:VXLAN+EVPN配置(跨Leaf二层扩展)
Leaf交换机配置
            
            
              bash
              
              
            
          
          sys
# 创建BD和VNI映射
bridge-domain 100
  vxlan vni 10010
bridge-domain 200
  vxlan vni 10020
# 配置EVPN实例
evpn vpn-instance EVPN-1
  route-distinguisher 100:1
  vpn-target 100:1 export-extcommunity
  vpn-target 100:1 import-extcommunity
# 绑定BD到EVPN
bridge-domain 100
  evpn binding vpn-instance EVPN-1
bridge-domain 200
  evpn binding vpn-instance EVPN-1
# 配置VXLAN隧道
interface Nve1
  source-address 1.1.1.1  # Leaf的Loopback地址
  vni 10010 head-end peer-list protocol bgp
  vni 10020 head-end peer-list protocol bgp
# 启用BGP EVPN
bgp 65001
  peer SPINE_GROUP as-number 65000
  peer SPINE_GROUP connect-interface LoopBack0
  ipv4-family unicast
    peer SPINE_GROUP enable
  l2vpn-family evpn
    policy vpn-target
    peer SPINE_GROUP enable
        步骤4:M-LAG高可用配置(服务器双归接入)
Leaf成对配置
            
            
              bash
              
              
            
          
          sys
# 全局启用M-LAG
m-lag global
  m-lag system-mac 0001-0001-0001
  m-lag system-priority 100
  m-lag keepalive ip destination 192.168.100.1 source 192.168.100.2
# 配置M-LAG接口
interface Eth-Trunk10
  portswitch
  m-lag group 10
interface GigabitEthernet0/0/10
  eth-trunk 10
        步骤5:BFD快速检测
            
            
              bash
              
              
            
          
          sys
bfd  # 全局启用BFD
interface Eth-Trunk1
  bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 3
        3. 验证命令
| 功能 | 命令 | 
|---|---|
| OSPF邻居状态 | display ospf peer brief | 
| ECMP路由 | display ip routing-table verbose | 
| VXLAN隧道 | display vxlan tunnel | 
| EVPN对端 | display evpn peer | 
| M-LAG状态 | display m-lag brief | 
4. 注意事项(华为特定)
- License要求 :
- VXLAN/EVPN功能需激活对应License(如
L3VPN和VXLAN)。 
 - VXLAN/EVPN功能需激活对应License(如
 - 硬件兼容性 :
- CE6850/CE8850及以上型号支持完整VXLAN特性。
 
 - 配置同步 :
- M-LAG双机需通过
commit sync同步配置。 
 - M-LAG双机需通过
 - 堆叠冲突 :
- M-LAG与iStack/CSS堆叠不可同时启用。
 
 
5. 示例拓扑
+-------------+         +-------------+
|   Spine1    |---------|   Spine2    |
+-------------+         +-------------+
   |    \                 /    |
   |     \               /     |
   |      \             /      |
+-------------+     +-------------+
|   Leaf1     |-----|   Leaf2     |  (M-LAG Pair)
+-------------+     +-------------+
   ||                     ||
  服务器                 服务器(双归接入)
        提示:实际部署时需根据硬件型号和软件版本调整命令细节。建议使用华为iMaster NCE或eSight进行自动化编排。