Задача - создать туннели LAN-to-LAN с авторизацией по X.509 сертификатам.
Есть самоподписанный CA. Порядка 25 точек на 200/210/800 D-Link'ах с уже поднятыми туннелями на Х.509.
CA - 2048 бит ключ.
Код:
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Subject Key Identifier:
блабла
X509v3 Authority Key Identifier:
блабла
Netscape Cert Type:
Object Signing, SSL CA, S/MIME CA, Object Signing CA
X509v3 Key Usage:
Digital Signature, Non Repudiation, Certificate Sign, CRL Sign
Netscape Comment:
Root CA Certificate 2010
Чего я не могу никак понять:
1. Создаём туннель, заводим на PSK - работает, туннель в порядке.
2. Меняем авторизацию на Х.509, поскольку в доке описано не однозначно, для разных случаев по разному, была подобрана ранее конфигурация:
Root Certificates - вносим CA и Remote от удаленной точки, т.е. оба удаленные, содержащие в себе public key.
Gateway Certificate - вносим Local от местной точки, т.е. содержащий ещё и private key, для дешифрования трафика и подписи.
В 2.25-26 работало. Иногда (на памяти 2 раза, когда начинались чудеса, не хотел вносить Remote в список под предлогом того, что он не может быть trusted root, фиг с ним, перегенерация сертификата помогала вроде)
3. В 2.27.0 началось. Два 210 между собой завелись на туннелях.
800 с 210 НАПРОЧЬ отказываются. Либо Remote не может быть trusted root и туннель кладется в disable, либо:
800 (на нём keep-alive, для поддержки туннеля):
Код:
2011-04-06
09:49:34 Info IPSEC
1800317 peer_is_dead
IPsec_tunnel_disabled
peer=10.0.0.2
2011-04-06
09:49:34 Info IPSEC
1802708 ike_sa_destroyed
ike_sa_killed
ike_sa=" Initiator SPI ESP=0x15022ccb, AH=0xd4012a1c, IPComp=0xdbfe053"
2011-04-06
09:49:34 Warning IPSEC
1802022 ike_sa_failed
no_ike_sa
statusmsg="Authentication failed" local_peer="10.0.0.1 ID ххх.mgn.ru" remote_peer="10.0.0.2 ID No Id" initiator_spi="ESP=0x15022ccb, AH=0xd4012a1c, IPComp=0xdbfe0539"
2011-04-06
09:49:34 Warning IPSEC
1802715 event_on_ike_sa
side=Initiator msg="failed" int_severity=6
210:
Код:
2011-04-06
10:17:43 Info IPSEC
1802708 ike_sa_destroyed
ike_sa_killed
ike_sa=" Initiator SPI ESP=0xa9c19f55, AH=0x4a150355, IPComp=0xe7da873"
2011-04-06
10:17:43 Warning IPSEC
1802022 ike_sa_failed
no_ike_sa
statusmsg="Authentication failed" local_peer="10.0.0.2 ID No Id" remote_peer="10.0.0.1 ID ххх.mgn.ru" initiator_spi="ESP=0xa9c19f55, AH=0x4a150355, IPComp=0xe7da873d"
2011-04-06
10:17:43 Warning IPSEC
1802715 event_on_ike_sa
side=Responder msg="failed" int_severity=6
2011-04-06
10:17:43 Warning IPSEC
1802718 certificate_search_failed
certificate_failure
reason="Certificate chain looped (did not find trusted root)" int_severity=6
2011-04-06
10:17:43 Info IPSEC
1803040 failed_to_verify_peer_identity
2011-04-06
10:17:43 Warning IPSEC
1802715 event_on_ike_sa
side=Responder msg="failed" int_severity=6
Выдержка из ikesnoop -on 10.0.0.1 -verbose :
Код:
Ike snooping is active - verbose mode; snooping address 10.0.0.1
2011-04-06 09:49:43: IkeSnoop: Received IKE packet from 10.0.0.1:500
Exchange type : Identity Protection (main mode)
ISAKMP Version : 1.0
Flags :
Cookies : 0xee2cf57353beef81 -> 0x00000000
Message ID : 0x00000000
Packet length : 296 bytes
# payloads : 3
Payloads:
SA (Security Association)
Payload data length : 224 bytes
DOI : 1 (IPsec DOI)
Proposal 1/1
Protocol 1/1
Protocol ID : ISAKMP
SPI Size : 0
Transform 1/6
Transform ID : IKE
Encryption algorithm : Rijndael-cbc (aes)
Key length : 128
Hash algorithm : MD5
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
Transform 2/6
Transform ID : IKE
Encryption algorithm : Rijndael-cbc (aes)
Key length : 128
Hash algorithm : SHA
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
Transform 3/6
Transform ID : IKE
Encryption algorithm : 3DES-cbc
Hash algorithm : MD5
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
Transform 4/6
Transform ID : IKE
Encryption algorithm : 3DES-cbc
Hash algorithm : SHA
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
Transform 5/6
Transform ID : IKE
Encryption algorithm : Blowfish-cbc
Key length : 128
Hash algorithm : MD5
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
Transform 6/6
Transform ID : IKE
Encryption algorithm : Blowfish-cbc
Key length : 128
Hash algorithm : SHA
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 8f 9c c9 4e 01 24 8e cd f1 47 59 4c 28 4b 21 3b
Description : SSH Communications Security QuickSec 2.1.0
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : af ca d7 13 68 a1 f1 c9 6b 86 96 fc 77 57 01 00
Description : draft-ietf-ipsec-dpd-00
2011-04-06 09:49:43: IkeSnoop: Sending IKE packet to 10.0.0.1:500
Exchange type : Identity Protection (main mode)
ISAKMP Version : 1.0
Flags :
Cookies : 0xee2cf57353beef81 -> 0xc9c5133c959656c
Message ID : 0x00000000
Packet length : 264 bytes
# payloads : 10
Payloads:
SA (Security Association)
Payload data length : 52 bytes
DOI : 1 (IPsec DOI)
Proposal 1/1
Protocol 1/1
Protocol ID : ISAKMP
SPI Size : 0
Transform 1/1
Transform ID : IKE
Encryption algorithm : Rijndael-cbc (aes)
Key length : 128
Hash algorithm : MD5
Authentication method : RSA Signatures
Group description : MODP 1024
Life type : Seconds
Life duration : 28800
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 8f 9c c9 4e 01 24 8e cd f1 47 59 4c 28 4b 21 3b
Description : SSH Communications Security QuickSec 2.1.0
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 27 ba b5 dc 01 ea 07 60 ea 4e 31 90 ac 27 c0 d0
Description : draft-stenberg-ipsec-nat-traversal-01
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 61 05 c4 22 e7 68 47 e4 3f 96 84 80 12 92 ae cd
Description : draft-stenberg-ipsec-nat-traversal-02
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 44 85 15 2d 18 b6 bb cd 0b e8 a8 46 95 79 dd cc
Description : draft-ietf-ipsec-nat-t-ike-00
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : cd 60 46 43 35 df 21 f8 7c fd b2 fc 68 b6 a4 48
Description : draft-ietf-ipsec-nat-t-ike-02
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 90 cb 80 91 3e bb 69 6e 08 63 81 b5 ec 42 7b 1f
Description : draft-ietf-ipsec-nat-t-ike-02
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 7d 94 19 a6 53 10 ca 6f 2c 17 9d 92 15 52 9d 56
Description : draft-ietf-ipsec-nat-t-ike-03
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : 4a 13 1c 81 07 03 58 45 5c 57 28 f2 0e 95 45 2f
Description : RFC 3947
VID (Vendor ID)
Payload data length : 16 bytes
Vendor ID : af ca d7 13 68 a1 f1 c9 6b 86 96 fc 77 57 01 00
Description : draft-ietf-ipsec-dpd-00
2011-04-06 09:49:43: IkeSnoop: Received IKE packet from 10.0.0.1:500
2011-04-06 09:49:43: IkeSnoop: Other end retransmitted its packet
2011-04-06 09:49:43: IkeSnoop: Received IKE packet from 10.0.0.1:500
Exchange type : Identity Protection (main mode)
ISAKMP Version : 1.0
Flags :
Cookies : 0xee2cf57353beef81 -> 0xc9c5133c959656c
Message ID : 0x00000000
Packet length : 345 bytes
# payloads : 3
Payloads:
KE (Key Exchange)
Payload data length : 128 bytes
NONCE (Nonce)
Payload data length : 16 bytes
CR (Certificate Request)
Payload data length : 161 bytes
Certificate type : X.509 signature
2011-04-06 09:49:44: IkeSnoop: Sending IKE packet to 10.0.0.1:500
Exchange type : Identity Protection (main mode)
ISAKMP Version : 1.0
Flags :
Cookies : 0xee2cf57353beef81 -> 0xc9c5133c959656c
Message ID : 0x00000000
Packet length : 344 bytes
# payloads : 3
Payloads:
KE (Key Exchange)
Payload data length : 128 bytes
NONCE (Nonce)
Payload data length : 16 bytes
CR (Certificate Request)
Payload data length : 160 bytes
Certificate type : X.509 signature
2011-04-06 09:49:44: IkeSnoop: Received IKE packet from 10.0.0.1:500
Exchange type : Identity Protection (main mode)
ISAKMP Version : 1.0
Flags : E (encryption)
Cookies : 0xee2cf57353beef81 -> 0xc9c5133c959656c
Message ID : 0x00000000
Packet length : 1416 bytes
# payloads : 4
Payloads:
ID (Identification)
Payload data length : 19 bytes
ID : fqdn(any:0,[0..14]=ххх.mgn.ru)
CERT (Certificate)
Payload data length : 1089 bytes
Encoding type : X.509 signature
Issuer : C=RU, ST=Chelyabinsk, L=ххх, O=ххх, OU=IT, CN=CA Certificate, MAILTO=ххх@xxx.ru
Subject : C=RU, ST=Chelyabinsk, L=ххх, O=ххх, OU=IT, CN=ххх.mgn.ru, MAILTO=ххх@xxx.ru
Valid from : 2010 Jun 22nd, 09:35:30 GMT
Valid to : 2015 Jun 22nd, 09:35:30 GMT
Subject alternative names :
DNS = ххх.mgn.ru
RFC822 = ххх@xxx.ru
SIG (Signature)
Payload data length : 256 bytes
N (Notification)
Payload data length : 8 bytes
Protocol ID : ISAKMP
Notification : Initial contact
2011-04-06 09:49:44: IkeSnoop: Sending IKE packet to 10.0.0.1:500
Exchange type : Informational
ISAKMP Version : 1.0
Flags :
Cookies : 0xee2cf57353beef81 -> 0xc9c5133c959656c
Message ID : 0x36a4cf08
Packet length : 87 bytes
# payloads : 1
Payloads:
N (Notification)
Payload data length : 55 bytes
Protocol ID : ISAKMP
Notification : Authentication failed
Notification data:
Notify message version: 1
Error text: "No public key found"
Offending message ID: 0x00000000
Отключал проверку CRL.
Вообще смотрю по доке к 2.27.х - вроде как Remote сертификат не обязателен в туннеле.
Итоговые вопросы:
1. Что такого изменили в 2.27.х?
2. Какие сертификаты и в каком количестве надо вбивать в Root Certificate(s) в поле X.509? (Вроде по доке там вообще должен быть ТОЛЬКО один CA).