ipsec XXX实验

阶段一:建立管理连接
定义安全的技术(加密算法,hash算法)
建立XXX对等体的设备要进行身份验证,预共享密钥的方式
要求配置参数:
传输集(加密算法,hash),与共享秘钥,指定和那个对等体建立XXX

阶段二:建立数据连接
定义ACL触发XXX的建立
阶段二对数据使用安全策略(加密算法,认证算法)

配置MAP关联前面的安全策略
ACL 和 peer以及安全策略

在接口上调用
实验拓扑:
在这里插入图片描述
实验配置要求:
1、 R1和PC1模拟福州分公司,R2和PC2模拟上海总公司,配置福州分公司和上海总公司通过IPSec XXX互联。
2、 设备之间互联的IP如图所示;
3、 在R1和R2上分配配置NAT,允许内网用户能够通过NAT访问Internet;
4、 在R1和R2上分别配置IPSec XXX,实现福州分公司和上海总公司互访;

配置思路:
1.根据拓扑配置IP地址
2.在R1与R2上配置NAT
R1
access-list 100 deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
access-list 100 permit ip any any /配置ACL,对IPSec XXX的流量不做NAT/

interface Serial1/0
ip nat outside
interface FastEthernet0/0
ip nat inside

ip nat inside source list 100 interface Serial1/0 overload
ip route 0.0.0.0 0.0.0.0 13.1.1.3 /配置默认路由,访问ISP/

R2:
access-list 100 deny ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
access-list 100 permit ip any any /配置ACL,对IPSec XXX的流量不做NAT/

interface Serial1/1
ip nat outside
interface FastEthernet0/0
ip nat inside
ip nat inside source list 100 interface Serial1/1 overload
ip route 0.0.0.0 0.0.0.0 23.1.1.3 /配置默认路由,访问ISP/

3.在R1 R2上配置ipsec XXX
R1
/ISAKMP/IKE阶段1的配置,配置管理连接/
crypto isakmp policy 1 /配置管理连接的安全策略/
encr 3des /加密算法使用3des/
hash md5 /hash算法使用3des/
authentication pre-share /采用预共享秘钥方式认证/
crypto isakmp key 6 cisco address 23.1.1.2 /配置预共享秘钥/

/ISAKMP/IKE阶段2的配置,配置数据连接/
crypto ipsec transform-set myset esp-3des /定义保护数据的安全协议/

access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 /定义触发XXX的流量/
crypto map mymap 1 ipsec-isakmp /创建map,关联阶段2的数据连接的安全协议/
set peer 23.1.1.2 /指定XXX对等体/
set transform-set myset
match address 101

interface Serial1/0
crypto map mymap /在接口上应用/

R2:
/ISAKMP/IKE阶段1的配置,配置管理连接/
crypto isakmp policy 1 /配置管理连接的安全策略/
encr 3des /加密算法使用3des/
hash md5 /hash算法使用3des/
authentication pre-share /采用预共享秘钥方式认证/
crypto isakmp key 6 cisco address 13.1.1.1 /配置预共享秘钥/

/ISAKMP/IKE阶段2的配置,配置数据连接/
crypto ipsec transform-set myset esp-3des /定义保护数据的安全协议/

access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255 /定义触发XXX的流量/
crypto map mymap 1 ipsec-isakmp /创建map,关联阶段2的数据连接的安全协议/
set peer 13.1.1.1 /指定XXX对等体/
set transform-set myset
match address 101

interface Serial1/1
crypto map mymap /在接口上应用/
4.验证结果
(1.)验证NAT
在这里插入图片描述
在这里插入图片描述
(2)测试ipsec XXX连通性

R1#clear ip nat translation *
R2#clear ip nat translation *
PC1#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/80/88 ms

R1#show ip nat translations NAT转换表项是空的,表面XXX流量没有经过NAT转换

(3)查看阶段1的IKE流量
R1#show crypto isakmp policy
Global IKE policy
Protection suite of priority 1
encryption algorithm: Three key triple DES
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit

(4)查看管理连接,验证阶段1是否协商成功
R1#show crypto isakmp sa
IPv4 Crypto ISAKMP SA
dst src state conn-id slot status
23.1.1.2 13.1.1.1 QM_IDLE 1001 0 ACTIVE
(5)查看阶段2的ipsec传输集,数据连接的安全协议
R1#show crypto ipsec transform-set
Transform set myset: { esp-3des }
will negotiate = { Tunnel, },
(6)查看数据连接SA的状态
R1#show crypto ipsec sa
interface: Serial1/0
Crypto map tag: mymap, local addr 13.1.1.1

protected vrf: (none)
local ident (addr/mask/prot/port): (192.168.1.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (192.168.2.0/255.255.255.0/0/0)
current_peer 23.1.1.2 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 25, #pkts encrypt: 25, #pkts digest: 25
#pkts decaps: 19, #pkts decrypt: 19, #pkts verify: 19
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 11, #recv errors 0
local crypto endpt.: 13.1.1.1, remote crypto endpt.: 23.1.1.2
path mtu 1500, ip mtu 1500, ip mtu idb Serial1/0
current outbound spi: 0x9E798012(2658762770)

 inbound esp sas:
  spi: 0xED308BE6(3979381734)
    transform: esp-3des ,
    in use settings ={Tunnel, }
    conn id: 1, flow_id: SW:1, crypto map: mymap
    sa timing: remaining key lifetime (k/sec): (4552518/1233)
    IV size: 8 bytes
    replay detection support: N
    Status: ACTIVE
 inbound ah sas:
 inbound pcp sas:
 outbound esp sas:
  spi: 0x9E798012(2658762770)
    transform: esp-3des ,
    in use settings ={Tunnel, }
    conn id: 2, flow_id: SW:2, crypto map: mymap
   sa timing: remaining key lifetime (k/sec): (4552518/1232)

IV size: 8 bytes
replay detection support: N
Status: ACTIVE
outbound ah sas:
outbound pcp sas:
(7)查看crypto map
R1#show crypto map
Crypto Map “mymap” 1 ipsec-isakmp
Peer = 23.1.1.2
Extended IP access list 101
access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
Current peer: 23.1.1.2
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={
myset,
}
Interfaces using crypto map mymap:
Serial1/0

总结:
1、 建立IPSec XXX连接需要3个步骤:

  1. 流量触发IPSec
  2. 建立管理连接
  3. 建立数据连接
    2、 阶段1的三个任务
  4. 协商采用何种方式建立管理连接
  5. 通过DH算法共享密钥信息
  6. 对等体彼此进行身份验证
    3、 ISAKMP/IKE阶段2需要完成的任务
  7. 定义对等体间需要保护何种流量
  8. 定义用来保护数据的安全协议
  9. 定义传输模式
  10. 定义数据连接的生存周期以及密钥刷新的方式
发布了138 篇原创文章 · 获赞 203 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qinshangwy/article/details/104087786