SD-WAN(软件定义广域网)正在重塑企业网络架构,通过集中控制、智能选路和应用感知等技术,实现广域网的灵活部署和高效运维。本文将深入讲解SD-WAN的核心技术原理、架构设计和华为SD-WAN解决方案的实战部署。

项目背景:本文整理自我在制造业/零售业两个SD-WAN项目的实施笔记,里面穿插了一些现场调试和甲方沟通时踩的坑,力求比说明书更接地气。

一、SD-WAN技术概述

1.1 传统WAN vs SD-WAN

对比维度 传统WAN SD-WAN
架构模式 分布式配置 集中控制+分布式转发
链路类型 MPLS专线为主 混合链路(MPLS+Internet)
部署周期 数周到数月 数小时到数天
运维方式 设备级CLI配置 图形化集中管理
成本结构 高带宽成本 灵活的成本优化
应用感知 基于端口/协议 深度应用识别
故障切换 分钟级 秒级/亚秒级

1.2 SD-WAN核心架构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
┌─────────────────────────────────────────────────────────────────┐
│ SD-WAN 三层架构 │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ 管理平面 (Management Plane) │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ 网络编排 │ │ 策略管理 │ │ 监控分析 │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ 控制平面 (Control Plane) │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ 拓扑发现 │ │ 路由计算 │ │ 策略下发 │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ 转发平面 (Data Plane) │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ CPE设备 │ │ Overlay │ │ 智能选路 │ │ │
│ │ │ │ │ 隧道 │ │ │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

1.3 关键技术组件

组件 功能 技术实现
Orchestrator 网络编排与管理 REST API、Web GUI
Controller 集中控制与策略 SDN控制器、NETCONF
CPE/Edge 边缘转发设备 vCPE、uCPE、物理CPE
Overlay 虚拟网络隧道 IPsec、GRE、VXLAN
Underlay 底层传输网络 MPLS、Internet、LTE

二、SD-WAN核心技术

2.1 Overlay网络技术

IPsec隧道配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 华为SD-WAN CPE IPsec配置示例

# 创建IKE提议
ike proposal 10
encryption-algorithm aes-256
dh group14
authentication-algorithm sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256

# 创建IKE对等体
ike peer sdwan-hub
undo version 1
pre-shared-key cipher %^%#encrypted_key%^%#
ike-proposal 10
remote-address 203.0.113.1

# 创建IPsec提议
ipsec proposal sdwan-prop
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256

# 创建IPsec策略
ipsec policy sdwan-policy 10 isakmp
security acl 3000
ike-peer sdwan-hub
proposal sdwan-prop
pfs dh-group14

# 应用到接口
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
ipsec policy sdwan-policy

2.2 智能选路技术

SD-WAN的核心价值在于智能选路,基于应用SLA要求动态选择最优路径:

SLA探测配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 配置SLA探测
nqa test-instance admin sdwan-probe
test-type icmp
destination-address ipv4 10.0.0.1
frequency 5
probe-count 3
start now

# 配置SLA策略
sla-policy voice-sla
delay-threshold 150
jitter-threshold 30
packet-loss-threshold 1

sla-policy video-sla
delay-threshold 200
jitter-threshold 50
packet-loss-threshold 2

sla-policy data-sla
delay-threshold 500
jitter-threshold 100
packet-loss-threshold 5

# 配置应用识别
traffic classifier voice-traffic
if-match acl 3001

traffic classifier video-traffic
if-match acl 3002

traffic classifier data-traffic
if-match acl 3003

# 配置流量行为
traffic behavior voice-behavior
redirect ip-nexthop 10.0.0.1
sla-policy voice-sla

traffic behavior video-behavior
redirect ip-nexthop 10.0.0.2
sla-policy video-sla

# 配置流量策略
traffic policy sdwan-policy
classifier voice-traffic behavior voice-behavior
classifier video-traffic behavior video-behavior
classifier data-traffic behavior data-behavior

2.3 应用感知技术

DPI应用识别
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 启用应用识别引擎
application-identification enable

# 配置应用组
application-group office365
application ms-office365
application ms-teams
application ms-sharepoint
application ms-onedrive

application-group video-conference
application zoom
application webex
application teams-video

application-group erp-system
application sap
application oracle-erp

# 配置应用策略
traffic classifier office365-traffic
if-match application-group office365

traffic classifier video-traffic
if-match application-group video-conference

# 应用优先级配置
qos car office365-traffic cir 100000 pir 200000 cbs 12500 pbs 25000 green pass yellow pass red discard
qos car video-traffic cir 50000 pir 100000 cbs 6250 pbs 12500 green pass yellow pass red discard

2.4 实战调优建议

  1. 模板分级:总部、分支、云端的策略模板不要混在一个配置里,尤其是ACL编号和服务类目,拆分后巡检效率高很多。
  2. 链路标签:在控制器侧给每条传输链路打上“成本/时延/抖动”等标签,便于后续自动选路策略直接引用而非写死IP。
  3. 应用识别回溯:DPI识别库更新后要安排专门的回归测试,我碰到过一次升级导致ERP错判为视频流,直接压垮了MPLS。
  4. MTU与ACL联动案例:某零售客户门店VPN偶发抖动,追踪后发现运营商侧MPLS子接口被临时降到1400且ACL遗漏ICMP,IPsec重传狂飙。解决方案是两端同步调MTU并放通ICMP探测,抖动瞬间消失。

三、企业SD-WAN架构设计

3.1 典型企业拓扑

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
                    ┌─────────────────┐
│ SD-WAN │
│ Controller │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐
│ 数据中心 │ │ 数据中心 │ │ 云平台 │
│ Hub-1 │ │ Hub-2 │ │ (AWS/Azure) │
│ (主) │ │ (备) │ │ │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
│ MPLS专线 │ Internet │
│ ┌───────────────┼───────────────┐ │
│ │ │ │ │
┌───────▼────▼───┐ ┌───────▼───────┐ ┌──▼────▼───────┐
│ 分支机构-1 │ │ 分支机构-2 │ │ 分支机构-3 │
│ (大型) │ │ (中型) │ │ (小型) │
│ 双CPE冗余 │ │ 单CPE双链路 │ │ 单CPE单链路 │
└────────────────┘ └───────────────┘ └───────────────┘

调研心得:画拓扑图时别忘了把云厂商或第三方SaaS算进来,很多企业是“数据中心+云+边缘工厂”三栖部署,链路优先级和安全策略完全不同。

3.2 Hub站点配置

Hub站点核心配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Hub站点 - 核心交换机配置
<Hub-Core-SW>system-view
[Hub-Core-SW]sysname Hub-Core-SW

# VLAN规划
[Hub-Core-SW]vlan batch 10 20 30 100 200
[Hub-Core-SW]vlan 10
description Management
[Hub-Core-SW]vlan 20
description Server-Farm
[Hub-Core-SW]vlan 30
description DMZ
[Hub-Core-SW]vlan 100
description WAN-MPLS
[Hub-Core-SW]vlan 200
description WAN-Internet

# 三层接口配置
[Hub-Core-SW]interface Vlanif10
ip address 10.0.10.1 255.255.255.0
[Hub-Core-SW]interface Vlanif20
ip address 10.0.20.1 255.255.255.0
[Hub-Core-SW]interface Vlanif30
ip address 10.0.30.1 255.255.255.0

# 连接SD-WAN CPE
[Hub-Core-SW]interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 200

# Hub站点 - SD-WAN CPE配置
<Hub-CPE>system-view
[Hub-CPE]sysname Hub-CPE

# WAN接口配置
[Hub-CPE]interface GigabitEthernet0/0/0
description To-MPLS-PE
ip address 203.0.113.2 255.255.255.252

[Hub-CPE]interface GigabitEthernet0/0/1
description To-Internet
ip address 198.51.100.2 255.255.255.252
nat outbound

# LAN接口配置
[Hub-CPE]interface GigabitEthernet0/0/2
description To-Core-SW
port link-type trunk
port trunk allow-pass vlan all

# SD-WAN控制器注册
[Hub-CPE]sdwan
controller-ip 10.0.10.100
device-id Hub-CPE-01
site-id 1
role hub

# Overlay隧道配置
[Hub-CPE]interface Tunnel0
description SDWAN-Overlay-MPLS
tunnel-protocol gre
source GigabitEthernet0/0/0
gre key 100

[Hub-CPE]interface Tunnel1
description SDWAN-Overlay-Internet
tunnel-protocol ipsec
source GigabitEthernet0/0/1
ipsec policy sdwan-policy

3.3 分支站点配置

分支站点CPE配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 分支站点 - SD-WAN CPE配置
<Branch-CPE>system-view
[Branch-CPE]sysname Branch-CPE-SH

# WAN接口配置 - 双链路
[Branch-CPE]interface GigabitEthernet0/0/0
description Primary-MPLS
ip address dhcp-alloc

[Branch-CPE]interface GigabitEthernet0/0/1
description Backup-Internet
ip address dhcp-alloc
nat outbound

# LAN接口配置
[Branch-CPE]interface GigabitEthernet0/0/2
description To-LAN-Switch
ip address 192.168.1.1 255.255.255.0

# DHCP服务
[Branch-CPE]dhcp enable
[Branch-CPE]ip pool branch-pool
gateway-list 192.168.1.1
network 192.168.1.0 mask 255.255.255.0
excluded-ip-address 192.168.1.1 192.168.1.10
dns-list 8.8.8.8 114.114.114.114
lease day 7

[Branch-CPE]interface GigabitEthernet0/0/2
dhcp select global

# SD-WAN注册
[Branch-CPE]sdwan
controller-ip 10.0.10.100
device-id Branch-CPE-SH
site-id 10
role spoke

# 零配置部署 (ZTP)
[Branch-CPE]ztp enable
dhcp-option 43 ascii "controller=10.0.10.100;site=10"

# Overlay隧道自动建立
[Branch-CPE]sdwan overlay
hub-site 1
transport mpls priority 1
transport internet priority 2
failover-threshold 3

分支经验:ZTP虽然省事,但建议提前在总部把CPE序列号、站点ID维护在表里,不然零配置上线时很容易混淆,尤其是多个省份同时部署的时候。

四、高级特性配置

4.1 多链路负载均衡

链路负载均衡策略
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 配置链路权重
[CPE]sdwan link-group primary
member interface GigabitEthernet0/0/0 weight 70
member interface GigabitEthernet0/0/1 weight 30

# 配置负载均衡策略
[CPE]sdwan load-balance
mode per-flow
hash-algorithm five-tuple

# 基于应用的链路选择
[CPE]sdwan application-route
application-group office365
preferred-link mpls
backup-link internet
sla-class gold

application-group video-conference
preferred-link internet
backup-link mpls
sla-class silver
bandwidth-reservation 30

application-group bulk-data
link-selection round-robin
sla-class bronze

4.2 QoS策略配置

端到端QoS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 定义QoS类
[CPE]qos queue-profile sdwan-qos
queue 0 scheduling wfq weight 10
queue 1 scheduling wfq weight 20
queue 2 scheduling wfq weight 30
queue 3 scheduling wfq weight 40
queue 5 scheduling pq

# 流量分类
[CPE]traffic classifier voice operator or
if-match dscp ef
if-match acl 3001

[CPE]traffic classifier video operator or
if-match dscp af41
if-match acl 3002

[CPE]traffic classifier critical-data operator or
if-match dscp af31
if-match acl 3003

# 流量行为
[CPE]traffic behavior voice-qos
remark dscp ef
queue ef bandwidth pct 20

[CPE]traffic behavior video-qos
remark dscp af41
queue af4 bandwidth pct 30

[CPE]traffic behavior data-qos
remark dscp af31
queue af3 bandwidth pct 25

# 应用策略
[CPE]traffic policy sdwan-qos-policy
classifier voice behavior voice-qos
classifier video behavior video-qos
classifier critical-data behavior data-qos

[CPE]interface GigabitEthernet0/0/0
traffic-policy sdwan-qos-policy outbound

4.3 安全策略配置

分支安全策略
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 启用防火墙功能
[CPE]firewall zone trust
add interface GigabitEthernet0/0/2

[CPE]firewall zone untrust
add interface GigabitEthernet0/0/0
add interface GigabitEthernet0/0/1

# 安全策略
[CPE]security-policy
rule name allow-outbound
source-zone trust
destination-zone untrust
action permit

rule name allow-sdwan
source-zone untrust
destination-zone local
destination-port 4500 500
action permit

rule name deny-inbound
source-zone untrust
destination-zone trust
action deny
logging enable

# URL过滤
[CPE]url-filter profile branch-filter
category gambling action deny
category malware action deny
category phishing action deny

# 入侵防御
[CPE]ips profile branch-ips
signature-set default
action block-source
severity high action block
severity medium action alert

4.4 云互联配置

云平台对接
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# AWS Direct Connect / Azure ExpressRoute 对接
[Hub-CPE]interface GigabitEthernet0/0/3
description To-Cloud-Gateway
ip address 169.254.100.1 255.255.255.252

# BGP配置 - 与云平台对接
[Hub-CPE]bgp 65001
peer 169.254.100.2 as-number 64512
peer 169.254.100.2 description AWS-VGW

ipv4-family unicast
peer 169.254.100.2 enable
network 10.0.0.0 255.255.0.0
import-route direct

# SD-WAN云网关配置
[Hub-CPE]sdwan cloud-gateway
provider aws
region ap-northeast-1
vpc-id vpc-12345678
tunnel-type ipsec
auto-scaling enable

4.5 现场排障经验

  • 链路打通先看Underlay:很多故障并不是Overlay脚本写错,而是运营商侧MPLS子接口没开或MTU被改。我习惯先抓原生接口报文再去调IPsec。
  • 混合链路回退策略:Internet与MPLS切换时记得同步更新NAT、策略路由。如果只调Overlay,业务流量会被老策略截断。
  • 云互联日志:对接AWS/Azure时可以把云端Flow Log拉回SOC,方便定位是否到达云网关,尤其是跨区部署时非常好用。

五、监控与运维

5.1 链路质量监控

监控配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 配置链路探测
[CPE]nqa test-instance admin link-monitor-mpls
test-type icmp
destination-address ipv4 10.0.10.1
source-interface GigabitEthernet0/0/0
frequency 10
probe-count 5
start now

[CPE]nqa test-instance admin link-monitor-internet
test-type icmp
destination-address ipv4 8.8.8.8
source-interface GigabitEthernet0/0/1
frequency 10
probe-count 5
start now

# 配置SNMP监控
[CPE]snmp-agent
snmp-agent sys-info version v3
snmp-agent target-host trap address udp-domain 10.0.10.200 params securityname admin v3 privacy

# 配置Syslog
[CPE]info-center loghost 10.0.10.201 facility local7

# 配置NetFlow
[CPE]netstream
netstream sampler fix-packets 1000
netstream export source 10.0.10.1
netstream export host 10.0.10.202 9996

[CPE]interface GigabitEthernet0/0/0
netstream inbound
netstream outbound

5.2 故障排查命令

常用排查命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 查看SD-WAN状态
display sdwan status
display sdwan controller connection
display sdwan overlay tunnel all
display sdwan site all

# 查看链路状态
display interface brief
display nqa results
display sdwan link quality

# 查看路由信息
display ip routing-table
display sdwan route all
display bgp routing-table

# 查看隧道状态
display ipsec sa
display tunnel interface
display gre tunnel

# 查看应用识别
display application statistics
display traffic policy statistics

# 查看QoS统计
display qos queue statistics interface GigabitEthernet0/0/0
display traffic-policy statistics interface GigabitEthernet0/0/0

# 调试命令
debugging sdwan all
debugging ipsec all
terminal monitor

六、最佳实践

6.1 设计原则

原则 说明
冗余设计 Hub站点双CPE,关键分支双链路
分层架构 区分Hub/Spoke角色,合理规划站点层级
安全优先 端到端加密,分段隔离,最小权限
弹性扩展 预留带宽,支持动态扩容
简化运维 模板化配置,自动化部署

6.2 部署检查清单

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
□ 网络规划
□ IP地址规划完成
□ VLAN规划完成
□ 站点角色定义
□ 链路带宽评估

□ 安全配置
□ IPsec策略配置
□ 防火墙规则配置
□ 访问控制列表
□ 证书/密钥管理

□ QoS配置
□ 应用识别规则
□ 流量分类策略
□ 带宽分配策略
□ SLA阈值设置

□ 监控配置
□ SNMP配置
□ Syslog配置
□ NetFlow配置
□ 告警阈值设置

□ 测试验证
□ 隧道连通性测试
□ 故障切换测试
□ 应用性能测试
□ 安全策略验证

七、总结

SD-WAN通过软件定义的方式重新定义了企业广域网,带来了更高的灵活性、更低的成本和更好的用户体验。成功部署SD-WAN需要:

  1. 深入理解业务需求:明确应用优先级和SLA要求
  2. 合理的架构设计:根据企业规模选择合适的拓扑
  3. 完善的安全策略:端到端加密和访问控制
  4. 持续的监控优化:基于数据驱动的网络优化

SD-WAN不仅是技术升级,更是网络运维模式的转变,从设备级管理向业务级管理演进。