• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

分支机构通过总部防火墙统一出口访问互联网

3小时前提问
  • 0关注
  • 0收藏,59浏览
零段
粉丝:0人 关注:0人

问题描述:

分支机构的F1020防火墙通过与总部的F1060防火墙建立IPsec VPN隧道,然后统一访问互联网,两台防火墙怎么配置。

3 个回答
粉丝:18人 关注:2人

分支 F1020 + 总部 F1060 IPSec VPN(分支流量走总部统一上网)完整配置
组网逻辑
分支内网 → 分支 F1020 → IPSec 隧道 → 总部 F1060 → 总部 NAT 上网 → 互联网
隧道承载:分支全部内网流量(全流量 VPN,包括上网流量)
网段规划示例(可替换为现场实际网段)
分支内网:192.168.2.0/24
总部内网:192.168.1.0/24
分支公网接口 G0:203.0.113.10(F1020 公网 IP)
总部公网接口 G0:203.0.113.1(F1060 公网 IP)
一、总部防火墙 F1060 完整配置
1. 基础接口与安全域
bash
运行
system-view
# 公网接口(对接运营商)
interface GigabitEthernet 0
port link-mode route
nat outbound
ip address 203.0.113.1 255.255.255.0
security-zone Internet

# 内网接口(总部局域网)
interface GigabitEthernet 1
port link-mode route
ip address 192.168.1.1 255.255.255.0
security-zone Trust

# 安全域放行基础策略
security-zone Trust
import route-static
security-zone Internet
import route-static
2. IKE 协商(预共享密钥认证)
bash
运行
# 1. 创建IKE提议
ike proposal 10
encryption-algorithm aes-256
authentication-algorithm sha2-256
dh group14

# 2. IKE对等体(对端分支公网IP)
ike peer branch pre-shared-key simple Test@123456
ike-proposal 10
remote-ip 203.0.113.10

# 3. IPSec提议
ipsec proposal 10
esp encryption-algorithm aes-256
esp authentication-algorithm sha2-256

# 4. IPSec策略模板(接收分支主动发起隧道)
ipsec policy-template temp1 10
proposal 10
remote-peer ike-peer branch
security acl 3000

# 5. IPSec策略绑定模板
ipsec policy map1 10 isakmp template temp1

# 6. 公网接口绑定IPSec策略
interface GigabitEthernet 0
ipsec apply policy map1
3. ACL:定义隧道流量(分支所有网段)
bash
运行
acl number 3000
rule permit ip source any destination any
# 含义:匹配分支所有流量(内网互访+上网流量全部进隧道)
4. 核心:分支流量总部 NAT 上网(VPN 流量出公网做源地址转换)
bash
运行
# 地址池,总部出口公网地址池
nat address-group 1 203.0.113.1 203.0.113.1
# 策略:隧道过来的分支流量访问互联网时做NAT
acl number 3001
rule permit ip source 192.168.2.0 0.0.0.255 destination any
nat policy
create rule 10 permit source 192.168.2.0 0.0.0.255 destination any nat address-group 1
5. 安全策略放行
bash
运行
security-policy
# 1. 允许VPN隧道流量访问互联网
rule 10 permit source 192.168.2.0 0.0.0.255 destination any zone Internet
# 2. 允许总部内网与分支内网互访(按需)
rule 20 permit source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255 zone Trust
# 3. 放行IKE/ESP VPN协议(公网接口)
rule 99 permit protocol udp destination-port 500 zone Internet local
rule 100 permit protocol udp destination-port 4500 zone Internet local
rule 101 permit protocol esp zone Internet local
6. 静态路由:分支网段路由指向隧道
bash
运行
ip route-static 192.168.2.0 255.255.255.0 ipsec-map map1
二、分支机构防火墙 F1020 完整配置
1. 接口与安全域
bash
运行
system-view
# 公网接口
interface GigabitEthernet 0
port link-mode route
ip address 203.0.113.10 255.255.255.0
security-zone Internet

# 内网接口(分支局域网)
interface GigabitEthernet 1
port link-mode route
ip address 192.168.2.1 255.255.255.0
security-zone Trust
2. IKE + IPSec 协商配置(主动发起隧道)
bash
运行
# IKE提议(和总部一致)
ike proposal 10
encryption-algorithm aes-256
authentication-algorithm sha2-256
dh group14

# IKE对等体,指定总部公网IP
ike peer headquarters pre-shared-key simple Test@123456
ike-proposal 10
remote-ip 203.0.113.1

# IPSec提议(和总部一致)
ipsec proposal 10
esp encryption-algorithm aes-256
esp authentication-algorithm sha2-256

# IPSec策略
ipsec policy map1 10 isakmp
proposal 10
remote-peer ike-peer headquarters
security acl 3000

# 公网接口绑定策略
interface GigabitEthernet 0
ipsec apply policy map1
3. ACL:匹配分支全部内网流量进入 VPN 隧道
bash
运行
acl number 3000
rule permit ip source 192.168.2.0 0.0.0.255 destination any
# 所有分支流量(访问总部内网、访问互联网)全部封装进IPSec隧道
4. 路由:全流量转发至 VPN 隧道(关键实现总部统一出口)
bash
运行
# 默认路由全部走IPSec隧道,所有流量发给总部处理
ip route-static 0.0.0.0 0 ipsec-map map1
5. 安全策略放行
bash
运行
security-policy
# 内网所有流量允许进入VPN隧道
rule 10 permit source 192.168.2.0 0.0.0.255 destination any zone Internet
# 放行VPN协商协议
rule 99 permit protocol udp destination-port 500 zone Internet local
rule 100 permit protocol udp destination-port 4500 zone Internet local
rule 101 permit protocol esp zone Internet local
6. 分支本地无需 NAT!
所有上网流量封装到隧道后,在总部防火墙统一做 NAT 转换,分支不需要配置互联网 NAT 策略。
三、验证与排错命令
1. 隧道状态查看
bash
运行
display ike sa
display ipsec sa
成功建立会显示 ESTABLISHED 状态。
2. 路由验证
bash
运行
display ip routing-table
# 分支存在默认路由指向ipsec-map;总部存在分支明细路由指向ipsec-map
3. 流量抓包排查
bash
运行
debugging ipsec packet
debugging ike packet
terminal debugging
terminal monitor
四、关键注意点
密钥、加密算法、DH 组两端必须完全一致,否则 IKE 协商失败;
分支默认路由指向 IPSec 隧道是实现「总部统一出口上网」的核心;
总部必须对分支网段配置 NAT 地址池,否则分支流量出互联网无公网地址;
两端公网防火墙 / 运营商不得拦截 UDP500、UDP4500、ESP 协议;
若分支公网为 DHCP 动态 IP:总部 IPSec 策略模板无需写固定 remote-ip,适配动态分支。

粉丝:11人 关注:9人

总部F1060配置步骤:
1. 配置接口:

interface GigabitEthernet0/0 // 互联网出口
ip address 202.xx.xx.xx 255.255.255.0
interface GigabitEthernet0/1 // 与分支VPN互联接口
ip address 10.0.0.1 255.255.255.0

2. 配置IPsec策略模板:

ipsec policy-template 10 100
esp encryption-algorithm aes-256
esp authentication-algorithm sha1
ike-peer branch // 分支IKE对等体

3. 配置IKE对等体:

ike peer branch
pre-shared-key simple secret123 // 预共享密钥
remote-address 10.0.0.2 // 分支VPN互联接口IP

4. 配置IPsec策略:

ipsec policy map1 10 isakmp
template 10
security acl 3000 // 匹配分支访问互联网流量
interface GigabitEthernet0/1
ipsec apply policy map1

5. 配置ACL:

acl number 3000
rule permit ip source 192.168.1.0 0.0.0.255 destination any // 分支网段

6. 配置NAT:

nat address-group 1 202.xx.xx.xx 202.xx.xx.xx // 出口公网IP
acl number 2000
rule permit source 192.168.1.0 0.0.0.255
interface GigabitEthernet0/0
nat outbound 2000 address-group 1

7. 配置静态路由:

ip route-static 192.168.1.0 255.255.255.0 10.0.0.2 // 指向分支

分支F1020配置步骤:
1. 配置接口:
interface GigabitEthernet0/0 // 与总部VPN互联接口
ip address 10.0.0.2 255.255.

粉丝:132人 关注:11人

参考案例:

功能需求:

1、分支通过ipsec vpn访问内网资源

2、分支通过ipsec vpn到总部来访问外网


配置步骤

(1)     总部配置
#
interface GigabitEthernet0/0
 port link-mode route
 combo enable copper
 ip address 1.1.1.1 255.255.255.0
 nat outbound 3001
 ipsec apply policy map1
#
interface GigabitEthernet0/2
 port link-mode route
 combo enable copper
 ip address 192.168.1.1 255.255.255.0
#
 ip route-static 0.0.0.0 0 1.1.1.2
#
acl advanced 3000
 rule 0 permit ip destination 192.168.2.0 0.0.0.255

#
acl advanced 3001
 rule 0 deny ip destination 192.168.2.0 0.0.0.255
 rule 10 permit ip
#
ipsec transform-set tran1
 esp encryption-algorithm aes-cbc-128
 esp authentication-algorithm sha1
#
ipsec policy map1 10 isakmp
 transform-set tran1
 security acl 3000
 local-address 1.1.1.1
 remote-address 2.2.2.2
 ike-profile profile1
#
ike profile profile1
 keychain keychain1
 match remote identity address 2.2.2.2 255.255.255.0
#
ike keychain keychain1
 pre-shared-key address 2.2.2.2 255.255.255.0 key cipher $c$3$OZlydjTJAKne46C3JSeRRzaQBQODJw==
#
return

(2)分支配置

#

interface GigabitEthernet0/1
 port link-mode route
 combo enable copper
 ip address 2.2.2.2 255.255.255.0
 ipsec apply policy use1
#
interface GigabitEthernet0/2
 port link-mode route
 combo enable copper
 ip address 192.168.2.1 255.255.255.0
#

 ip route-static 0.0.0.0 0 2.2.2.1
#
acl advanced 3000
 rule 0 permit ip source 192.168.2.0 0.0.0.255

#
ipsec transform-set tran1
 esp encryption-algorithm aes-cbc-128
 esp authentication-algorithm sha1
#
ipsec policy use1 10 isakmp
 transform-set tran1
 security acl 3000
 local-address 2.2.2.2
 remote-address 1.1.1.1
 ike-profile profile1
#
ike profile profile1
 keychain keychain1
 match remote identity address 1.1.1.1 255.255.255.0
#
ike keychain keychain1
 pre-shared-key address 1.1.1.1 255.255.255.0 key cipher $c$3$P/Rehq/mlfZ30RSn8GlrWYPY7EM9LA==
#
return

配置关键点

(1)分支感兴趣流只匹配源地址为本端私网地址,目的地址为any;总部感兴趣流只匹配目的地址为对端私网地址,源地址为any;

(2)总部nat中调用的acl注意先把ipsec感兴趣流deny掉。

你好,我现在是遇到省市县三层机构集中到省级机关同意一个互联网出口的情况,省级是F1060,市级是F1020,县级是华为的USG 6525E防火墙,目前按照你的方法实现了市级到省级的统一出口,但是未能实现县级到省级的统一。

发表时间:19分钟前 更多>>

你好,我现在是遇到省市县三层机构集中到省级机关同意一个互联网出口的情况,省级是F1060,市级是F1020,县级是华为的USG 6525E防火墙,目前按照你的方法实现了市级到省级的统一出口,但是未能实现县级到省级的统一。

发表时间:19分钟前

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明