ip 华三secondary_H3c-IPsec vpn(两端都是固定ip地址)

ipsec vpn

描述:本端公网地址:1.1.1.1 对端公网地址:2.2.2.2 本端私网地址:3.3.3.3 对端私网地址:4.4.4.4

第一步:ike协商密钥

ike keychain 1

match local address g1/0/1(本地出接口地址)可以不写

pre-shared-key address 2.2.2.2 255.255.255.255 key simple 密钥(需与对端保持一致)

第二步:ike提议

ike proposal 1

encryption-algorithm aes-cbc-128 加密算法(需与对端保持一致)

dh group2 dh密钥交换协议为group2(需与对端保持一致)默认不写,此处为对端要求,必须保持一致

authentication-algorithm md5认证算法为md5

sa duration 28800 ipsec硬生存时间,默认为3600s,过了生存时间ipsec会重新协商sa

第三步:ike对等体

ike profile 1

keychain 1 调用keychain

dpd interval 10 on-demand dpd用来检测对端peer是否存活,类似于其他协议的hello或keepalive机制,on-demand 机制,该机制在隧道闲置时间超过指定配置的时间,且此时有报文发送,才会刺激发送 DPD探测消息

exchange-mode aggressive 交换模式为野蛮模式

local-identity address 1.1.1.1

match remote identity address 2.2.2.2 255.255.255.255

proposal 1 调用proposal 1

第四步:ipsec协商算法

ipsec transform-set 1

esp encryption-algorithm aes-cbc-128 加密算法

esp authentication-algorithm md5 认证算法

pfs dh-group2 配置此安全框架发起协商时使用的PFS特性。缺省情况下,安全策略发起协商时,没有使用PFS特性。(默认可以不配置)

第五步:ipsec安全策略

ipsec policy 1 1 isakmp

transform-set 1

security acl 3000 匹配兴趣流

local-address 1.1.1.1

remote-address 2.2.2.2

ike-profile 1

第六步:兴趣流

acl advance 3000

rule permit ip source 3.3.3.3 0.0.0.255 destination 4.4.4.4 0.0.0.255

第七步:拒绝走ipsec隧道的数据从出接口nat出去

acl advance 3001

rule deny ip source 3.3.3.3 0.0.0.255 destination 4.4.4.4 0.0.0.255

rule permit ip

第八步:在接口上应用ipsec policy

interface g1/0/1

nat outbound 3001

ipsec apply policy 1

第九步:静态路由配置

ip route-static 4.4.4.4 24 出接口的网关地址

其他命令

reset ike sa 重置ike sa

reset ipsec sa 重置ipsec sa

dis ike sa ike sa有没有建立好

dis ipsec sa ipsec sa有没有建立好

ipsec问题排查

terminal debug

terminal monitor

debug ipsec all

debug ike all

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值