华为技术和ipsec安全策略模拟实验配置步骤

网段地址:
r1
g0/0/0 192.168.1.100 24
g0/0/1 200.1.13.1 24
r3
g0/0/0 200.1.13.2 24
g0/0/1 200.1.23.2 24
r2
g0/0/0 192.168.2.100 24
g0/0/1 200.1.23.1 24
pc1:192.168.1.1 24
pc2:192.168.2.1 24
第一步
配置security acl,用于匹配站点间通信网络之间的感兴趣流。
配置:
[r1-acl-adv-3000]rule 2 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255   
ipsec使用高级acl定义需要保护的数据流。ipsec根据acl的规则来确定哪些报文需要安全保护,哪些报文不需要安全保护。
在隧道发起端,匹配(permit)高级acl的数据流将被保护,即经过ipsec加密处理后再发送;不能匹配高级acl的数据流则直接转发。
在隧道接收端,对数据流进行解密,并检查解密后的数据流是否匹配了acl规则,丢弃不匹配acl规则的报文。
acl配置原则
1.若不同的数据流需要采用不同的安全策略来保护,则需要为之创建不同的acl。
2.若不同的数据流可以采用相同的安全策略来保护,则可以在一条acl中配置多条rule来保护不同的数据流。但是acl中序列号大的rule不能完全包含序列号小的rule 的内容。
3.ipsec两端acl规则定义的协议类型要一致,如:一端使用ip协议,另一端也必须使用ip协议。
4.同一个安全策略组中配置的acl不能包含相同的rule规则。采用ikev2进行协商时,同一个安全策略组中所有安全策略的引用的acl的rule之间不能存在交集。
5.建议ipsec隧道两端配置的acl规则互为镜像,即一端acl规则的源地址和目的地址分别为另一端acl规则的目的地址和源地址。
第二步
配置ike安全提议,决定处理ike流量的安全机制(可选:可以采用默认
ike安全提议)
ike对等体通过ike安全提议来协商建立ike sa所需要的
加密算法、
认证方法、
认证算法、
diffie-hellman组标识
安全联盟生存周期
[r1]ike proposal 10 (创建ike安全提议)[r1-ike-proposal-10]authentication-algorithm ?(配置认证算法)  aes-xcbc-mac-96  select aes-xcbc-mac-96 as the hash algorithm  md5              select md5 as the hash algorithm  sha1             select sha as the hash algorithm  sm3              select sm3 as the hash algorithm[r1-ike-proposal-10]authentication-algorithm md5 [r1-ike-proposal-10]encryption-algorithm ?(配置加密算法)  3des-cbc     168 bits 3des-cbc  aes-cbc-128  use aes-128  aes-cbc-192  use aes-192  aes-cbc-256  use aes-256  des-cbc      56 bits des-cbc[r1-ike-proposal-10]encryption-algorithm aes-cbc-128[r1-ike-proposal-10]authentication-method ?(配置认证方法)  digital-envelope  select digital envelope  key as the authentication method  pre-share         select pre-shared key as the authentication method  rsa-signature     select rsa-signature key as the authentication method[r1-ike-proposal-10]authentication-method  pre-share [r1-ike-proposal-10]dh ?(配置diffie-hellman组标识)  group1   768 bits diffie-hellman group  group14  2048 bits diffie-hellman group  group2   1024 bits diffie-hellman group  group5   1536 bits diffie-hellman group[r1-ike-proposal-10]dh group2  
可选:执行命令integrity-algorithm { aes-xcbc-96 | hmac-md5-96 | hmac-sha1-96 |
hmac-sha2-256 | hmac-sha2-384 | hmac-sha2-512 } 配置完整性算法。
[r1-ike-proposal-10]sa duration ? (配置ike密钥有效期)   integer  value of time(in seconds), default is 86400[r1-ike-proposal-10]sa duration  10000配置完成:[r1-ike-proposal-10]display  this [v200r003c00]#ike proposal 10 encryption-algorithm aes-cbc-128 dh group2 authentication-algorithm md5 sa duration 10000#return  
display ike proposal
//查看ike默认proposal,如果没有特殊安全需求建议保
持默认的ike proposal
第三步
配置ike对等体,
调用第二步配置的ike安全提议,
选择ike版本(version1/version 2),
配置ike身份认证参数,
决定ike version 1第一阶段的交换模式,
可以选择主模式或野蛮模式。
[r1]ike peer xwl ?  (配置 ike peer 和 ike版本号)  v1    only v1 sa's can be created  v2    only v2 sa's can be created    please press enter to execute command [r1]ike peer xwl v1  
ikev1要求两端配置的acl规则互为镜像(ike方式的ipsec安全策略)或发起方配置的acl
规则为响应方的子集(模板方式的ipsec安全策略)。
ikev2取双方acl规则交集作为协商结果。
修改acl时注意:
acl参数的修改是实时生效的,修改后隧道立即被拆除,在下次进行隧道协商时使用新
的参数。
[r1-ike-peer-xwl]remote-address ?  ip_addr  ip address  string     host name[r1-ike-peer-xwl]remote-address 200.1.23.1  (配置对端ip地址或地址段。)[r1-ike-peer-xwl]pre-shared-key cipher huawei (配置身份认证参数)[r1-ike-peer-xwl]ike-proposal 10(引用已配置的ike安全提议。)[r1-ike-peer-xwl]exchange-mode ?(配置模式为主模式或者野蛮模式)  aggressive  aggressive mode  main        main mode[r1-ike-peer-xwl]exchange-mode main[r1-ike-peer-xwl]peer-id-type ? (配置peer建立时id的类型)  ip    select ip address as the peer id  name  select name as the peer id配置完成[r1-ike-peer-xwl]display this [v200r003c00]#ike peer xwl v1 pre-shared-key cipher %$%$}hz!s,^u*;l(aqmou4+,.2n%$%$ ike-proposal 10remote-address 200.1.23.1#return  
第四步
配置ipsec安全提议,配置处理实际感兴趣的安全机制,
包括封装模式,esp的加密与验证算法,ah的验证算法。
如果只创建ipsec proposal ,则继承默认策略
[r1]ipsec proposal xwl (创建安全提议)[r1-ipsec-proposal-xwl]encapsulation-mode ?(配置报文封装模式)  transport  only the payload of ip packet is protected(transport mode)  tunnel     the entire ip packet is protected(tunnel mode)[r1-ipsec-proposal-xwl]encapsulation-mode tunnel [r1-ipsec-proposal-xwl]esp authentication-algorithm ?(配置esp方式采用的认证算法)  md5       use hmac-md5-96 algorithm  sha1      use hmac-sha1-96 algorithm  sha2-256  use sha2-256 algorithm  sha2-384  use sha2-384 algorithm  sha2-512  use sha2-512 algorithm  sm3       use sm3 algorithm[r1-ipsec-proposal-xwl]esp authentication-algorithm md5[r1-ipsec-proposal-xwl]esp encryption-algorithm ?(配置esp协议使用的加密算法)  3des     use 3des  aes-128  use aes-128  aes-192  use aes-192  aes-256  use aes-256  des      use des  sm1      use sm1       please press enter to execute command [r1-ipsec-proposal-xwl]esp encryption-algorithm aes-128[r1-ipsec-proposal-xwl]transform ?(配置传送数据时采用的安全协议)  ah      ah protocol defined in rfc2402  ah-esp  esp protocol first, then ah protocol  esp     esp protocol defined in rfc2406[r1-ipsec-proposal-xwl]transform esp 如果配置为ah  [r1-ipsec-proposal-xwl]ah authentication-algorithm ?  md5       use hmac-md5-96 algorithm  sha1      use hmac-sha1-96 algorithm  sha2-256  use sha2-256 algorithm  sha2-384  use sha2-384 algorithm  sha2-512  use sha2-512 algorithm  sm3       use sm3 algorithm配置完成[r1-ipsec-proposal-xwl]display this [v200r003c00]#ipsec proposal xwl esp encryption-algorithm aes-128#return  
第五步
配置ipsec安全策略,
调用第一步配置的security acl;
第二步配置的ike peer;
第三步配置的ipsec安全提议。
模板方式的ipsec安全策略配置原则:
1.ipsec隧道只能有一端配置模板方式的ipsec安全策略,另一端必须配置ike方式的
ipsec安全策略。
2.一个ipsec策略组中只能有一条安全策略引用安全策略模板,该策略的序号推荐比
其它策略的序号大,否则可能导致其它策略不生效。
3.ipsec安全策略模板中acl、ipsec安全提议和ike对等体为必选配置,而其它参数为
可选配置。
4.在ike协商时,要求安全策略模板中定义的参数必须与对端匹配;安全策略模板中
没有定义的参数由发起方来决定,响应方接受发起方的建议。
5.一个安全策略模板可以引用多个ipsec安全提议,在响应不同对端发起的连接时匹
配不同的ipsec安全提议。
6.一个安全策略模板只能引用一条acl,引用新的acl时必须先取消引用原有acl。
如果接口上应用了ipsec安全策略,则修改ipsec和ike的各项参数时,需注意在修
改ipsec安全策略时可以直接新增或删除ipsec安全策略或者修改ipsec安全策略中
的各项配置。
对于模板方式建立的ipsec安全策略:
1.修改pfs参数在下次协商时生效,对已经协商起来的隧道不生效。
2. 除pfs外的其它参数只能先在接口上取消应用ipsec策略,再进行修改。
pfs 完美向前 第一个密钥失效后第二个密钥和第一个密钥是有关系的 设置了pfs后,这密钥之间没有关系
pfs(perfect forward secrecy,完善的前向安全性)是一种安全特性,指一个密钥被破解,并不影响其他密钥的安全性,因为这些密钥间没有派生关系。此特性是通过在ike阶段2的协商中增加密钥交换来实现的
[r1]ipsec policy xwl ?  integer  the sequence number of ipsec policy  shared            shared[r1]ipsec policy xwl 10 ?  isakmp  indicates use ike to establish the ipsec sa  manual  indicates use manual to establish the ipsec sa      please press enter to execute command [r1]ipsec policy xwl 10 isakmp [r1-ipsec-policy-isakmp-xwl-10]ike-peer xwl (调用第二步配置的ike peer)[r1-ipsec-policy-isakmp-xwl-10]proposal xwl (调用第二步配置的ike peer)[r1-ipsec-policy-isakmp-xwl-10]security acl 3000(调用第一步配置的security acl)配置完成:[r1-ipsec-policy-isakmp-xwl-10]display this [v200r003c00]#ipsec policy xwl 10 isakmp security acl 3000 ike-peer xwl proposal xwl#return  
第六步
在接口上调用ipsec安全策略。[r1]interface gigabitethernet 0/0/1[r1-gigabitethernet0/0/1]ipsec policy xwl ?    please press enter to execute command   
配置完成后,需要流量进行激活隧道的建立
[r1]ip route-static 192.168.2.0 24 200.1.13.2[r2]ip route-static 192.168.1.0 24 200.1.23.2  
查看相关信息
ipsec第一阶段形成ike sa 的通道 使用的是udp 500的流量,源端口,目的端口都是500
reset ike sa all 清除建立的sa 通道
pc1:
协商后的iipsec proposal 参数
协商后的ike peer 参数
ike第二阶段
ike第一和第二阶段


Gartner公布五大黑科技趋势
开关跳闸是什么原因_开关跳闸怎么处理
高精度测量的激光功率计产品应用
4D毫米波雷达加速了4D成像系统的可能性
简要介绍ActiveSLAM的应用场景
华为技术和ipsec安全策略模拟实验配置步骤
CuClad® 217 层压板Rogers
金航标Kinghelm电子进行 ISO9001管理体系的复审工作
麦肯锡中国人工智能报告 直面三座大山
iPhone 12又出问题,无法接收短信或者相应的信息通知
因为这样的原因,才有闪存门事件!
什么牌子的蓝牙耳机好用,什么品牌蓝牙耳机音质好
全球手机厂商排行:小米升至第四,华为还是第三
PWM概念和原理讲解
基于低功率混合信号 ARM Cortex-M4处理器的 Ki
护手仪ESD整改方案
浅谈电磁兼容的规范和测试分类
R&S公司推出新一代视音频测试平台VTx
三星BESPOKE HOME,让家由自己定义
S参数去嵌之DK DF值拟合方案流程与仿真测试拟合过程