Не могу найти в чем проблема, буду очень признательна за любые подсказки...
ПОМОГИТЕ!
Есть:
Linux Suse 8(2.4.21-138-smp) c ipsec (freeswan-1.98_0.9.14-341) и
Сisco 2651. Нужен VpN+IPSec.
Проблема - все время реконнект фазы 2... Впечатление, что Линукс отвечает на предыдущий пакет, а циска СА уже сбросила и сделала новый...
md5 и группу 2 ставила, но (может из-за того что ipsec в ядре) несмотря на
то что они прописаны в конфиге, линукс все равно предлагает ah-sha-hmac и группу 5.
cisco-
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
lifetime 3600
crypto isakmp key 12345 address 192.168.100.2
!
crypto ipsec transform-set Samara08 ah-sha-hmac esp-3des
mode tunnel
!
crypto map Sam08 1 ipsec-isakmp
set peer 192.168.100.2
set transform-set Samara08
set pfs group2
match address tun8
!
interface Tunnel8
ip address 192.168.180.1 255.255.255.252
keepalive 300 50
tunnel source 192.168.100.1
tunnel destination 192.168.100.2
tunnel mode ipip
crypto map Sam08
!
interface FastEthernet0/0
ip address 172.36.1.1 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.100.1 255.255.255.252
keepalive 300
crypto map Sam08
----------------------
ip route 172.38.2.0 255.255.255.0 192.168.180.2
----------------------
ip access-list extended tun8
permit ip host 192.168.100.1 host 192.168.100.2
permit ip host 192.168.100.2 host 192.168.100.1
permit ip 172.36.1.0 0.0.0.255 172.38.2.0 0.0.0.255
permit ip 172.38.2.0 0.0.0.255 172.36.1.0 0.0.0.255
===========================
Linux
Ipsec.conf
config setup
interfaces="ipsec0=eth0"
klipsdebug=all
plutodebug=all
plutoload=%search
plutostart=%search
uniqueids=yes
# ESP
conn conn_GU
type=tunnel
auth=ah
authby=secret
keyexchange=ike
auto=start
left=192.168.100.2
leftsubnet=172.38.2.0/24
leftnexthop=192.168.100.1
right=192.168.100.1
rightsubnet=172.36.1.0/24
rightnexthop=
pfs=yes
lifetime=3600
esp=3des-md5-96
ah=hmac-sha-1-96
--------
Ipsec.secrets
192.168.100.2 192.168.100.1 “12345”
================================================
# ipsec look
cat: /proc/net/ipsec_spigrp: No such file or directory
cat: /proc/net/ipsec_eroute: No such file or directory
grep: /proc/net/ipsec_tncfg: No such file or directory
sort: open failed: /proc/net/ipsec_spi: No such file or directory
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.100.2 0.0.0.0 UG 40 0 0 ipsec0
172.36.1.0 192.168.100.1 255.255.255.0 UG 40 0 0 ipsec0
192.168.100.0 0.0.0.0 255.255.255.252 U 40 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.252 U 40 0 0 ipsec0
======================
Linux - messages
Dec 15 11:22:22 ers_herm pluto[1176]: "conn_GU" #1: Quick Mode I1 message is unacceptable because it uses a previously used Message ID 0xeb9b46ad (perhaps this is a duplicated packet)
======================
41w0d: ISAKMP (0:3): Input = IKE_MESG_INTERNAL, IKE_PROCESS_COMPLETE
41w0d: ISAKMP (0:3): Old State = IKE_R_MM5 New State = IKE_P1_COMPLETE
scmIkeTunnelCreate ikeidx:1202
41w0d: ISAKMP (0:3): Input = IKE_MESG_INTERNAL, IKE_PHASE1_COMPLETE
41w0d: ISAKMP (0:3): Old State = IKE_P1_COMPLETE New State = IKE_P1_COMPLETE
41w0d: ISAKMP (0:3): received packet from 192.168.100.2 dport 500 sport 500 Global (R) QM_IDLE
41w0d: ISAKMP: set new node -1451715169 to QM_IDLE
41w0d: CryptoEngine0: generate hmac context for conn id 3
41w0d: ISAKMP (0:3): processing HASH payload. message ID = -1451715169
41w0d: ISAKMP (0:3): processing SA payload. message ID = -1451715169
41w0d: ISAKMP (0:3): Checking IPSec proposal 0
41w0d: ISAKMP: transform 0, AH_SHA
41w0d: ISAKMP: attributes in transform:
41w0d: ISAKMP: group is 2
41w0d: ISAKMP: encaps is 1 (Tunnel)
41w0d: ISAKMP: SA life type in seconds
41w0d: ISAKMP: SA life duration (basic) of 3600
41w0d: ISAKMP: authenticator is HMAC-SHA
41w0d: CryptoEngine0: validate proposal
41w0d: ISAKMP (0:3): atts are acceptable.
41w0d: ISAKMP (0:3): Checking IPSec proposal 0
41w0d: ISAKMP: transform 0, ESP_3DES
41w0d: ISAKMP: attributes in transform:
41w0d: ISAKMP: group is 2
41w0d: ISAKMP: encaps is 1 (Tunnel)
41w0d: ISAKMP: SA life type in seconds
41w0d: ISAKMP: SA life duration (basic) of 3600
41w0d: CryptoEngine0: validate proposal
41w0d: ISAKMP (0:3): atts are acceptable.
41w0d: IPSEC(validate_proposal_request): proposal part #1,
(key eng. msg.) INBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= AH, transform= ah-sha-hmac (Tunnel),
lifedur= 0s and 0kb,
spi= 0x0(0), conn_id= 0, keysize= 0, flags= 0x22
41w0d: IPSEC(validate_proposal_request): proposal part #2,
(key eng. msg.) INBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= ESP, transform= esp-3des (Tunnel),
lifedur= 0s and 0kb,
spi= 0x0(0), conn_id= 0, keysize= 0, flags= 0x22
41w0d: CryptoEngine0: validate proposal request
41w0d: IPSEC(kei_proxy): head = Sam08, map->ivrf = , kei->ivrf =
41w0d: CryptoEngine0: generate alg parameter
41w0d: CRYPTO_ENGINE: Dh phase 1 status: 0
41w0d: CRYPTO_ENGINE: Dh phase 1 status: 0
41w0d: ISAKMP (0:3): processing NONCE payload. message ID = -1451715169
41w0d: ISAKMP (0:3): processing KE payload. message ID = -1451715169
41w0d: CryptoEngine0: generate alg parameter
Dec 15 12:22:28: %SEC-6-IPACCESSLOGP: list s0.1-in denied tcp 172.200.1.59(1790) (Serial0/0.100 ) -> 172.40.207.65(445), 1 packet
41w0d: ISAKMP (0:3): processing ID payload. message ID = -1451715169
41w0d: ISAKMP (0:3): processing ID payload. message ID = -1451715169
41w0d: ISAKMP (0:3): asking for 2 spis from ipsec
41w0d: ISAKMP (0:3): Node -1451715169, Input = IKE_MESG_FROM_PEER, IKE_QM_EXCH
41w0d: ISAKMP (0:3): Old State = IKE_QM_READY New State = IKE_QM_SPI_STARVE
41w0d: IPSEC(key_engine): got a queue event...
41w0d: IPSEC(spi_response): getting spi 2097673135 for SA
from 192.168.100.1 to 192.168.100.2 for prot 2
41w0d: IPSEC(spi_response): getting spi 86976991 for SA
from 192.168.100.1 to 192.168.100.2 for prot 3
41w0d: ISAKMP: received ke message (2/2)
41w0d: CryptoEngine0: generate hmac context for conn id 3
41w0d: CryptoEngine0: ipsec allocate flow
41w0d: CryptoEngine0: ipsec allocate flow
41w0d: CryptoEngine0: clear dh number for conn id 1
41w0d: ISAKMP (0:3): Creating IPSec SAs
41w0d: inbound SA from 192.168.100.2 to 192.168.100.1 (f/i) 0/ 0
(proxy 172.38.2.0 to 172.36.1.0)
41w0d: has spi 0x7D07F3AF and conn_id 2016 and flags 23
41w0d: lifetime of 3600 seconds
41w0d: has client flags 0x0
41w0d: outbound SA from 192.168.100.1 to 192.168.100.2 (f/i) 0/ 0 (proxy 172.36.1.0 to 172.38.2.0 )
41w0d: has spi -195858819 and conn_id 2017 and flags 2B
41w0d: lifetime of 3600 seconds
41w0d: has client flags 0x0
41w0d: ISAKMP (0:3): Creating IPSec SAs
41w0d: inbound SA from 192.168.100.2 to 192.168.100.1 (f/i) 0/ 0
(proxy 172.38.2.0 to 172.36.1.0)
41w0d: has spi 0x52F29DF and conn_id 2018 and flags 23
41w0d: lifetime of 3600 seconds
41w0d: has client flags 0x0
41w0d: outbound SA from 192.168.100.1 to 192.168.100.2 (f/i) 0/ 0 (proxy 172.36.1.0 to 172.38.2.0 )
41w0d: has spi -195858818 and conn_id 2019 and flags 2B
41w0d: lifetime of 3600 seconds
41w0d: has client flags 0x0
41w0d: ISAKMP (0:3): sending packet to 192.168.100.2 my_port 500 peer_port 500 (R) QM_IDLE
41w0d: ISAKMP (0:3): Node -1451715169, Input = IKE_MESG_FROM_IPSEC, IKE_SPI_REPLY
41w0d: ISAKMP (0:3): Old State = IKE_QM_SPI_STARVE New State = IKE_QM_R_QM2
41w0d: IPSEC(key_engine): got a queue event...
41w0d: IPSEC(initialize_sas): ,
(key eng. msg.) INBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= AH, transform= ah-sha-hmac (Tunnel),
lifedur= 3600s and 0kb,
spi= 0x7D07F3AF(2097673135), conn_id= 2016, keysize= 0, flags= 0x23
41w0d: IPSEC(initialize_sas): ,
(key eng. msg.) OUTBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= AH, transform= ah-sha-hmac (Tunnel),
lifedur= 3600s and 0kb,
spi= 0xF4536E7D(4099108477), conn_id= 2017, keysize= 0, flags= 0x2B
41w0d: IPSEC(initialize_sas): ,
(key eng. msg.) INBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= ESP, transform= esp-3des (Tunnel),
lifedur= 3600s and 0kb,
spi= 0x52F29DF(86976991), conn_id= 2018, keysize= 0, flags= 0x23
41w0d: IPSEC(initialize_sas): ,
(key eng. msg.) OUTBOUND local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4),
protocol= ESP, transform= esp-3des (Tunnel),
lifedur= 3600s and 0kb,
spi= 0xF4536E7E(4099108478), conn_id= 2019, keysize= 0, flags= 0x2B
41w0d: IPSEC(kei_proxy): head = Sam08, map->ivrf = , kei->ivrf =
………………………………..
41w0d: IPSEC(crypto_ipsec_sa_find_ident_head): reconnecting with the same proxies and 192.168.100.2
41w0d: IPSEC(create_sa): sa created,
(sa) sa_dest= 192.168.100.1, sa_prot= 51,
sa_spi= 0x7D07F3AF(2097673135),
sa_trans= ah-sha-hmac , sa_conn_id= 2016
41w0d: IPSEC(create_sa): sa created,
(sa) sa_dest= 192.168.100.2, sa_prot= 51,
sa_spi= 0xF4536E7D(4099108477),
sa_trans= ah-sha-hmac , sa_conn_id= 2017
41w0d: IPSEC(create_sa): sa created,
(sa) sa_dest= 192.168.100.1, sa_prot= 50,
sa_spi= 0x52F29DF(86976991),
sa_trans= esp-3des , sa_conn_id= 2018
41w0d: IPSEC(create_sa): sa created,
(sa) sa_dest= 192.168.100.2, sa_prot= 50,
sa_spi= 0xF4536E7E(4099108478),
sa_trans= esp-3des , sa_conn_id= 2019
41w0d: ISAKMP (0:3): received packet from 192.168.100.2 dport 500 sport 500 Global (R) QM_IDLE
41w0d: CryptoEngine0: generate hmac context for conn id 3
41w0d: ISAKMP (0:3): deleting node -1451715169 error FALSE reason "quick mode done (await)"
41w0d: ISAKMP (0:3): Node -1451715169, Input = IKE_MESG_FROM_PEER, IKE_QM_EXCH
41w0d: ISAKMP (0:3): Old State = IKE_QM_R_QM2 New State = IKE_QM_PHASE2_COMPLETE
41w0d: IPSEC(key_engine): got a queue event...
41w0d: IPSEC(key_engine_enable_outbound): rec'd enable notify from ISAKMP
41w0d: IPSEC(key_engine_enable_outbound): enable SA with spi 4099108477/51 for 192.168.100.2
41w0d: IPSEC(add_sa): have new SAs -- expire existing in 30 sec.,
(sa) sa_dest= 192.168.100.1, sa_prot= 51,
sa_spi= 0x6101A0A(101718538),
sa_trans= ah-sha-hmac , sa_conn_id= 2012,
(identity) local= 192.168.100.1, remote= 192.168.100.2,
local_proxy= 172.36.1.0/255.255.255.0/0/0 (type=4),
remote_proxy= 172.38.2.0/255.255.255.0/0/0 (type=4)
(sa) sa_dest= 192.168.100.1, sa_prot= 51,
sa_spi= 0x6101A0A(101718538),
sa_trans= ah-sha-hmac , sa_conn_id= 2012
41w0d: IPSEC(delete_sa): deleting SA,
(sa) sa_dest= 192.168.100.2, sa_prot= 51,
sa_spi= 0xF4536E7B(4099108475),
sa_trans= ah-sha-hmac , sa_conn_id= 2013
41w0d: IPSEC(delete_sa): deleting SA,
(sa) sa_dest= 192.168.100.1, sa_prot= 50,
sa_spi= 0x8A8C6E0C(2324459020),
sa_trans= esp-3des , sa_conn_id= 2014
41w0d: IPSEC(delete_sa): deleting SA,
(sa) sa_dest= 192.168.100.2, sa_prot= 50,
sa_spi= 0xF4536E7C(4099108476),
sa_trans= esp-3des , sa_conn_id= 2015
41w0d: ISAKMP: received ke message (3/2)
41w0d: ISAKMP: set new node 1458435346 to QM_IDLE
41w0d: CryptoEngine0: generate hmac context for conn id 3
41w0d: ISAKMP (0:3): sending packet to 192.168.100.2 my_port 500 peer_port 500 (R) QM_IDLE
41w0d: ISAKMP (0:3): Input = IKE_MESG_FROM_IPSEC, IKE_PHASE2_DEL
41w0d: ISAKMP (0:3): Old State = IKE_P1_COMPLETE New State = IKE_P1_COMPLETE
41w0d: ISAKMP (0:3): retransmitting phase 2 QM_IDLE 1458435346 ...
41w0d: ISAKMP (0:3): incrementing error counter on node: retransmit phase 2
41w0d: ISAKMP (0:3): incrementing error counter on sa: retransmit phase 2
41w0d: ISAKMP (0:3): retransmitting phase 2 1458435346 QM_IDLE
41w0d: ISAKMP (0:3): sending packet to 192.168.100.2 my_port 500 peer_port 500 (R) QM_IDLE
……………………………………..