华为USG5300 采用IKE安全策略方式建立IPSec隧道

2024-04-13 05:38

本文主要是介绍华为USG5300 采用IKE安全策略方式建立IPSec隧道,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

组网需求:

如图所示,网络A和网络B分别通过USG5300 A和USG5300 B与Internet相连。网络环境描述如下:
网络A属于10.1.1.0/24子网,通过接口GigabitEthernet 0/0/0与USG5300 A连接。
网络B属于10.1.3.0/24子网,通过接口GigabitEthernet 0/0/0与USG5300 B连接。
USG5300 A和USG5300 B路由可达。Network A 可以ping通Network B

网络拓扑

操作步骤:

1、配置USG5300A

  • 配置接口IP地址
[SRG]sysname USGA
[USGA]interface GigabitEthernet 0/0/0
[USGA-GigabitEthernet0/0/0]ip address  10.1.1.1 24
[USGA-GigabitEthernet0/0/0]quit
[USGA]interface  GigabitEthernet  0/0/1
[USGA-GigabitEthernet0/0/1]ip address  192.13.2.1 24
[USGA-GigabitEthernet0/0/1]quit
  • 配置接口加入相应安全区域
[USGA]firewall zone  trust
[USGA-zone-trust]add  interface  GigabitEthernet  0/0/0
[USGA-zone-trust]quit 
[USGA]firewall zone  untrust
[USGA-zone-untrust]add  interface  GigabitEthernet  0/0/1
[USGA-zone-untrust]quit
  • 配置域间包过滤规则
[USGA]firewall packet-filter default permit  interzone  trust  untrust
[USGA]firewall packet-filter default permit  interzone  untrust local

既可以打开Trust域和Untrust域的域间缺省包过滤规则,也可以通过ACL定义包过滤规则。
配置Local域和Untrust域的域间缺省包过滤规则的目的为允许IPSec隧道两端设备通信,使其能够进行隧道协商。

  • 配置到达分支机构的静态路由,下一跳192.13.2.2
[USGA]ip route-static 0.0.0.0 0.0.0.0 192.13.2.2
  • 定义被保护的数据流
[USGA-acl-adv-3000]rule  permit ip source 10.1.1.0 0.0.0.255 destination 10.1.3.0 0.0.0.255

为了实现分支的互通,高级ACL的源地址(Source)定义为包括总部和分支的所有网段,目的地址(Destination)定义为各个分支的精确网段。

  • 配置名称为tran1的IPSec安全提议
[USGA]ipsec proposal tran1
[USGA-ipsec-proposal-tran1]encapsulation-mode tunnel
[USGA-ipsec-proposal-tran1]transform esp
[USGA-ipsec-proposal-tran1]esp authentication-algorithm  md5
[USGA-ipsec-proposal-tran1]esp encryption-algorithm des
[USGA-ipsec-proposal-tran1]quit

其中,ESP为默认的安全协议,Tunnel为默认的封装模式,可以不配置。MD5为ESP默认的认证算法,DES为ESP默认的加密算法,可以不配置。

  • 配置序号为10的IKE安全提议
[USGA]ike  proposal  10
[USGA-ike-proposal-10]authentication-method pre-share
[USGA-ike-proposal-10]authentication-algorithm sha1
[USGA-ike-proposal-10]quit

pre-shared-key验证方法为IKE默认的验证方法,SHA1为默认验证算法,可以不配置。

  • 配置IKE Peer
[USGA]ike  peer  b
[USGA-ike-peer-b]ike-proposal  10
[USGA-ike-peer-b]remote-address 131.108.5.2
[USGA-ike-peer-b]pre-shared-key abcde
[USGA-ike-peer-b]quit

USG5300同时开启IKEv1和IKEv2,缺省情况下采用IKEv2进行协商,若对端不支持IKEv2,请禁用IKEv2,采用IKEv1进行协商。请在IKE Peer视图下执行命令[ undo ] version { 1 | 2 }进行配置。
隧道对端IP地址分别为USG5300 B与Internet相连的接口的IP地址。
验证字的配置需要与对端设备相同

  • 配置IPSec安全策略组map1
[USGA]ipsec  policy map1 10 isakmp
[USGA-ipsec-policy-isakmp-map1-10]security  acl  3000
[USGA-ipsec-policy-isakmp-map1-10]proposal tran1
[USGA-ipsec-policy-isakmp-map1-10]ike-peer  b
[USGA-ipsec-policy-isakmp-map1-10]quit

在接口G0/0/1上应用安全策略组map1

[USGA]interface  GigabitEthernet  0/0/1
[USGA-GigabitEthernet0/0/1]ipsec  policy map1
[USGA-GigabitEthernet0/0/1]quit

2、配置USG5300B

  • 配置接口IP地址
[SRG]sysname USGB
[USGB]interface  GigabitEthernet  0/0/0
[USGB-GigabitEthernet0/0/0]ip address  10.1.3.1 24
[USGB-GigabitEthernet0/0/0]quit
[USGB]interface  GigabitEthernet  0/0/1
[USGB-GigabitEthernet0/0/1]ip address  131.108.5.2 24
[USGB-GigabitEthernet0/0/1]quit
  • 配置接口加入相应安全区域
[USGB]firewall zone  trust
[USGB-zone-trust]add  interface  GigabitEthernet  0/0/0
[USGB-zone-trust]quit
[USGB]firewall zone  untrust
[USGB-zone-untrust]add  interface  GigabitEthernet  0/0/1
[USGB-zone-untrust]quit
  • 配置域间包过滤规则
[USGB]firewall packet-filter  default  permit  interzone  trust  untrust
[USGB]firewall packet-filter  default  permit  interzone  untrust  local
  • 配置到达分支机构的静态路由,下一跳131.108.5.1
[USGB]ip route-static 0.0.0.0 0.0.0.0 131.108.5.1
  • 定义被保护的数据流
[USGB-acl-adv-3000]rule  permit  ip source 10.1.3.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
  • 配置名称为tran1的IPSec安全提议
[USGB]ipsec  proposal tran1
[USGB-ipsec-proposal-tran1]encapsulation-mode tunnel
[USGB-ipsec-proposal-tran1]transform esp
[USGB-ipsec-proposal-tran1]esp authentication-algorithm md5
[USGB-ipsec-proposal-tran1]esp encryption-algorithm des
[USGB-ipsec-proposal-tran1]quit
  • 配置序号为10的IKE安全提议
[USGB]ike proposal 10
[USGB-ike-proposal-10]authentication-method pre-share
[USGB-ike-proposal-10]authentication-algorithm sha1
[USGB-ike-proposal-10]quit
  • 配置IKE Peer
[USGB]ike peer  a
[USGB-ike-peer-a]ike-proposal  10
[USGB-ike-peer-a]remote-address 192.13.2.1
[USGB-ike-peer-a]pre-shared-key abcde
[USGB-ike-peer-a]quit
  • 配置IPSec安全策略组map1
[USGB]ipsec  policy map1 10 isakmp
[USGB-ipsec-policy-isakmp-map1-10]security  acl  3000
[USGB-ipsec-policy-isakmp-map1-10]proposal tran1	
[USGB-ipsec-policy-isakmp-map1-10]ike-peer a	
[USGB-ipsec-policy-isakmp-map1-10]quit
  • 在接口G0/0/1上应用安全策略组map1
[USGB]interface  GigabitEthernet  0/0/1
[USGB-GigabitEthernet0/0/1]ipsec  policy map1
[USGB-GigabitEthernet0/0/1]quit

3、配置ISP

<Huawei>system-view
[Huawei]sysname ISP
[ISP]interface  GigabitEthernet  0/0/0
[ISP-GigabitEthernet0/0/0]ip address  192.13.2.2 24
[ISP-GigabitEthernet0/0/0]quit
[ISP]interface  GigabitEthernet  0/0/1
[ISP-GigabitEthernet0/0/1]ip address  131.108.5.1 24
[ISP-GigabitEthernet0/0/1]quit[ISP]ip route-static 10.1.1.0 24 192.13.2.1
[ISP]ip route-static 10.1.3.0 24 131.108.5.2 

4、验证结果

  • USGA
<USGA>display  ike  sa
11:14:05  2019/03/17
current ike sa number: 2
-----------------------------------------------------------------------------
conn-id    peer                    flag          phase vpn
-----------------------------------------------------------------------------
40001      131.108.5.2             RD|ST         v2:2  public
1          131.108.5.2             RD|ST         v2:1  publicflag meaningRD--READY    ST--STAYALIVE  RL--REPLACED      FD--FADINGTO--TIMEOUT  TD--DELETING   NEG--NEGOTIATING  D--DPD<USGA>display  ipsec sa 
11:14:12  2019/03/17
===============================
Interface: GigabitEthernet0/0/1path MTU: 1500
===============================-----------------------------IPsec policy name: "map1"sequence number: 10mode: isakmpvpn: public-----------------------------connection id: 40001rule number: 5encapsulation mode: tunnelholding time: 0d 0h 0m 16stunnel local : 192.13.2.1    tunnel remote: 131.108.5.2flow      source: 10.1.1.0-10.1.1.255 0-65535 0flow destination: 10.1.3.0-10.1.3.255 0-65535 0[inbound ESP SAs] spi: 2200317640 (0x83262ec8)vpn: public  said: 0  cpuid: 0x0000proposal: ESP-ENCRYPT-DES ESP-AUTH-MD5sa remaining key duration (bytes/sec): 1887436680/3584max received sequence-number: 2udp encapsulation used for nat traversal: N[outbound ESP SAs] spi: 2376952271 (0x8dad69cf)vpn: public  said: 1  cpuid: 0x0000proposal: ESP-ENCRYPT-DES ESP-AUTH-MD5sa remaining key duration (bytes/sec): 1887436620/3584max sent sequence-number: 4udp encapsulation used for nat traversal: N
  • USGB
[USGB]display  ike sa 
11:15:32  2019/03/17
current ike sa number: 2
-----------------------------------------------------------------------------
conn-id    peer                    flag          phase vpn
-----------------------------------------------------------------------------
40001      192.13.2.1              RD            v2:2  public
1          192.13.2.1              RD            v2:1  publicflag meaningRD--READY    ST--STAYALIVE  RL--REPLACED      FD--FADINGTO--TIMEOUT  TD--DELETING   NEG--NEGOTIATING  D--DPD[USGB]display  ipsec  sa 
11:15:37  2019/03/17
===============================
Interface: GigabitEthernet0/0/1path MTU: 1500
===============================-----------------------------IPsec policy name: "map1"sequence number: 10mode: isakmpvpn: public-----------------------------connection id: 40001rule number: 5encapsulation mode: tunnelholding time: 0d 0h 1m 40stunnel local : 131.108.5.2    tunnel remote: 192.13.2.1flow      source: 10.1.3.0-10.1.3.255 0-65535 0flow destination: 10.1.1.0-10.1.1.255 0-65535 0[inbound ESP SAs] spi: 2376952271 (0x8dad69cf)vpn: public  said: 0  cpuid: 0x0000proposal: ESP-ENCRYPT-DES ESP-AUTH-MD5sa remaining key duration (bytes/sec): 1887436620/3500max received sequence-number: 3udp encapsulation used for nat traversal: N[outbound ESP SAs] spi: 2200317640 (0x83262ec8)vpn: public  said: 1  cpuid: 0x0000proposal: ESP-ENCRYPT-DES ESP-AUTH-MD5sa remaining key duration (bytes/sec): 1887436680/3500max sent sequence-number: 3udp encapsulation used for nat traversal: N

 

这篇关于华为USG5300 采用IKE安全策略方式建立IPSec隧道的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/899270

相关文章

SpringBoot多环境配置数据读取方式

《SpringBoot多环境配置数据读取方式》SpringBoot通过环境隔离机制,支持properties/yaml/yml多格式配置,结合@Value、Environment和@Configura... 目录一、多环境配置的核心思路二、3种配置文件格式详解2.1 properties格式(传统格式)1.

Oracle数据库定时备份脚本方式(Linux)

《Oracle数据库定时备份脚本方式(Linux)》文章介绍Oracle数据库自动备份方案,包含主机备份传输与备机解压导入流程,强调需提前全量删除原库数据避免报错,并需配置无密传输、定时任务及验证脚本... 目录说明主机脚本备机上自动导库脚本整个自动备份oracle数据库的过程(建议全程用root用户)总结

Debian系和Redhat系防火墙配置方式

《Debian系和Redhat系防火墙配置方式》文章对比了Debian系UFW和Redhat系Firewalld防火墙的安装、启用禁用、端口管理、规则查看及注意事项,强调SSH端口需开放、规则持久化,... 目录Debian系UFW防火墙1. 安装2. 启用与禁用3. 基本命令4. 注意事项5. 示例配置R

最新Spring Security的基于内存用户认证方式

《最新SpringSecurity的基于内存用户认证方式》本文讲解SpringSecurity内存认证配置,适用于开发、测试等场景,通过代码创建用户及权限管理,支持密码加密,虽简单但不持久化,生产环... 目录1. 前言2. 因何选择内存认证?3. 基础配置实战❶ 创建Spring Security配置文件

Python获取浏览器Cookies的四种方式小结

《Python获取浏览器Cookies的四种方式小结》在进行Web应用程序测试和开发时,获取浏览器Cookies是一项重要任务,本文我们介绍四种用Python获取浏览器Cookies的方式,具有一定的... 目录什么是 Cookie?1.使用Selenium库获取浏览器Cookies2.使用浏览器开发者工具

Java获取当前时间String类型和Date类型方式

《Java获取当前时间String类型和Date类型方式》:本文主要介绍Java获取当前时间String类型和Date类型方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录Java获取当前时间String和Date类型String类型和Date类型输出结果总结Java获取

C#监听txt文档获取新数据方式

《C#监听txt文档获取新数据方式》文章介绍通过监听txt文件获取最新数据,并实现开机自启动、禁用窗口关闭按钮、阻止Ctrl+C中断及防止程序退出等功能,代码整合于主函数中,供参考学习... 目录前言一、监听txt文档增加数据二、其他功能1. 设置开机自启动2. 禁止控制台窗口关闭按钮3. 阻止Ctrl +

linux批量替换文件内容的实现方式

《linux批量替换文件内容的实现方式》本文总结了Linux中批量替换文件内容的几种方法,包括使用sed替换文件夹内所有文件、单个文件内容及逐行字符串,强调使用反引号和绝对路径,并分享个人经验供参考... 目录一、linux批量替换文件内容 二、替换文件内所有匹配的字符串 三、替换每一行中全部str1为st

Python实现终端清屏的几种方式详解

《Python实现终端清屏的几种方式详解》在使用Python进行终端交互式编程时,我们经常需要清空当前终端屏幕的内容,本文为大家整理了几种常见的实现方法,有需要的小伙伴可以参考下... 目录方法一:使用 `os` 模块调用系统命令方法二:使用 `subprocess` 模块执行命令方法三:打印多个换行符模拟

RabbitMQ消息总线方式刷新配置服务全过程

《RabbitMQ消息总线方式刷新配置服务全过程》SpringCloudBus通过消息总线与MQ实现微服务配置统一刷新,结合GitWebhooks自动触发更新,避免手动重启,提升效率与可靠性,适用于配... 目录前言介绍环境准备代码示例测试验证总结前言介绍在微服务架构中,为了更方便的向微服务实例广播消息,