IPSEC VPN建立的步骤和对应的配置

| No Comments | No TrackBacks
IPSEC VPN建立分为2步:Phase 1 & Phase 2
phase 1主要作用是vpn客户端和vpn接入点互相认证,以便确认对方的身份;phase2主要作用是协商针对特定的流量采用什么样的加密传输策略以及传输数据的完整性校验策略。

phase 1分为3步(共6个数据包),举例说明:
(1)A-->B :我支持的针对认证的加密策略有AES,DES,3DES...hash方法有md5/sha,认证方法采用pre-sharekey,rsa加密,rs签名,Diffie-Hellman使用Group1,2,或5,认证有效时间为x秒等
   B-->A:你提出的针对认证策略第N项我同意接受使用
(2)A<-->B 执行Diffie-Hellman交换,产生公共密钥
(3)A<-->B 使用协商好的认证策略以及产生的会话密钥传输加密的pre-sharekey或者证书等,互相进行认证。

对应的Cisco Router配置举例如下:
R1(config)#crypto isakmp policy 10
R1(config-isakmp)# encr aes //使用AES加密
R1(config-isakmp)# authentication pre-share //使用预共享密钥验证
R1(config-isakmp)# group 2 //使用DH group2
R1(config-isakmp)#crypto isakmp key r1r2cisco address 172.30.2.2 //将密钥与对端进行绑定

phase 2分为2步(共3个数据包),举例说明:
(1)A-->B: 我支持的针对数据传输的策略有ah-md5-hmac,ah-sha-hmac,esp-3des,esp-md5-hmac,感兴趣的数据流为某个流,是否启用PFS等
   B-->A: 我们选用其中的某个策略来作为加密传输的策略
(2)A-->B: OK,开始用这个策略传输吧
R1(config-isakmp-peer)#crypto ipsec transform-set ts esp-3des esp-sha-hmac //定义传输数据和完整性验证的策略
R1(cfg-crypto-trans)#crypto map cmap 10 ipsec-isakmp
R1(config-crypto-map)# set peer 172.30.2.2 //对端ip
R1(config-crypto-map)# set transform-set ts //将transfor-set与ipsec策略进行绑定
R1(config-crypto-map)# set pfs group2 //启用完美向前
R1(config-crypto-map)# match address loop //匹配感兴趣流
R1(config)#ip access-list extended loop
R1(config-ext-nacl)# permit ip host 1.1.1.1 host 2.2.2.2 //定义感兴趣流的访问控制列表

以上都配置好之后对于网络设备还需进行下面配置:
1. 在流量送出的接口上应用crypto map
2. 将感兴趣流的目的地址加入到路由表中(不一定非要精确匹配,只要能覆盖即可),然后将流量引导到送出接口
有些情况可能会出现返回的流量从另外的接口进入的情况,流量进入的接口不一定非要有crypto map,但是如果在所有可能返回流量的接口上写上crypto map是有好处的:当流量被crypto map中的感兴趣流匹配后,如果发现是没有被加密的流量,则直接丢弃,这样可以从一定程度上防止spoofing。

IPSEC L2L VPN使用的都是标准的公开的协议,任何厂家的设备只要支持标准的IPSEC VPN都可以实现互通。对于cisco设备默认的ISAKMP SA有效期是86400秒(1天),IPSEC SA有效期是1小时。在不同厂家互联的时候有些时候可能会忽略到有效期的问题,如果有效期不一致则一样没法连通。

No TrackBacks

TrackBack URL: http://www.liukang.com/cgi-bin/mt/mt-tb.cgi/604

Leave a comment

Google ADs

ClustrMaps

Archives

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.37
Creative Commons License
This blog is licensed under a Creative Commons License.

January 2012

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Kang published on May 25, 2007 12:15 AM.

买了一个linksys WRH54G was the previous entry in this blog.

PP告别106 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Google ADs