Соединил две локальные сетки через IPSec туннель на двух FreeBSD
Все делал по описаниям и вроде все работает, но...
1. Вначале выдается предупреждение:
Warning: pseudo-random number generator used for IPsec processing2. В процессе сеанса связи постоянно сыпятся сообщения:
/kernel:IPv4 ESP input: no key assotiation found for spi 567859...Привожу кусок из racoon.log
=================================
2003-03-27 13:49:31: INFO: isakmp.c:800:isakmp_ph1begin_i(): begin Aggressive mode.
2003-03-27 13:49:32: INFO: vendorid.c:128:check_vendorid(): received Vendor ID:KAME/racoon
2003-03-27 13:49:32: NOTIFY: oakley.c:2036:oakley_skeyid(): couldn't find pskey, try to get one by the peer's address.
2003-03-27 13:49:32: INFO: isakmp.c:2409:log_ph1established(): ISAKMP-SA established 2.2.2.2[500]-1.1.1.1[500] spi:297afa17fb77fbd6:43ef60c12bd5f59f
2003-03-27 13:49:33: INFO: isakmp.c:939:isakmp_ph2begin_i(): initiate new phase
2 negotiation: 2.2.2.2[0]<=>1.1.1.1[0]
2003-03-27 13:49:34: INFO: pfkey.c:1107:pk_recvupdate(): IPsec-SA established: E
SP/Tunnel 2.2.2.2->1.1.1.1 spi=194153803(0xb928d4b)
2003-03-27 13:49:34: INFO: pfkey.c:1319:pk_recvadd(): IPsec-SA established: ESP/Tunnel 2.2.2.2->1.1.1.1 spi=70389458(0x4320ed2)
2003-03-27 13:49:59: INFO: pfkey.c:1365:pk_recvexpire(): IPsec-SA expired: ESP/Tunnel 2.2.2.2->1.1.1.1 spi=70389458(0x4320ed2)
======================================================
и на другой машине2003-03-27 13:47:58: ERROR: isakmp.c:1349:isakmp_open(): failed to bind (Address already in use).
2003-03-27 13:50:59: INFO: isakmp.c:891:isakmp_ph1begin_r(): respond new phase 1 negotiation: 1.1.1.1[500]<=>2.2.2.2[500]
2003-03-27 13:50:59: INFO: isakmp.c:896:isakmp_ph1begin_r(): begin Aggressive mode.
2003-03-27 13:50:59: NOTIFY: oakley.c:2036:oakley_skeyid(): couldn't find pskey, try to get one by the peer's address.
2003-03-27 13:51:00: INFO: isakmp.c:2409:log_ph1established(): ISAKMP-SA established 1.1.1.1[500]-2.2.2.2[500] spi:297afa17fb77fbd6:43ef60c12bd5f59f
2003-03-27 13:51:01: INFO: isakmp.c:1046:isakmp_ph2begin_r(): respond new phase 2 negotiation: 1.1.1.1[500]<=>2.2.2.2[500][0]
2003-03-27 13:51:01: INFO: pfkey.c:1107:pk_recvupdate(): IPsec-SA established: .......
===================================================
ЗЫ
На всякий случай привожу конфигурацию:
в /etc/rc.confipsec_enable="YES"
ipsec_file="/etc/ipsec.conf"
network_interfaces="rl0 gif0 ed0 lo0"
gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.0.1 192.168.1.1 netmask 255.255.255.0"в /etc/ipsec.conf
flush;
spdflush;
spdadd 192.168.0.0/24 192.168.1.0/24 any -P out ipsec esp/tunnel/1.1.1.1-2.2.2.2/require;
spdadd 192.168.1.0/24 192.168.0.0/24 any -P in ipsec esp/tunnel/2.2.2.2-1.1.1.1/require;
>Соединил две локальные сетки через IPSec туннель на двух FreeBSD
>Все делал по описаниям и вроде все работает, но...
>1. Вначале выдается предупреждение:
>Warning: pseudo-random number generator used for IPsec processing
>
>2. В процессе сеанса связи постоянно сыпятся сообщения:
>/kernel:IPv4 ESP input: no key assotiation found for spi 567859...
>
>Привожу кусок из racoon.log
>=================================
>2003-03-27 13:49:31: INFO: isakmp.c:800:isakmp_ph1begin_i(): begin Aggressive mode.
>2003-03-27 13:49:32: INFO: vendorid.c:128:check_vendorid(): received Vendor ID:KAME/racoon
>2003-03-27 13:49:32: NOTIFY: oakley.c:2036:oakley_skeyid(): couldn't find pskey, try to get one by
>the peer's address.
>2003-03-27 13:49:32: INFO: isakmp.c:2409:log_ph1established(): ISAKMP-SA established 2.2.2.2[500]-1.1.1.1[500] spi:297afa17fb77fbd6:43ef60c12bd5f59f
>2003-03-27 13:49:33: INFO: isakmp.c:939:isakmp_ph2begin_i(): initiate new phase
>2 negotiation: 2.2.2.2[0]<=>1.1.1.1[0]
>2003-03-27 13:49:34: INFO: pfkey.c:1107:pk_recvupdate(): IPsec-SA established: E
>SP/Tunnel 2.2.2.2->1.1.1.1 spi=194153803(0xb928d4b)
>2003-03-27 13:49:34: INFO: pfkey.c:1319:pk_recvadd(): IPsec-SA established: ESP/Tunnel 2.2.2.2->1.1.1.1 spi=70389458(0x4320ed2)
>2003-03-27 13:49:59: INFO: pfkey.c:1365:pk_recvexpire(): IPsec-SA expired: ESP/Tunnel 2.2.2.2->1.1.1.1 spi=70389458(0x4320ed2)
>======================================================
>и на другой машине
>
>2003-03-27 13:47:58: ERROR: isakmp.c:1349:isakmp_open(): failed to bind (Address already in use).
вот это тоже не знаю. у меня ругается так же, но работает.
Все остальое - процесс обмена ключами, которые експирятся через какое-то время, указанное в конфиге. иногда происходит рассинхронизация, и необходимо перезапускать все руками $(>2003-03-27 13:50:59: INFO: isakmp.c:891:isakmp_ph1begin_r(): respond new phase 1 negotiation: 1.1.1.1[500]<=>2.2.2.2[500]
>2003-03-27 13:50:59: INFO: isakmp.c:896:isakmp_ph1begin_r(): begin Aggressive mode.
>2003-03-27 13:50:59: NOTIFY: oakley.c:2036:oakley_skeyid(): couldn't find pskey, try to get one by
>the peer's address.
>2003-03-27 13:51:00: INFO: isakmp.c:2409:log_ph1established(): ISAKMP-SA established 1.1.1.1[500]-2.2.2.2[500] spi:297afa17fb77fbd6:43ef60c12bd5f59f
>2003-03-27 13:51:01: INFO: isakmp.c:1046:isakmp_ph2begin_r(): respond new phase 2 negotiation: 1.1.1.1[500]<=>2.2.2.2[500][0]
>2003-03-27 13:51:01: INFO: pfkey.c:1107:pk_recvupdate(): IPsec-SA established: .......
>===================================================