跨厂商(华为 & H3C)防火墙 GRE 隧道部署

实验介绍

组网需求

企业总部与分部分别以华为防火墙(GNS3 USG6000V)、H3C 防火墙(GNS3 H3CvFW)作为网关接入 Internet,现需在二者间搭建 GRE 隧道,以实现 192.168.10.0/24(总部内网)与 192.168.20.0/24(分部内网)的安全互通。

组网拓扑

数据规划

项目 数据 描述
USG6000V 接口配置 接口号:GigabitEthernet 1/0/0
IP地址:100.64.10.1/24
安全区域:Untrust
接口号:GigabitEthernet 1/0/1
IP地址:192.168.10.1/24
安全区域:Trust
GRE配置 接口名称:Tunnel
IP地址:172.16.1.1/24
源地址:100.64.10.1/24
目的地址:100.64.20.1/24
隧道识别关键字:123456
H3CvFW 接口配置 接口号:GigabitEthernet 2/0
IP地址:100.64.20.1/24
安全区域:Untrust
接口号:GigabitEthernet 1/0/2
IP地址:192.168.20.1/24
安全区域:Trust
GRE配置 接口名称:Tunnel
IP地址:172.16.1.2/24
源地址:100.64.20.1/24
目的地址:100.64.10.1/24
隧道识别关键字:123456

配置思路

配置 Internet 路由器

① 仅需配置接口的 IP 地址,模拟 Internet 两端互联。

配置防火墙

① 配置接口的 IP 地址,并将接口加入安全区域。

② 在 USG6000V 和 H3CvFW 上分别创建一个 Tunnel 接口。在 Tunnel 接口中指定隧道的源 IP 地址和目的 IP 等封装参数。

③ 配置静态路由,将出接口指定为本设备的 Tunnel 接口。该路由的作用是将需要经过 GRE 隧道传输的流量引入到 GRE 隧道中。

④ 配置安全策略,允许 GRE 隧道的建立和流量的转发。

实验步骤

应用部署

在 Hi168 云平台部署 GNS3 应用并打开 GNS3 应用,完成拓扑图搭建。

具体操作参考下方文章。

文章链接:Hi168 云平台 GNS3 自助使用手册

GNS3 中拓扑绘制

打开 GNS3 应用,在工作区拖入一台 Huawei USG6000V 防火墙、一台 H3C vFW1000、一台 AR 路由器(模拟 Internet)、两台 PC 终端设备,按照组网拓扑,搭建基础网络拓扑环境。

配置模拟 Internet

配置 G0/0/0 接口。

bash 复制代码
[Internet]interface GigabitEthernet 0/0/0
[Internet-GigabitEthernet0/0/0]ip address 100.64.20.2 24
[Internet-GigabitEthernet0/0/0]quit

配置 G0/0/1 接口。

bash 复制代码
[Internet]interface GigabitEthernet 0/0/1	
[Internet-GigabitEthernet0/0/1]ip address 100.64.10.2 24
[Internet-GigabitEthernet0/0/1]quit

查看接口的 IP 配置。

bash 复制代码
[Internet]display ip interface brief

配置 H3CvFW 防火墙

配置接口,并将接口加入安全区域

配置 G2/0 接口,并将接口加入 Untrust 安全区域。

bash 复制代码
[H3C]interface GigabitEthernet 2/0
[H3C-GigabitEthernet2/0]ip address 100.64.20.1 24
[H3C-GigabitEthernet2/0]quit 
[H3C]security-zone name Untrust 
[H3C-security-zone-Untrust]import interface GigabitEthernet 2/0
[H3C-security-zone-Untrust]quit

配置 G3/0 接口,并将接口加入 Trust 安全区域。

bash 复制代码
[H3C]interface GigabitEthernet 3/0
[H3C-GigabitEthernet3/0]ip address 192.168.20.1 24
[H3C-GigabitEthernet3/0]quit
[H3C]security-zone name Trust
[H3C-security-zone-Trust]import interface GigabitEthernet 3/0
[H3C-security-zone-Trust]quit

配置 Tunnel0 接口,并将接口加入 Untrust 安全区域。

bash 复制代码
[H3C]interface Tunnel 0 mode gre
[H3C-Tunnel0]ip address 172.16.1.2 24
[H3C-Tunnel0]source 100.64.20.1
[H3C-Tunnel0]destination 100.64.10.1
[H3C-Tunnel0]quit
[H3C]security-zone name Untrust 
[H3C-security-zone-Untrust]import interface Tunnel 0
[H3C-security-zone-Untrust]quit

查看接口的 IP 配置。

bash 复制代码
[H3C]display ip interface brief

查看安全区域配置。

bash 复制代码
[H3C]display security-zone
配置域间安全策略

配置 Trust 域和 Untrust 的域间安全策略

bash 复制代码
[H3C]security-policy ip
[H3C-security-policy-ip]rule 1 name trust_untrust
[H3C-security-policy-ip-1-trust_untrust]action pass
[H3C-security-policy-ip-1-trust_untrust]source-zone trust
[H3C-security-policy-ip-1-trust_untrust]source-zone untrust
[H3C-security-policy-ip-1-trust_untrust]destination-zone trust
[H3C-security-policy-ip-1-trust_untrust]destination-zone untrust

配置 Local 和 Untrust 的域间安全策略,允许封装后的 GRE 报文通过域间安全策略。

bash 复制代码
[H3C-security-policy-ip]rule name local_untrust
[H3C-security-policy-ip-0-local_untrust]action pass
[H3C-security-policy-ip-0-local_untrust]source-zone local
[H3C-security-policy-ip-0-local_untrust]source-zone untrust
[H3C-security-policy-ip-0-local_untrust]destination-zone local
[H3C-security-policy-ip-0-local_untrust]destination-zone untrust
[H3C-security-policy-ip-0-local_untrust]service gre
[H3C-security-policy-ip-0-local_untrust]quit
配置路由

配置连接到 Internet 的缺省路由,下一跳为 100.64.20.2 并将需要经过 GRE 隧道传输的流量引入到 GRE 隧道中。

bash 复制代码
[H3C]ip route-static 0.0.0.0 0 100.64.20.2
[H3C]ip route-static 192.168.10.0 24 Tunnel 0

配置 USG6000V 防火墙

配置接口,并将接口加入安全区域

配置口 GE1/0/0 接口,并将接口加入 untrust 安全区域。

bash 复制代码
[USG6000V1]interface GigabitEthernet 1/0/0
[USG6000V1-GigabitEthernet1/0/0]ip address 100.64.10.1 24
[USG6000V1-GigabitEthernet1/0/0]quit 
[USG6000V1]firewall zone untrust 
[USG6000V1-zone-untrust]add interface GigabitEthernet 1/0/0
[USG6000V1-zone-untrust]quit 

配置 GE1/0/1 接口,并将接口加入 trust 安全区域。

bash 复制代码
[USG6000V1]interface GigabitEthernet 1/0/1	
[USG6000V1-GigabitEthernet1/0/1]ip address 192.168.10.1 24
[USG6000V1-GigabitEthernet1/0/1]quit 
[USG6000V1]firewall zone trust 
[USG6000V1-zone-trust]add interface GigabitEthernet 1/0/1
[USG6000V1-zone-trust]quit

配置 Tunnel1 接口,并将接口加入 dmz 安全区域。

bash 复制代码
[USG6000V1]interface Tunnel 1
[USG6000V1-Tunnel1]ip address 172.16.1.1 24
[USG6000V1-Tunnel1]quit
[USG6000V1]firewall zone dmz
[USG6000V1-zone-dmz]add interface Tunnel 1
[USG6000V1-zone-dmz]quit

查看接口的IP配置。

bash 复制代码
[USG6000V1]display ip interface brief

查看安全区域配置。

bash 复制代码
[USG6000V1]display zone
配置路由

配置连接到 Internet 的缺省路由,下一跳为 100.64.10.2 并将需要经过 GRE 隧道传输的流量引入到 GRE 隧道中。

bash 复制代码
[USG6000V1]ip route-static 0.0.0.0 0 100.64.10.2
[USG6000V1]ip route-static 192.168.20.0 24 Tunnel1
配置 Tunnel 接口的封装参数
bash 复制代码
[USG6000V1]interface Tunnel 1
[USG6000V1-Tunnel1]tunnel-protocol gre
[USG6000V1-Tunnel1]source 100.64.10.1
[USG6000V1-Tunnel1]destination 100.64.20.1
[USG6000V1-Tunnel1]gre key 123456
[USG6000V1-Tunnel1]quit
配置域间安全策略

配置 Trust 域和 DMZ 的域间安全策略,允许封装前的报文通过域间安全策略。

bash 复制代码
[USG6000V1]security-policy
[USG6000V1-policy-security]rule name 1
[USG6000V1-policy-security-rule-1]source-zone trust dmz
[USG6000V1-policy-security-rule-1]destination-zone dmz trust
[USG6000V1-policy-security-rule-1]action permit
[USG6000V1-policy-security-rule-1]quit

配置 Local 和 Untrust 的域间安全策略,允许封装后的 GRE 报文通过域间安全策略。

bash 复制代码
[USG6000V1-policy-security]rule name 2
[USG6000V1-policy-security-rule-2]source-zone local untrust
[USG6000V1-policy-security-rule-2]destination-zone untrust local
[USG6000V1-policy-security-rule-2]service gre
[USG6000V1-policy-security-rule-2]action permit
[USG6000V1-policy-security-rule-2]quit

配置 PC

配置总部的PC1。

配置分部的PC2。

结果验证

在 PC1 中 ping 分部中的 PC2。

在 PC1 中 ping 总部中的 PC2。

相关推荐
2301_7807896610 小时前
DDoS 攻击溯源:DNS 水印标记 + 区块链存证的双保险
运维·服务器·网络·云原生·ddos
less_1213810 小时前
HarmonyOS WPS Open SDK:打开时配置水印与修订模式
华为·harmonyos·wps
2601_9494999415 小时前
芯瑞科技 DT-1414 光模块工程实测:完美兼容博通(安华高) HFBR-1414PTZ,VCSEL 替代方案
大数据·网络·人工智能·科技·光模块
云边云科技_云网融合16 小时前
连锁门店 POS、监控、IoT 设备网络不稳定怎么解决?
网络·物联网
小雨青年17 小时前
【HarmonyOS 7 沉浸光感深度实战】 03 五档 ImmersiveStyle 到底怎么选
华为·harmonyos
XR12345678817 小时前
学校宿舍区网络方案对比:多终端高并发下的认证、管理与体验
网络
March.s17 小时前
IP 存储核心 iSCSI:原理拆解 + 无报错实战指南
网络·网络协议·tcp/ip
星恒讯工业路由器18 小时前
远程访问技术解析:从内网穿透到安全隧道的三种主流方案
网络·信息与通信·内网穿透·远程访问·vpn隧道
超智算科技18 小时前
超智算领衔协办“NVIDIA创业企业展示·西安站”,全栈AI服务赋能行业生态协同发展
大数据·网络·人工智能·物联网·百度
云端漫步198718 小时前
HarmonyOS NEXT AI 智能生活助手:性能优化
华为·性能优化·生活·harmonyos