ipsec组成部分

esp(负载安全封装)协议

认证头(ah)协议

internet密钥交换(ike)协议

ipsec 两种工作模式

transport mode

tunnel mode

l2l实例分析

remote access实例分析

pc to pc实例分析

ike介绍

ike负载建立和维护ike sas和ipsec sas.

功能主要体现在如下几个方面:

对双方进行认证

交换公共密钥,产生密钥资源,管理密钥。

协商协议参数(封装,加密,验证...)

ike的三个模式

只有一种情况用主动模式,用与共享密钥认证的远程拨号vpn。其他都是主模式。

第一阶段,相互认证。

第二阶段,快速模式,3个包

主模式的6个包

6个包有3次交换,

1-2一次交换:交换策略,如何认证。如何加密。5-6个包,和快速模式的3个包。

3-4一次交换:通过dh交换,产生随机的密钥

5-6一次交换:相互认证。

ipsec配置步骤介绍

setp1:isakmp policy

step2:transform set

step3:interesting traffic

step4:crypto map

step1.(配置isakmp policy)

cypto isakmp polcy 10

encr 3des (默认:des)

hash md5(默认:sha)

authen pre-share(默认:rsa-sig)

group 2(默认:1)

crypto isakmp key 0 l2lkey address 202.100.1.2

配置ipsec策略(转换集)

cry ipsec transform-set trans esp-des esp-md5-hmac(加一个密钥一起做hash)

配置感兴趣流

ip access-list extended vpn

permit ip 1.1.1.0 0.0.0.255 2.2.2.0 0.0.0.255

配置crypto map(第二阶段策略关联)

crypto map cry-map 10(可以提供多个时候用id区别) ipsec-isakmp(密钥谁提供的)

match address vpn

set transform-set trans

set peer 202.100.1.2

int f0/1

crypto map cry-map

传统ipsec vpn的几大问题

1.不支持直接加密组播(最本质问题)

2.不支持动态路由协议

3.不提供routable interface for terminating ipsec tunnels(qos/fw...)

解决方案

1.gre over ipsec

2.svti(static virtual tunnel interface)

gre介绍

gre 协议号47

通用路由封装,封装广泛网络层的包,都能封装到一个ip的隧道,会产生一个点到点的链路。

gre主要的问题时:没有任何安全功能。

gre示意图

site1:

ip route 0.0.0.0 0.0.0.0 202.100.1.10

inter tunnel 0

ip add 13.1.1.1 255.255.255.0

tunnel souce 202.100.1.1

tunnel destination 202.100.2.2

router ospf 1

net 1.1.1.0 0.0.0.255 area 0

net 123.1.1.0 0.0.0.255 area 0

cry isa pol 10

au pre

cry isak key 0 cisco address 202.100.2.2

ip access-list ex vpn

permit gre host 202.100.1.1 host 202.100.2.2

cry ipsec transform-set cisco esp-des esp-md5-hmac

mode transport

cry map cisco 10 ipsec-isa

match address vpn

set transform-set cisco

set peer 202.100.2.2

int f0/0

cry map cisco

site2:

ip route 0.0.0.0 0.0.0.0 202.100.2.10

inter tunnel 0

ip add 123.1.1.2 255.255.25.50

tunnel souce 202.100.2.2

tunnel destination 202.100.1.1

router ospf 1

net 123.1.1.0 0.0.0.255 area 0

net 2.2.2.0 0.0.0.255 area 0

cry isa pol 10

au pre

cry isa 0 cisco address 202.100.1.1

cry ipsec transform-set cisco esp-des esp-md5-hmac

mode transport

crypto ipsec profile ipsecprof

set transform-set cisco

int tunn 0

tnnel protection ipsec profile ipsecprof