- 论坛徽章:
- 0
|
5可用积分
我在搭建一个ipsec的实验环境,用的是sun公司的虚拟机,安装的是centOS(讲ipsec升级到0.8了,内核重新编译支持AH、ESP、IPCOMP了)
大家请看的我实验一,我仅仅配置了setkey.conf代码如下:- #SAD entries
- flush;
- #flush SPD entries
- spdflush;
- #注释掉SA的方式,我想用racoon来进行协商,所以这个入口就不要了。
- #add SA entries
- #add 10.11.112.208 10.11.112.209 esp 0x1234 -m transport -E 3des-cbc 0x84cc855d6892207565811df4edd6bff5cf53af9106b72461 -A hmac-sha1 0xb48408f4655000f588a1a22cc14697d1a4d259cd;
- #add 10.11.112.209 10.11.112.208 esp 0x5678 -m transport -E 3des-cbc 0x6df8e9fc37255c9ba467be460187abc29e20e808f17591aa -A hmac-sha1 0x760c7721c03cf906c7fd70d0c9b9afd5785a1548;
- #add SP entries
- spdadd 10.11.112.208 10.11.112.209 any -P in ipsec esp/transport//require esp/transport//require;
- spdadd 10.11.112.209 10.11.112.208 any -P out ipsec esp/transport//require esp/transport//require;
复制代码 这个时候我上面的两个主机互相ping,抓包可以得到ESP的报文,试验一:成功。
实验2,我想通过racoon的方式来进行协商,请看我的racoon.conf的配置:- path include "/etc/racoon";
- path pre_shared_key "/etc/racoon/psk.txt";
- path certificate "/etc/racoon/certs";
- # $KAME: racoon.conf.sample,v 1.28 2002/10/18 14:33:28 itojun Exp $
- # "path" affects "include" directives. "path" must be specified before any
- # "include" directive with relative file path.
- # you can overwrite "path" directive afterwards, however, doing so may add
- # more confusion.
- #path include "/usr/local/v6/etc" ;
- #include "remote.conf" ;
- # the file should contain key ID/key pairs, for pre-shared key authentication.
- # racoon will look for certificate file in the directory,
- # if the certificate/certificate request payload is received.
- #path certificate "/usr/local/openssl/certs" ;
- # "log" specifies logging level. It is followed by either "notify", "debug"
- # or "debug2".
- log debug2;
- remote anonymous
- {
- #exchange_mode main,aggressive,base;
- exchange_mode main,base;
- #my_identifier fqdn "server.kame.net";
- #certificate_type x509 "foo@kame.net.cert" "foo@kame.net.priv" ;
- lifetime time 24 hour ; # sec,min,hour
- #initial_contact off ;
- #passive on ;
- # phase 1 proposal (for ISAKMP SA)
- proposal {
- encryption_algorithm 3des;
- hash_algorithm sha1;
- authentication_method pre_shared_key ;
- dh_group 2 ;
- }
- # the configuration could makes racoon (as a responder)
- # to obey the initiator's lifetime and PFS group proposal,
- # by setting proposal_check to obey.
- # this would makes testing "so much easier", but is really
- # *not* secure !!!
- proposal_check strict;
- }
- # phase 2 proposal (for IPsec SA).
- # actual phase 2 proposal will obey the following items:
- # - kernel IPsec policy configuration (like "esp/transport//use)
- # - permutation of the crypto/hash/compression algorithms presented below
- sainfo anonymous
- {
- pfs_group 2;
- lifetime time 12 hour ;
- encryption_algorithm 3des, cast128, blowfish 448, des, rijndael ;
- authentication_algorithm hmac_sha1, hmac_md5 ;
- compression_algorithm deflate ;
- }
复制代码 这是从源代码中的示例中找出来的,我现在对2个虚拟机ping,这时候ping不通了,我也在网上找了很多配置的方法,就是不成功,所以请熟悉的同学帮我看看,解读解读,如果要调试我要怎么调试,之前我racoon的时候加上-d,那个打印不知道是配置不对还是什么问题打印就这点点:- 2011-03-11 03:05:58: INFO: @(#)ipsec-tools 0.8.0.RC (http://ipsec-tools.sourceforge.net)
- 2011-03-11 03:05:58: INFO: @(#)This product linked OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 (http://www.openssl.org/)
- 2011-03-11 03:05:58: INFO: Reading configuration from "racoon.conf"
- 2011-03-11 03:07:30: INFO: @(#)ipsec-tools 0.8.0.RC (http://ipsec-tools.sourceforge.net)
- 2011-03-11 03:07:30: INFO: @(#)This product linked OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 (http://www.openssl.org/)
- 2011-03-11 03:07:30: INFO: Reading configuration from "racoon.conf"
复制代码 请熟悉的同学帮我解读解读,分享分享,先谢谢了!
|
|