Ключевые слова:freebsd, ipsec, tunnel, (найти похожие документы)
Date: Mon, 15 Jul 2002 06:57:04 +0000 (UTC)
Sender: [email protected]
From: andrew pavlov <[email protected]>
Newsgroups: fido7.ru.unix.bsd
Subject: [FreeBSD] Настройка IPSec тунеля с использованием racoon
>> Нужен ipsec (192.168.1.0/24 - [real.ip.1] === [real.ip.2] -
>> 192.168.0.0/24) делаю по HandBook (ipsec.html 8.9.3), но не работает.
>> Нужен ли gif? Обязателен ли racoon? Если у кого получилось - киньте
>> настройки.
>
> Неужели никто не использует сабж?
> Я уже и http://asherah.dyndns.org/~josh/ipsec-howto.txt почитал - не помогает.
приблизительно так... ты уж извини если не поможет... :)
в /etc/rc.conf
ipsec_enable="YES"
network_interfaces="lo0 fxp0 gif0"
gif_interfaces="gif0"
на host1:
ifconfig_fxp0="inet y.y.y.1/24" # твой LAN
ifconfig_gif0="inet x.x.1.1 x.x.2.1 netmask 255.255.255.0" # адреса тунеля
gifconfig_gif0="y.y.y.1 y.y.y.2"
на host2:
ifconfig_fxp0="inet y.y.y.2/24" # твой LAN
ifconfig_gif0="inet x.x.2.1 x.x.1.1 netmask 255.255.255.0" # адреса тунеля
gifconfig_gif0="y.y.y.2 y.y.y.1"
cd /etc
touch ipsec.conf
в /etc/ipsec.conf
на host1:
spdadd x.x.1.1/24 x.x.2.1/24 any -P out
ipsec esp/tunnel/y.y.y.1-y.y.y.2/require;
spdadd x.x.2.1/24 x.x.1.1/24 any -P in
ipsec esp/tunnel/y.y.y.2-y.y.y.1/require;
на host2:
spdadd x.x.2.1/24 x.x.1.1/24 any -P out
ipsec esp/tunnel/y.y.y.2-y.y.y.1/require;
spdadd x.x.1.1/24 x.x.2.1/24 any -P in
ipsec esp/tunnel/y.y.y.1-y.y.y.2/require;
cd /usr/ports/security/racoon
make build; make install; make clean
cd /usr/local/etc/racoon
touch psk.txt
в /usr/local/etc/racoon/psk.txt
на host1:
y.y.y.2 badaboom
на host2:
y.y.y.1 badaboom
touch racoon.conf
в /usr/local/etc/racoon/racoon.conf на обоих хостах
path include "/usr/local/etc/racoon" ;
path pre_shared_key "/usr/local/etc/racoon/psk.txt" ;
log info;
padding
{
maximum_length 20; # maximum padding length.
randomize off; # enable randomize length.
strict_check off; # enable strict check.
exclusive_tail off; # extract last one octet.
}
timer
{
# These value can be changed per remote node.
counter 5; # maximum trying count to send.
interval 20 sec; # maximum interval to resend.
persend 1; # the number of packets per a send.
# timer for waiting to complete each phase.
phase1 30 sec;
phase2 15 sec;
}
remote anonymous
{
exchange_mode aggressive,main;
doi ipsec_doi;
situation identity_only;
nonce_size 16;
lifetime time 1 min; # sec,min,hour
# lifetime byte 5 MB; #
initial_contact on;
support_mip6 on;
proposal_check obey; # obey, strict or claim
proposal {
encryption_algorithm 3des;
hash_algorithm md5;
authentication_method pre_shared_key ;
dh_group 2 ;
}
}
sainfo anonymous
{
pfs_group 1;
lifetime time 36000 sec;
# lifetime byte 50000 KB;
encryption_algorithm 3des,des,cast128,blowfish ;
authentication_algorithm hmac_sha1,hmac_md5;
compression_algorithm deflate ;
}
в ядре должен присутствовать
pseudo-device gif
Запускаем racoon
/usr/local/sbin/racoon -f /usr/local/etc/racoon/racoon.conf