v3防火墙和v7防火墙ipsec对接主模式都是固定ip.docx
《v3防火墙和v7防火墙ipsec对接主模式都是固定ip.docx》由会员分享,可在线阅读,更多相关《v3防火墙和v7防火墙ipsec对接主模式都是固定ip.docx(8页珍藏版)》请在冰豆网上搜索。
v3防火墙和v7防火墙ipsec对接主模式都是固定ip
V3防火墙和v7防火墙ipsec对接-主模式
功能需求:
·防火墙A和防火墙B之间建立一个ipsec隧道,对HostA所在的子网(192.168.5.1)与HostB所在的子网(192.168.7.1)之间的数据流进行安全保护。
·防火墙A和防火墙B之间采用IKE协商方式建立IPsecSA。
·使用IKE主模式进行协商,防火墙A向防火墙B发起方隧道触发
·使用缺省的预共享密钥认证方法。
此案例适用于:
两边都是固定ip,中间公网ip不经过nat设备的组网。
组网信息及描述:
此案例中,以防火墙A的loopback0口代表A设备的内网hostA,以防火墙B的loopback0口代表B设备的内网hostB,A设备的E1/1作为连接外网的接口,ip:
1.1.1.1。
B设备的G1/0/1口作为连接外网的接口,ip:
2.2.2.1。
loopback口代表各自的内网。
1.1.1.1和2.2.2.1作为公网ip能相互通信
配置步骤:
防火墙A
配置接口的ip,路由,安全域等基本配置
定义要保护由子网192.168.5.0/24去往子网192.168.7.0/24的数据流。
aclnumber3001
rule1permitipsource192.168.5.00.0.0.255destination192.168.7.00.0.0.255
配置nat转换的流,拒绝ipsec保护的流
aclnumber3000
rule0denyipsource192.168.5.00.0.0.255destination192.168.7.00.0.0.255
rule1permitip
配置外网接口ip
interfaceEthernet1/1
ipaddress1.1.1.1255.255.255.0
natoutbound3000
配置内网接口
interfaceLoopBack0
ipaddress192.168.5.1255.255.255.255
配置去上外网的路由,1.1.1.2是E1/1公网接口的网关ip
iproute-static0.0.0.00.0.0.01.1.1.2
使用的接口加入安全域,loopback除外
firewallzoneuntrust
addinterfaceEthernet1/1
firewallpacket-filterenable
firewallpacket-filterdefaultpermit
ike提议参数,需要和对方B设备的ike提议参数一致
指定IKE提议使用的认证算法为md5,加密算法3des-cbc
ikeproposal1
encryption-algorithm3des-cbc
authentication-algorithmmd5
配置ike对等体名称v3,默认主模式,默认使用ip进行双方身份验证,remote-address的ip需要和对端B设备ikeprofile中local-identity的ip一致,反之,local-address的ip是对端的matchremoteidentityaddress的ip。
,使用admin密码为域共享密码,和对方设备一致即可,
ikepeerv3
pre-shared-keycipheradmin
remote-address2.2.2.1
local-address1.1.1.1
配置ipsec的安全提议,保持和B设备配置的安全提议一致
配置安全协议对IP报文的封装形式为隧道模式,默认采用的安全协议为ESP,配置ESP协议采用的加密算法为3DES,默认认证算法为md5。
ipsecproposal1
espencryption-algorithm3des
配置ipsec策略,名称为v3序列号为1,引用ike对等体v3,引用acl3001,引用ipsec安全提议1
ipsecpolicyv31isakmp
securityacl3001
ike-peerv3
proposal1
proposal1外网接口上引用ipsec策略
interfaceEthernet1/1
ipsecpolicyv3
防火墙B配置
配置接口的ip,路由,安全域等基本配置
定义要保护由子网192.168.7.0/24去往子网192.168.5.0/24的数据流。
acladvanced3001
rule5permitipsource192.168.7.00.0.0.255destination192.168.5.00.0.0.255
配置nat转换的流,拒绝ipsec保护的流
acladvanced3333
rule0denyipsource192.168.7.00.0.0.255destination192.168.5.00.0.0.255
rule5permitip
配置外网接口ip
interfaceGigabitEthernet1/0/1
portlink-moderoute
ipaddress2.2.2.1255.255.255.0
natoutbound3333
配置内网接口
interfaceLoopBack0
ipaddress192.168.7.1255.255.255.255
配置去上外网的路由,2.2.2.2是外网接口的网关ip
iproute-static0.0.0.002.2.2.2
接口加入安全域及放通安全域。
V7防火墙的域间规则默认都是禁止的,本实验放通域间所有流量为例子,具体的域间规则,请以实际的需求为准。
security-zonenameTrust
importinterfaceLoopBack0
security-zonenameUntrust
importinterfaceGigabitEthernet1/0/1
acladvanced3000
rule0permitip
zone-pairsecuritysourceAnydestinationAny
packet-filter3000
#
zone-pairsecuritysourceAnydestinationLocal
packet-filter3000
#
zone-pairsecuritysourceLocaldestinationAny
packet-filter3000
ike提议参数,需要和对方A设备的ike提议参数一致
指定IKE提议使用的认证算法为md5,加密算法3des-cbc
ikeproposal1
encryption-algorithm3des-cbc
authentication-algorithmmd5
配置和对方1.1.1.1建立vpn时使用ike域共享密码。
使用admin,和对方设备一致即可
ikekeychain1
pre-shared-keyaddress1.1.1.1255.255.255.0keysimpleadmin
配置ike对等体名称v7,默认主模式,使用ip进行双方身份验证,matchremoteidentityaddress的ip需要和对端A设备ike对等体中local-address的ip一致,反之,local-identityaddress是对端的remote-address的ip。
使用admin密码为域共享密码,和对方设备一致即可,
ikeprofilev7
keychain1
local-identityaddress2.2.2.1
matchremoteidentityaddress1.1.1.1255.255.255.0
proposal1
配置ipsec的安全提议,保持和A设备配置的安全提议一致
配置安全协议对IP报文的封装形式为隧道模式,默认采用的安全协议为ESP,配置ESP协议采用的加密算法为3DES,认证算法为md5。
ipsectransform-set1
espencryption-algorithm3des-cbc
espauthentication-algorithmmd5
配置ipsec策略,名称为-v7序列号为1,引用ike对等体v7,引用acl3001,引用ipsec安全提议1,配置好本端和对端的隧道地址
ipsecpolicyv71isakmp
transform-set1
securityacl3001
local-address2.2.2.1
remote-address1.1.1.1
ike-profilev7
外网接口上引用ipsec策略
interfaceGigabitEthernet1/0/1
ipsecapplypolicyv7
配置结果:
A设备作为发起方能促发ipsec的sa
内网之间能通过ipsecvpn相互通信
ping-a192.168.5.1192.168.7.1
PING192.168.7.1:
56databytes,pressCTRL_Ctobreak
Requesttimeout
Replyfrom192.168.7.1:
bytes=56Sequence=2ttl=255time=4ms
Replyfrom192.168.7.1:
bytes=56Sequence=3ttl=255time=3ms
Replyfrom192.168.7.1:
bytes=56Sequence=4ttl=255time=3ms
查看ikesa的信息,
disikesa对方的公网ip:
2.2.2.1
TotalIKEphase-1SAs:
1
connection-idpeerflagphasedoi
----------------------------------------------------------
82.2.2.1RD|ST2IPSEC
72.2.2.1RD|ST1IPSEC
disipsesa
===============================
Interface:
Ethernet1/1外网接口上运用的ipsec策略
pathMTU:
1500
===============================
-----------------------------
IPsecpolicyname:
"v3"
sequencenumber:
1
mode:
isakmp
-----------------------------
Createdby:
"Host"
connectionid:
4
encapsulationmode:
tunnel隧道模式
perfectforwardsecrecy:
None
tunnel:
隧道两端的公网ip
localaddress:
1.1.1.1
remoteaddress:
2.2.2.1
flow:
(8timesmatched)感兴趣流,也就是两个设备内网的网段
souraddr:
192.168.5.0/255.255.255.0port:
0protocol:
IP
destaddr:
192.168.7.0/255.255.255.0port:
0protocol:
IP
[inboundESPSAs]
spi:
2100388483(0x7d316283)
proposal:
ESP-ENCRYPT-3DESESP-AUTH-MD5
sakeyduration(bytes/sec):
1887436800/3600
saremainingkeyduration(bytes/sec):
1887436464/3594
maxreceivedsequence-number:
4
udpencapsulationusedfornattraversal:
N
[outboundESPSAs]ipsecsa使用的加密和验证算法,sa的时间周期
spi:
251853497(0xf02fab9)
proposal:
ESP-ENCRYPT-3DESESP-AUTH-MD5
sakeyduration(bytes/sec):
1887436800/3600
saremainingkeyduration(bytes/sec):
1887436464/3594
缺省情况下,IPsecSA基于时间的生存时间为3600秒,基于流量的生存时间为1887436464字节
maxsentsequence-number:
5
udpencapsulationusedfornattraversal:
N
配置关键点及注意事项:
1防火墙需要把接口加入安全域,在V7防火墙默认的域间规则情况下都是禁止放通的,需要放通,内网到外网的域间策略,外网到内网的域间策略,local到外网的域间策略,外网到local的域间策略。
V3防火墙只需要把使用的外网和内网接口加入安全域就可以
2两台VPN网关设备公网ip之间路由可达,中间不能经过nat设备,因为ike主模式不支持nat穿越
3两台vpn网关设备使用的ike和ipsec的安全提议对必须保持一致,v7过如下命令可以查看参数是否一致,如下
disikeproposal
PriorityAuthenticationAuthenticationEncryptionDiffie-HellmanDuration
methodalgorithmalgorithmgroup(seconds)
----------------------------------------------------------------------------
1PRE-SHARED-KEYMD53DES-CBCGroup186400
defaultPRE-SHARED-KEYSHA1DES-CBCGroup186400
disipsetra
disipsetransform-set
IPsectransformset:
1
State:
complete
Encapsulationmode:
tunnel
ESN:
Disabled
PFS:
Transform:
ESP
ESPprotocol:
Integrity:
MD5
Encryption:
3DES-CBC
V3设备提供如下命令查看参数是否一致,如下
[H3C]disikeproposal
priorityauthenticationauthenticationencryptionDiffie-Hellmanduration
methodalgorithmalgorithmgroup(seconds)
---------------------------------------------------------------------------
1PRE_SHAREDMD53DES_CBCMODP_76886400
defaultPRE_SHAREDSHADES_CBCMODP_76886400
[H3C]disipseproposal
IPsecproposalname:
1
encapsulationmode:
tunnel
transform:
esp-new
ESPprotocol:
authenticationmd5-hmac-96,encryption3des
4如果需要IKE对等体存活状态检测,可以开启keepalive或者dpd功能时,两端需要同时配置,参数需要配置一致