防火墙之间通过IKE方式协商IPSec VPN隧道(采用预共享密钥认证)

版权声明:本文为博主-周列原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_38232749/article/details/82591895

扫描二维码关注公众号,回复: 3270832 查看本文章

附带防火墙配置相关指令及命令解释:

USG6000:
<FW_A>dis cu
!Software Version V500R001C10
#
sysname FW_A
#
acl number 3000
 rule 5 permit ip source 192.168.10.0 0.0.0.255 destination 10.10.12.0 0.0.0.255    \\0.0.0.255  反掩码形式编写
#
ipsec proposal suidao1    \\ipsec proposal +ipsec安全提议名称:创建IPSec安全提议 

\\transform { ah | ah-esp | esp }:配置使用的安全协议。缺省情况下,使用的安全协议是ESP。 AH(Authentication Header)协议,AH协议没有加密功能,只对报文进行认证。ESP(Encapsulating Security Payload)协议。ah-esp 先使用ESP协议对报文进行保护,再使用AH协议对报文进行保护。
 esp authentication-algorithm sha2-256  \\esp authentication-algorithm { md5 | sha1 | sha2-256 | sha2-384 | sha2-512 | sm3 }* :配置ESP协议使用的认证算法(缺省情况使用SHA2-256)。sm3认证算法受license限制,且只能在IKEv1协商过程中使用。
 esp encryption-algorithm aes-256   \\esp encryption-algorithm { des | 3des | aes-128 | aes-192 | aes-256 | sm4 }* :配置ESP协议使用的加密算法。sm4加密算法受license限制,且只能在IKEv1协商过程中使用。
\\补充:ah authentication-algorithm { md5 | sha1 | sha2-256 | sha2-384 | sha2-512 | sm3 }* :配置AH协议使用的认证算法。sm3认证算法受license限制,且只能在IKEv1协商过程中使用。
      \\补充:encapsulation-mode { transport | tunnel | auto } :配置报文IPSec的封装模式(传输、隧道、自适应)。
#
ike proposal 10    \\ike proposal+number 创建IKE安全提议,并进入IKE安全提议视图。数值越小,优先级越高。 补充:IKE对等体视图下执行ike-proposal命令引用该IKE安全提议
 encryption-algorithm aes-256   \\encryption-algorithm { des | 3des | aes-128 | aes-192 | aes-256 | sm4 }* :配置IKE安全提议的加密算法。sm4加密算法受license限制,且只能在IKEv1协商过程中使用。缺省为aes-256。
 dh group14  \\dh { group1 | group2 | group5 | group14 | group15 | group16 | group19 | group20 | group21 }* :配置IKE协商时所使用的DH(Diffie-Hellman)组。缺省时DH组为group2.
 authentication-algorithm sha2-256   \\authentication-algorithm { aes-xcbc-mac-96 | md5 | sha1 | sha2-256 | sha2-384 | sha2-512 | sm3 }* :配置IKV1协商IKE安全提议使用的认证算法。仅IKEv2版本支持AES-XCBC-MAC-96算法。sm3认证算法受license限制,且只能在IKEv1协商过程中使用。缺省时为sha2-256。 
 authentication-method pre-share  \\authentication-method { pre-share | rsa-signature | digital-envelope }(pre-shared key认证方法、RSA签名认证方法、RSA数字信封认证方法--在IKEV1主模式中支持且需license):配置IKE安全联盟协商时使用的认证方法。缺省为pre-shared key。
 integrity-algorithm hmac-sha2-256  \\integrity-algorithm { aes-xcbc-96 | hmac-md5-96 | hmac-sha1-96 | hmac-sha2-256 | hmac-sha2-384 | hmac-sha2-512 }* :配置IKEv2协商IKE安全提议使用的完整性算法。缺省时为hmac-sha2-256。
 prf hmac-sha2-256   \\prf { aes-xcbc-128 | hmac-md5 | hmac-sha1 | hmac-sha2-256 | hmac-sha2-384 | hmac-sha2-512 }* :配置IKEv2协商伪随机数产生函数的算法(简称prf算法)。缺省时为hmac-sha2-256。
    \\补充:sa duration seconds:sa duration命令用来配置IKE SA生存周期。
#
ike peer b  \\ike peer +peer-name :创建IKE对等体,并进入IKE对等体视图。  补充:ike-peer命令引用该IKE对等体
 pre-shared-key %@%@=|d|1pIRQX')3L+1{!d/:ZLY%@%@  \\ pre-shared-key :配置对等体IKE协商采用预共享密钥。前提:配置IKE对等体时,采用pre-shared key认证方法。 
 ike-proposal 10  \\引用IKE安全提议
 remote-address 24.69.8.54  \\remote-address { [ vpn-instance vpn-instance-name ] { start-ip-address [ end-ip-address ] | host-name host-name } | ip-pool pool-number | authentication-address start-ip-address [ end-ip-address ] }:来配置IKE协商时对端的IP地址/地址段或域名。
#
ipsec policy map1 10 isakmp   \\ipsec policy policy-name seq-number [ manual | isakmp [ template template-name ] ] (ISAKMP方式IPSec安全策略、manual 手工方式、引用IPSec安全策略模板创建策略模板方式IPSec安全策略):创建IPSec安全策略,并进入IPSec安全策略视图
 security acl 3000    \\引用安全规则
 ike-peer b         \\引用IKE对等体策略
 proposal suidao1   \\proposal+安全提议名称,引用已配置的IPSec安全提议。
#
interface GigabitEthernet0/0/0
 undo shutdown
 ip binding vpn-instance default    \\用来将当前接口与指定VPN实例进行绑定。
 ip address 192.168.0.1 255.255.255.0
 service-manage http permit
 service-manage https permit
 service-manage ping permit
 service-manage ssh permit
 service-manage snmp permit
 service-manage telnet permit
 service-manage netconf permit
#
interface GigabitEthernet1/0/0
 undo shutdown
#
interface GigabitEthernet1/0/1
 undo shutdown
 ip address 17.54.6.52 255.255.255.0
 ipsec policy map1   \\ipsec policy policy-name [ alone | master | slave ]  :应用ipse安全策略
#  
interface GigabitEthernet1/0/2
 undo shutdown
 ip address 192.168.10.1 255.255.255.0
 service-manage http permit
 service-manage https permit
 service-manage ping permit
 service-manage ssh permit
 service-manage snmp permit
 service-manage telnet permit
 service-manage netconf permit
#
firewall zone local
 set priority 100
#
firewall zone trust
 set priority 85
 add interface GigabitEthernet0/0/0
 add interface GigabitEthernet1/0/2
#
firewall zone untrust
 set priority 5
 add interface GigabitEthernet1/0/1
#
firewall zone dmz
 set priority 50
#
ip route-static 10.10.12.0 255.255.255.0 17.54.6.53
ip route-static 24.69.8.0 255.255.255.0 17.54.6.53
#
security-policy
 rule name trust_to_untrust
  source-zone trust
  destination-zone untrust
  source-address 192.168.10.0 24
  destination-address 10.10.12.0 24
  action permit
 rule name untrust_to_trust
  source-zone untrust
  destination-zone trust
  source-address 10.10.12.0 24
  destination-address 192.168.10.0 24
  action permit
 rule name local_to_untrust
  source-zone local
  destination-zone untrust
  source-address 17.54.6.52 32
  destination-address 24.69.8.54 32
  action permit
 rule name untrust_to_local
  source-zone untrust
  destination-zone local
  source-address 24.69.8.54 32
  destination-address 17.54.6.52 32
  action permit
#
return

ipsec安全提议相关命令
ipsec proposal +ipsec安全提议名称
transform
ah authentication-algorithm
esp authentication-algorithm
esp encryption-algorithm
encapsulation-mode
display ipsec proposal
proposal

IKE安全提议相关命令
ike proposal +number
encryption-algorithm
dh
authentication-algorithm
authentication-method
integrity-algorithm
prf

ike对等体命令
ike peer +peer-name

应用场景介绍
注:IPSec报文的封装就是讲AH或者ESP相关的字段插入到原始报文中,以实现对数据的认证和加密。
1、传输模式:不新增IP头,原始报文的源地址和目的地址就是安全隧道的端点。
2、隧道模式:新增IP头,新IP的源地址和目的地址就是安全隧道的2个端点的IP地址。

备注:参考USG6000防火墙指令

猜你喜欢

转载自blog.csdn.net/weixin_38232749/article/details/82591895