IKEv2 配置

一、环境搭建

基本配置:配IP、配路由

二、IKEv2 配置

1. 第一阶段策略配置

//第一阶段策略类似于IPsec第一阶段配置

R1配置:

R1(config)# crypto ikev2 proposal tech                    //多个proposal可组成一个policy,tech是proposal名
R1(config-ikev2-proposal)# encryption 3des                //配置加密算法
R1(config-ikev2-proposal)# integrity md5                  //配置哈希算法
R1(config-ikev2-proposal)# group 15                       //配置Diffie-Hellman组,15是组ID
R1(config-ikev2-proposal)# exit                           //退出proposal配置

R1(config)# crypto ikev2 policy techp                     //配置IKEv2的策略,techp是策略名
R1(config-ikev2-policy)# proposal tech                    //调用上面的proposal

R1(config)# crypto ikev2 keyring techk                    //配置钥匙串,钥匙串里的密钥作为预共享密钥
R1(config-ikev2-keyring)# peer R2                         //指定密钥给谁用,R2是本地有效的
R1(config-ikev2-keyring-peer)# address 10.1.1.2           //指定peer的地址
R1(config-ikev2-keyring-peer)# pre-shared-key cisco       //配置预共享密钥

R2配置:

R2(config)# crypto ikev2 proposal tech
R2(config-ikev2-proposal)# encryption 3des
R2(config-ikev2-proposal)# integrity md5
R2(config-ikev2-proposal)# group 15
R2(config-ikev2-proposal)# exit
R2(config)# crypto ikev2 policy techp
R2(config-ikev2-policy)# proposal tech
R2(config-ikev2-policy)# exit
R2(config)# crypto ikev2 keyring techk
R2(config-ikev2-keyring)# peer R1
R2(config-ikev2-keyring-peer)# address 10.1.1.1
R2(config-ikev2-keyring-peer)# pre-shared-key cisco
R2(config-ikev2-keyring-peer)# exit
R2(config-ikev2-keyring)# exit

2. 第二阶段策略配置

//第二阶段策略类似于IPsec第二阶段配置

R1配置:

R1(config)# crypto ikev2 profile techprofile                     //配置profile模板,techprofile是模板名
R1(config-ikev2-profile)# match identity remote address 10.1.1.2 //匹配远端peer
R1(config-ikev2-profile)# identity local address 10.1.1.1        //指明本地设备
R1(config-ikev2-profile)# authentication local pre-share         //配置本地用什么方式认证
R1(config-ikev2-profile)# authentication remote pre-share        //配置远端用什么方式认证
R1(config-ikev2-profile)# keyring local techk                    //指明钥匙串只在本地使用

R1(config)# crypto ipsec transform-set ccie ah-md5-hmac          //配置转换集

R1(config)# access-list 100 permit ip host 1.1.1.1 host 2.2.2.2  //配置感兴趣流

R1(config)# crypto map ccie 10 ipsec-isakmp                      //配置加密图
R1(config-crypto-map)# set peer 10.1.1.2
R1(config-crypto-map)# set transform-set ccie
R1(config-crypto-map)# match address 100
R1(config-crypto-map)# set ikev2-profile techprofile

R1(config)# int f0/0   //将加密图绑定到接口
R1(config-if)# crypto map ccie

R2配置:

R2(config)# crypto ikev2 profile techprofile
R2(config-ikev2-profile)# match identity remote address 10.1.1.1
R2(config-ikev2-profile)# identity local address 10.1.1.2
R2(config-ikev2-profile)# authentication local pre-share
R2(config-ikev2-profile)# authentication remote pre-share
R2(config-ikev2-profile)# keyring local techk
R2(config-ikev2-profile)# exit
R2(config)# crypto ipsec transform-set ccie ah-md5-hmac
R2(cfg-crypto-trans)# exit
R2(config)# access-list 100 permit ip host 2.2.2.2 host 1.1.1.1
R2(config)# crypto map ccie 10 ipsec-isakmp
R2(config-crypto-map)# set peer 10.1.1.1
R2(config-crypto-map)# set transform-set ccie
R2(config-crypto-map)# match address 100
R2(config-crypto-map)# set ikev2-profile techprofile
R2(config-crypto-map)# exit
R2(config)# int f0/0
R2(config-if)# crypto map ccie

三、测试

四、show

1. show crypto ikev2 proposal

查看proposal配置:show crypto ikev2 proposal
IKEv2 proposal: default //默认的proposal,如果我们不配置proposal则采用默认配置
Encryption : AES-CBC-256 AES-CBC-192 AES-CBC-128
Integrity : SHA512 SHA384 SHA256 SHA96 MD596
PRF : SHA512 SHA384 SHA256 SHA1 MD5
DH Group : DH_GROUP_1536_MODP/Group 5 DH_GROUP_1024_MODP/Group 2
IKEv2 proposal: tech //手动配置的proposal
Encryption : 3DES    //加密算法
Integrity : MD596    //哈希算法
PRF : MD5
DH Group : DH_GROUP_3072_MODP/Group 15  //Diffie-Hellman组

2. show crypto ikev2 policy

查看第一阶段策略配置:show crypto ikev2 policy
IKEv2 policy : default //默认的策略,如果我们不手动配置则采用默认配置
Match fvrf : any
Match address local : any
Proposal : default

IKEv2 policy : techp   //手动配置的策略
Match fvrf : global
Match address local : any
Proposal : tech

3. show crypto ikev2 sa

4. show crypto ipsec sa

时间: 2024-08-05 22:13:39

IKEv2 配置的相关文章

VPN相关知识点及ASA上VPN的配置整理

VPN只是IPSec的一种应用方式,IPSec其实是IPSecurity的简称,它的目的是为IP提供高安全性特性,VPN则是在实现这种安全特性的方式下产生的解决方案 IPSEC VPN 预先协商加密协议.散列函数.封装协议.封装模式和秘钥有效期等内容.具体执行协商任务的协议叫做互联网秘钥交换协议IKE.协商完成后的结果就叫做安全关联SA(IKE SA和IPSEC SA) IKE建立了安全关联(SA) IPSec 协议不是一个单独的协议,它给出了应用于IP层上网络数据安全的一整套体系结构,包括网络

cisco VPN 第二天ikev2实验笔记

IKEv2 配置实验 Branch: 1.配置proposal crypto ikev2 proposal ikev2-proposal  encryption 3des aes-cbc-256  integrity sha256 sha512  group 2 5 14 2.配置 policy(可选) crypto ikev2 policy ikev2-policy  proposal ikev2-proposal 3.配置keyring(必须) crypto ikev2 keyring ik

5540 asa 8.4 防火墙

配置等级策略,保证outside端口可以访问inside端口 access-list 100 extended permit icmp any any access-list 100 extended permit ip any any access-group 100 in interface outside 做PAT: object network nat subnet 192.168.1.0 255.255.255.0 nat (inside,ouside) dynamic interfa

ASA 5520(IOS version 8.4) IKEv2 IPSEC VPN实验配置

1.实验TOP图如下: 2.实验目的: 使用IKEv2实现点到点的IPSECVPN通信,即本示例中192.168.1.100和172.16.1.100之间实现VPN通信. 3.具体配置如下: ASA1配置 interfaceGigabitEthernet0 nameif outside security-level 0 ip address 11.1.1.2 255.255.255.0 ! interfaceGigabitEthernet1 nameif inside security-leve

ipsec vpn with NAT-T (ikev2 版本)配置以及排错过程

报错: .cisco ikev2 profile not found .Exchange type: Informational (5) .Exchange type:  NO PAYLOAD .specify IKE identity to use .rec'd IPSEC packet ha 未完,,,,,,,待整理

Windows Server 2012配置L2TP服务环境

在上一篇文章<Windows Server 2012配置VPN服务环境>中讲解了在Windows Server2012环境中的基础VPN搭建,但是只能支持PPTP的VPN连接.这篇文章进一步完善了VPN基于L2TP的连接讲解. 在百度上也没有找到一个Windows2012 很全的L2TP服务搭建的方案,所以自己编辑了一个给有需要的朋友们参考. 准备环境:Windows Server 2012R2 数据中心版64位,基础的VPN服务环境已经搭建完成. 功能需求:完善VPN服务器来支持L2TP类型

Centos 7 搭建 IKEv2 VPN 服务

1.安装依赖组件 1 yum -y install gpm-devel pam-devel openssl-devel make gcc 2.安装EPEL 1 yum -y install epel-release 3.安装Strongswan 1 yum -y install strongswan 4.为Strongswan添加别名 ipsec 1 alias ipsec='strongswan' 5.生成CA私钥,并使用此私钥自签名生成CA证书 1 cd /etc/strongswan &&a

(转)【IPSEC】CentOS/Ubuntu一键安装IPSEC/IKEV2 VPN服务器

转载自quericy的博客(https://quericy.me) 花了点时间将上次的Ubuntu.CentOS搭建IPSec/IKEv2 VPN服务器全攻略整理成了一份一键安装的脚本.适用于WindowsPhone,iOS,Android和PC设备.有需要的童鞋可以拿来食用~ ~ ~ ~ CetnOS测试了下貌似没什么问题,Ubuntu的手里暂时没有空闲vps就没试了,其实也差不多的,欢迎测试和反馈 最新更新内容请见Github上的项目说明:https://github.com/quericy

Mac系统导入ikev2证书导入方法

Mac OS 用户测试 先将证书拷贝到mac系统内,双击打开.如下: 此处注意 修改使用此证书时: 始终信任. 可能需要输入系统管理员的密码! 之后,打开网络偏好设置,添加VPN,如下图:类型选择IKEv2 之后输入vpn信息,服务器地址和远程ID均输入VPN服务器公网ip,点击鉴定设置,输入用户名和密码.点击连接即可 最后查看本机ip配置,类似下图,已经获得ip,并且可以正常上网.