分类: ~~~ Security ~~~ |
一、SA简介
SA是IPSEC的一个组件,有两类SA:
1、IKE or isakmp SA
2、IPSEC SA
平时我们所说的SA其实包含了这两类SA,但是正确地区分它们才能在troubleshooting时更加得心应手,因为它们分别有不同的作用。这两类SA都是利用IKE protocol在IPSec peers间建立连接的。
二、IKE SA简介
IKE SA:
1、control traffic,such as negotiating algorithms to use to encrypt IKE traffic and authenticate peers。
2、and there is only one IKE SA between peers,
3、and it usually has less traffic and a longer lifetime than IPSEC SA.
(译)
1、协商加密IKE流量以及认证邻居的算法;
2、邻居间只有一条IKE SA;
3、流量少于IPSEC SA并且比IPSEC SA的lifetime要长)
三、IPSEC SA简介:
IPSEC SA:negotiating encryption algorithms to apply for ip traffic between the peers.
至少需要两条IPSEC SA在邻居双方建立连接。
可以同时有多对IPSEC SA来满足不同的数据加密要求。
IPSEC SA通常流量比IKE SA要大,但是lifetime要小。
四、IKE的建立过程(2步)
1、对IKE邻居提供双向认证机制并建立session key。这个阶段使用DH exchange,cookies,ID exchange来建立IKE SA。一旦IKE SA建立完成,所有双方IKE联系信息都会被加密并进行integrity check。这一阶段的任务主要是为第2阶段的协商提供一个安全通道。
2、提供对IPSEC SA的协商,并使用ESP或AH保护IP数据流。
例1:
crypto isakmp policy 1
encryption 3des //加密方式,对称3des
hash md5 //数据完整性方式md5
group 2 //组2,提供1024位方式
lifetime
authentication pre-shared //认证方式pre-shared
show crypto isakmp policy //显示配置结果
例2:
crypto isakmp policy 1
encryption 3des
hash md5
lifetime
authentication pre-shared
crypto isakmp key xxxx 1.1.1.1
crypto isakmp key yyyy 2.2.2.2
例3:
(spoke)
crypto isakmp policy 1
crypto isakmp key xxxx address 1.1.1.1
crypto ipsec transform-set yyyy esp-3des esp-sha-hmac
crypto map zzzz 1 ipsec-isakmp
int s0/0
int e0/0
ip route 0.0.0.0 0.0.0.0 2.2.2.2
access-list 100 permit ip 10.0.0.0 0.0.0.255 10.1.1.0 0.0.0.255
(hub)
crypto isakmp policy 1
crypto isakmp key xxxx address 2.2.2.2
crypto ipsec transform-set yyyy esp-3des esp-sha-hmac
crypto map zzzz 1 ipsec-isakmp
int f0/0
int s0/0
ip route 0.0.0.0 0.0.0.0 2.2.2.2
access-list 100 permit 10.1.1.0 0.0.0.255 10.0.0.0 0.0.0.255