项目实战:企业网络出口部署与SSL-VPN远程接入

一、 项目背景与需求分析

针对公司新办公区网络建设及员工居家办公需求,我负责主导了网络出口的部署与远程接入方案设计与实施。项目主要面临以下几个核心需求:

  1. 办公网上网需求:新办公区百余台终端需要稳定、安全地共享访问互联网。
  2. 内网服务发布:公司内部署了核心业务服务器,需要对公网提供特定端口的访问,同时保障内网安全。
  3. 远程安全协作:出差员工与居家办公人员需要随时安全、加密地访问内网敏感资源,提升跨域协作效率。

为此,我们在企业网络边界部署了企业级防火墙,通过划分安全域、配置源NAT策略、NAT Server以及SSL-VPN网关来满足上述需求。

二、 实验环境与拓扑规划

  • 核心设备:企业级防火墙(作为出口网关)、三层核心交换机、内网业务服务器。
  • 网络接口与安全域规划
    • 外网口 (Untrust):连接运营商公网,配置固定公网 IP 202.100.1.10/24,网关指向 202.100.1.1
    • 内网口 (Trust):连接核心交换机,负责办公终端接入,IP 规划为 192.168.10.254/24
    • 服务器区 (DMZ):连接内网核心服务器,IP 规划为 10.10.10.254/24,服务器实际 IP 为 10.10.10.10
    • SSL-VPN 虚拟地址池:为拨入员工分配独立网段 10.250.250.0/24

三、 详细部署与实施步骤(全流程详解)

步骤 1:防火墙初始化与基础系统配置

在设备上架并完成物理连线后,首先需要通过 Console 线缆进行设备的初始化配置,包括修改设备名称、配置时区时间、设置管理密码等基础工作,为后续配置打下规范基础。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 1. 通过Console线登录防火墙命令行控制台
<FW> system-view
# 修改设备主机名,便于在多台设备中快速识别
[FW] sysname Gateway_FW

# 2. 配置系统时区和时间(这对日志审计和VPN证书时间校验至关重要)
[Gateway_FW] clock timezone Beijing add 08:00:00
[Gateway_FW] clock datetime 10:00:00 2026-04-06

# 3. 开启Web管理服务(HTTPS)并配置管理员
[Gateway_FW] web-manager enable
[Gateway_FW] aaa
[Gateway_FW-aaa] manager-user admin
[Gateway_FW-aaa-manager-user-admin] password cipher Admin@Strong2026
[Gateway_FW-aaa-manager-user-admin] service-type web terminal
[Gateway_FW-aaa-manager-user-admin] level 15
[Gateway_FW-aaa-manager-user-admin] quit
[Gateway_FW-aaa] quit

步骤 2:外网接口配置与 Untrust 安全域绑定

配置连接运营商公网的接口,分配固定公网 IP,并将其加入 Untrust 区域。这一步是打通网络出口的第一关。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 1. 进入连接外网ISP的物理接口
[Gateway_FW] interface GigabitEthernet 1/0/1
# 添加接口描述,注明是对接哪家运营商(如电信)
[Gateway_FW-GigabitEthernet1/0/1] description To_Internet_ChinaTelecom
# 配置静态公网IP地址和子网掩码(由运营商提供)
[Gateway_FW-GigabitEthernet1/0/1] ip address 202.100.1.10 255.255.255.0
# 开启接口的Ping响应服务,方便后期排查公网连通性故障
[Gateway_FW-GigabitEthernet1/0/1] service-manage ping permit
# 开启HTTPS管理权限(如果需要允许外网远程管理防火墙,谨慎开启)
[Gateway_FW-GigabitEthernet1/0/1] service-manage https permit
[Gateway_FW-GigabitEthernet1/0/1] quit

# 2. 将接口绑定到代表不信任外网的 Untrust 安全域
[Gateway_FW] security-zone name Untrust
[Gateway_FW-security-zone-Untrust] import interface GigabitEthernet 1/0/1
[Gateway_FW-security-zone-Untrust] quit

# 3. 配置默认路由,将所有未知流量转发给运营商网关
[Gateway_FW] ip route-static 0.0.0.0 0.0.0.0 202.100.1.1

# 4. 测试公网连通性
[Gateway_FW] ping 8.8.8.8
# 预期结果:收到 Reply 响应,说明外网线路正常

步骤 3:内网与DMZ接口配置及安全域划分

内网被划分为办公终端所在的 Trust 区域,以及核心业务服务器所在的 DMZ(隔离区)区域,以实现精细化控制。

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
# 1. 配置连接内网核心交换机的接口 (Trust区域)
[Gateway_FW] interface GigabitEthernet 1/0/2
[Gateway_FW-GigabitEthernet1/0/2] description To_Core_Switch_VLANs
# 配置内网互联IP
[Gateway_FW-GigabitEthernet1/0/2] ip address 192.168.10.254 255.255.255.0
[Gateway_FW-GigabitEthernet1/0/2] service-manage ping permit
[Gateway_FW-GigabitEthernet1/0/2] quit

# 2. 将接口加入 Trust 安全域
[Gateway_FW] security-zone name Trust
[Gateway_FW-security-zone-Trust] import interface GigabitEthernet 1/0/2
[Gateway_FW-security-zone-Trust] quit

# 3. 配置内网回程路由(指引防火墙将回包发给核心交换机)
# 假设核心交换机下挂了 192.168.0.0/16 整个内网网段,下一跳为核心交换机互联IP(假设为192.168.10.1)
[Gateway_FW] ip route-static 192.168.0.0 255.255.0.0 192.168.10.1

# 4. 配置连接服务器的接口 (DMZ区域)
[Gateway_FW] interface GigabitEthernet 1/0/3
[Gateway_FW-GigabitEthernet1/0/3] description To_Server_Farm_DMZ
[Gateway_FW-GigabitEthernet1/0/3] ip address 10.10.10.254 255.255.255.0
[Gateway_FW-GigabitEthernet1/0/3] service-manage ping permit
[Gateway_FW-GigabitEthernet1/0/3] quit

# 5. 将接口加入 DMZ 安全域
[Gateway_FW] security-zone name DMZ
[Gateway_FW-security-zone-DMZ] import interface GigabitEthernet 1/0/3
[Gateway_FW-security-zone-DMZ] quit

步骤 4:部署源 NAT 策略与安全策略(实现百台终端共享上网)

为了让内网百余台终端能够访问互联网,必须配置地址转换策略(Easy IP),并明确放行从 Trust 到 Untrust 的安全策略。

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
# 1. 配置安全策略,放行办公网访问互联网的流量
[Gateway_FW] security-policy
[Gateway_FW-policy-security] rule name Trust_To_Internet_Allow
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] description "Allow Office Users to Access Internet"
# 指定流量的源安全区域为 Trust
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] source-zone Trust
# 指定流量的目的安全区域为 Untrust
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] destination-zone Untrust
# 限制仅允许特定的办公网段上网(增强安全性)
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] source-address 192.168.0.0 16
# 动作允许
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] action permit
[Gateway_FW-policy-security-rule-Trust_To_Internet_Allow] quit
[Gateway_FW-policy-security] quit

# 2. 配置源 NAT 策略(PAT/Easy IP)
[Gateway_FW] nat-policy
[Gateway_FW-policy-nat] rule name SNAT_Internet
# 匹配从 Trust 发往 Untrust 的流量
[Gateway_FW-policy-nat-rule-SNAT_Internet] source-zone Trust
[Gateway_FW-policy-nat-rule-SNAT_Internet] destination-zone Untrust
# 仅对内网源IP进行转换
[Gateway_FW-policy-nat-rule-SNAT_Internet] source-address 192.168.0.0 16
# 动作设置为 Easy-IP,将源IP转换为外网出接口(GE1/0/1)的公网IP,同时转换端口
[Gateway_FW-policy-nat-rule-SNAT_Internet] action source-nat easy-ip
[Gateway_FW-policy-nat-rule-SNAT_Internet] quit

# 3. 验证 NAT 效果
# 在内网终端 Ping 8.8.8.8,并在防火墙查看会话表
[Gateway_FW] display firewall session table source inside 192.168.x.x
# 确认是否成功建立了 NAT 映射会话

步骤 5:部署 NAT Server(内网服务公网安全发布)

公司内网核心服务器(10.10.10.10)需要对外提供 Web 服务(内部端口 80),为隐藏真实端口保障安全,我们在公网接口映射为 8080 端口。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 1. 配置 NAT Server 端口映射规则
# 外部用户访问公网IP 202.100.1.10 的 TCP 8080 端口时,防火墙将其目的IP转换为 10.10.10.10,端口转换为 80
[Gateway_FW] nat server Web_Publish protocol tcp global 202.100.1.10 8080 inside 10.10.10.10 80

# 2. 配置针对发布服务的严格安全策略
# 注意:在华为/启明等防火墙架构中,对于目的NAT,安全策略的目的地址通常要写**转换后的真实内网IP**
[Gateway_FW] security-policy
[Gateway_FW-policy-security] rule name Untrust_To_DMZ_Web
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] description "Publish Internal Web Server"
# 源区域为 Untrust (公网)
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] source-zone Untrust
# 目的区域为 DMZ (服务器所在区域)
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] destination-zone DMZ
# 目标地址限制为服务器的单主机真实IP
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] destination-address 10.10.10.10 32
# 仅放行目标为 HTTP (TCP 80) 的服务,禁止其他任何多余端口的探测
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] service http
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] action permit
[Gateway_FW-policy-security-rule-Untrust_To_DMZ_Web] quit

步骤 6:企业级 SSL-VPN 网关部署与网络扩展

这是满足出差和居家员工安全远程接入的核心配置环节,包含网关创建、地址池分配、路由下发及AAA认证。

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
# 1. 开启并配置 SSL-VPN 虚拟网关
[Gateway_FW] v-gateway sslvpn_gw
# 绑定外部接入接口 GE1/0/1
[Gateway_FW-v-gateway-sslvpn_gw] interface GigabitEthernet 1/0/1
# 全局启用该 SSL-VPN 网关服务
[Gateway_FW-v-gateway-sslvpn_gw] ssl-vpn enable

# 2. 配置网络扩展 (Network Extension)
# 开启网络扩展功能,允许客户端生成虚拟网卡
[Gateway_FW-v-gateway-sslvpn_gw] network-extension enable
# 设置分配给 VPN 客户端的独立虚拟 IP 池,避免与现有内网冲突
[Gateway_FW-v-gateway-sslvpn_gw] network-extension address-pool 10.250.250.1 10.250.250.254 mask 255.255.255.0
# 下发允许客户端访问的内网路由。客户端拨入后,本地路由表会增加指向这些网段的路由
[Gateway_FW-v-gateway-sslvpn_gw] network-extension route 192.168.0.0 16
[Gateway_FW-v-gateway-sslvpn_gw] network-extension route 10.10.10.0 24
[Gateway_FW-v-gateway-sslvpn_gw] quit

# 3. 创建 VPN 拨入用户及角色授权
[Gateway_FW] aaa
# 创建专用的 VPN 角色,绑定刚才建立的 SSL-VPN 网关
[Gateway_FW-aaa] role vpn_role
[Gateway_FW-aaa-role-vpn_role] v-gateway sslvpn_gw
[Gateway_FW-aaa-role-vpn_role] quit
# 创建远程拨入用户,并设置高强度不可逆密码
[Gateway_FW-aaa] local-user remote_user password irreversible-cipher Admin@2026!
# 授权该用户服务类型为 SSL-VPN,并绑定角色
[Gateway_FW-aaa] local-user remote_user service-type ssl-vpn
[Gateway_FW-aaa] local-user remote_user role vpn_role
[Gateway_FW-aaa] quit

# 4. 放行 SSL-VPN 相关的安全策略(至关重要)
[Gateway_FW] security-policy
# 策略A:允许外网主机访问防火墙自身的 HTTPS(443) 端口,用于建立 SSL-VPN 隧道连接
[Gateway_FW-policy-security] rule name Allow_SSLVPN_Tunnel_Establish
[Gateway_FW-policy-security-rule-Allow_SSLVPN_Tunnel_Establish] source-zone Untrust
# 目标区域为 Local(代表防火墙设备本身)
[Gateway_FW-policy-security-rule-Allow_SSLVPN_Tunnel_Establish] destination-zone Local
[Gateway_FW-policy-security-rule-Allow_SSLVPN_Tunnel_Establish] service https
[Gateway_FW-policy-security-rule-Allow_SSLVPN_Tunnel_Establish] action permit
[Gateway_FW-policy-security-rule-Allow_SSLVPN_Tunnel_Establish] quit

# 策略B:允许拨入成功、获取了虚拟 IP 的 VPN 用户,访问内网 Trust 和 DMZ 区域
[Gateway_FW-policy-security] rule name VPN_To_Internal_Access
# 指定源地址为刚才分配的 VPN 虚拟地址池网段
[Gateway_FW-policy-security-rule-VPN_To_Internal_Access] source-address 10.250.250.0 24
# 允许访问目标区域
[Gateway_FW-policy-security-rule-VPN_To_Internal_Access] destination-zone Trust DMZ
[Gateway_FW-policy-security-rule-VPN_To_Internal_Access] action permit
[Gateway_FW-policy-security-rule-VPN_To_Internal_Access] quit
[Gateway_FW-policy-security] quit

# 5. 验证 SSL-VPN 拨入
# 运维人员在外网PC浏览器访问 https://202.100.1.10
# 登录后下载 SecoClient 客户端并连接。
# 连接成功后,在 PC 执行 ipconfig 查看是否获取到 10.250.250.x 的 IP,并尝试 Ping 10.10.10.10 测试内网连通性。

四、 项目上线与成效总结

项目按计划顺利上线,经过各业务部门的实际测试与运行反馈:

  1. 基础网络稳定:百余台终端成功实现了源 NAT 共享上网,日常办公网络稳定无卡顿。
  2. 核心业务安全暴露:通过 NAT Server 与精准的安全策略控制,内网核心服务器既向公网提供了必要的服务支持,又免受了非授权的恶意探测扫描。
  3. 远程协作无缝衔接:出差员工与居家办公人员能够通过客户端顺利拨入 SSL-VPN,获取 10.250.250.x 的虚拟 IP,随时安全、加密地访问内网资源。

通过本次网络出口重构与安全网关的引入,企业的跨域协作效率得到了大幅提升,整体网络安全防线更加坚固。