iPhone und VPN on demand (IPSec mit Zertifikaten)

Forum zum Thema allgemeinen Fragen zu VPN

Moderator: Lancom-Systems Moderatoren

jansen
Beiträge: 5
Registriert: 17 Aug 2007, 08:31

Beitrag von jansen »

Hallo,

ich schliesse mich der Bitte um Hilfe an.
Ich wurde dazu verdonnert, einem IPhone VPN gegen einen 1611+ beizubringen. Per PSK war das ja auch kein Problem, aber sofort ging das Genörgele darüber los, dass ständig manuell (re)connected werden muss. Also muss VPN on demand her, d.h. Konfiguration mit Zertifikaten. Auf das Telefon werde ich aber leider höchstens nochmal 2-3 Stunden Zugriff bekommen, damit lässt sich natürlich nicht sinnvoll testen. Und einen IPhone-Simulator, der das Testen der VPN-Verbindungen zulässt, gibt es m.W. ja auch nicht.

Es wäre deshalb schön, wenn jemand die Zeit fände, die obigen Hinweise, vielleicht auch die per PM vermittelten, in einer Art Step-byStep-Doku zusammenzufassen. Falls ich dabei auf irgendeine Weise helfen kann dann bitte Bescheid geben.

Alternativ könnte mir natürlich auch jemand für ein paar Tage ein IPhone borgen, dann schreibe ich die Doku! ;)
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

Beitrag von mongostyles »

Hallo,

hol das Thema mal wieder hoch, will kein neues eröffnen!
Hab Probleme mit einem Konfigurierten Lancom und iOS Geräten, Zertifikate sind soweit korrekt erstellt, "normales" VPN mit Soft Clients geht problemlos.
Wenn sich die iOS Geräte melden erhalte ich:

Default x509_string_XN: X509_NAME_add_entry_by_txt() failed

jemand ne Idee?
Cytor
Beiträge: 160
Registriert: 17 Mai 2012, 15:19

Beitrag von Cytor »

Hi,

wie sieht das Subject deines Zertifikats aus? Irgendwelche Umlaute und/oder Sonderzeichen drin?
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

Beitrag von mongostyles »

Hallo Cytor,

ja die Subjects waren bis dato ein Problem, darüber bin ich aber inzwischen selbst gestolpert.

Leider bin ich noch nocht ganz durch,
das iOS sagt mit beim Verbindungs Aufbau "Serverzertifikat konnte nicht überprüft werden"
Den DNS:dnsname als Alternitive habe ich im iOS Zertifikat angegeben.

der Trace des Routers:

Code: Alles auswählen

IKE info: The remote peer def-main-peer supports NAT-T in RFC mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote server 109.43.214.35:500 (UDP) peer def-main-peer id <no_id> supports draft-ietf-ipsec-isakmp-xauth
IKE info: The remote server 109.43.214.35:500 (UDP) peer def-main-peer id <no_id> negotiated rfc-3706-dead-peer-detection

[VPN-Status] 2012/07/21 11:18:30,184
IKE info: Phase-1 remote proposal 1 for peer def-main-peer matched with local proposal 1

[VPN-Status] 2012/07/21 11:18:31,485
IKE info: Phase-1 [responder] got INITIAL-CONTACT from peer XX_IPAD (109.43.214.35)

[VPN-Status] 2012/07/21 11:18:31,756
IKE info: Phase-1 [responder] for peer XX_IPAD between initiator id E=user@domain.de,CN=xx_ipad,OU=VPN,O=name,L=stadt,ST=BAWUE,C=DE, responder id E=user@domain.de,CN=vpn.domain-name.de,OU=VPN,O=name,L=Stadt,ST=BAWUE,C=DE done
IKE info: SA ISAKMP for peer XX_IPAD encryption aes-cbc authentication sha1
IKE info: life time ( 3600 sec/ 0 kb)

[VPN-Status] 2012/07/21 11:18:31,757
IKE info: Phase-1 SA Rekeying Timeout (Soft-Event) for peer XX_IPAD set to 3240 seconds (Responder)

[VPN-Status] 2012/07/21 11:18:31,757
IKE info: Phase-1 SA Timeout (Hard-Event) for peer XX_IPAD set to 3600 seconds (Responder)

[VPN-Status] 2012/07/21 11:18:31,900
IKE log: 111831.000000 Default message_parse_payloads: reserved field non-zero: c3

[VPN-Status] 2012/07/21 11:18:31,900
IKE log: 111831.000000 Default dropped message from 109.43.214.35 port 500 due to notification type PAYLOAD_MALFORMED

[VPN-Status] 2012/07/21 11:18:31,901
IKE info: dropped message from peer XX_IPAD 109.43.214.35 port 500 due to notification type PAYLOAD_MALFORMED
vieleicht noch ne Idee?
Wird sicher was banales sein :(
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

Beitrag von mongostyles »

hat sich erledigt, das zertifikat auf dem iOS war "schrott"
habs nochmal neu erstellt und siehe da!

Gruss und Danke!
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

VPN mit iOS6

Beitrag von mongostyles »

Hallo zusammen,

dacht ich schreib mal hier, bevor ich ein neues Thema aufmache.
Wir nutzen u.A. auch bei einigen Kunden VPN mit Zertifikaten, und Lancom Gateways, was ja soweit auch perfekt funktioniert.

Seit iOS6 ist das aber mit nichten zum Laufen zu bewegen,
auf den Apple Geräten erscheitn "Kommunikation mit dem Server fehlgeschlagen",
wenn man während des Verbindungsaufbaus die Konsole (iPhone Konfiguration Tool) anschaut erschein folgendes

Code: Alles auswählen

Oct  1 13:51:54 iPad-von-xy racoon[1297] <Notice>: accepted connection on vpn control socket.
Oct  1 13:51:54 iPad-von-xy racoon[1297] <Notice>: IPSec connecting to server 217.92.34.131
Oct  1 13:51:54 iPad-von-xy racoon[1297] <Notice>: IPSec Phase1 started (Initiated by me).
Oct  1 13:51:54 iPad-von-xy racoon[1297] <Notice>: >>>>> phase change status = phase 1 started by us
Oct  1 13:51:54 iPad-von-xy configd[49] <Notice>: network changed: v4(en0:192.168.2.100, pdp_ip0) DNS* Proxy
Oct  1 13:51:54 iPad-von-xy racoon[1297] <Notice>: >>>>> phase change status = phase 1 started by peer
Oct  1 13:51:54 iPad-von-xy configd[49] <Notice>: network changed: v4(en0:192.168.2.100, pdp_ip0) DNS* Proxy
Oct  1 13:51:55 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:51:55 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:51:58 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:51:58 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:01 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:01 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:04 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:04 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:16 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:16 iPad-von-xy racoon[1297] <Error>: unknown Informational exchange received.
Oct  1 13:52:24 iPad-von-xy configd[49] <Notice>: IPSec disconnecting from server 111.222.333.444
Oct  1 13:52:24 iPad-von-xy configd[49] <Notice>: network changed: v4(en0:192.168.2.100, pdp_ip0) DNS* Proxy
Oct  1 13:52:24 iPad-von-xy configd[49] <Notice>: network changed: v4(en0:192.168.2.100, pdp_ip0) DNS* Proxy
Oct  1 13:52:24 iPad-von-xy racoon[1297] <Notice>: IPSec disconnecting from server 111.222.333.444
Oct  1 13:52:24 iPad-von-xy racoon[1297] <Error>: failed to send vpn_control message: Broken pipe
Oct  1 13:52:24 iPad-von-xy racoon[1297] <Warning>: glob found no matches for path "/var/run/racoon/*.conf"
Oct  1 13:52:24 iPad-von-xy racoon[1297] <Notice>: IPSec disconnecting from server 111.222.333.444
Im Router Trace erscheint folgendes:

Code: Alles auswählen

[VPN-Status] 2012/10/01 14:19:44,824
IKE info: The remote peer def-main-peer supports NAT-T in RFC mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote server 95.208.212.3:500 (UDP) peer def-main-peer id <no_id> supports draft-ietf-ipsec-isakmp-xauth
IKE info: The remote server 95.208.212.3:500 (UDP) peer def-main-peer id <no_id> negotiated rfc-3706-dead-peer-detection


[VPN-Status] 2012/10/01 14:19:44,825
IKE info: Phase-1 remote proposal 1 for peer def-main-peer matched with local proposal 1


[VPN-Status] 2012/10/01 14:19:45,651
IKE log: 141945.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:45,651
IKE log: 141945.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:45,651
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:45,651
IKE log: 141945.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:45,652
IKE log: 141945.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:45,652
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:48,668
IKE log: 141948.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:48,668
IKE log: 141948.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:48,668
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:48,668
IKE log: 141948.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:48,669
IKE log: 141948.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:48,669
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:50,505
IKE info: NOTIFY received of type ISAKMP_NOTIFY_DPD_R_U_THERE for peer MK_WORKSTATION Seq-Nr 0x247da834, expected 0x247da834


[VPN-Status] 2012/10/01 14:19:50,505
IKE info: ISAKMP_NOTIFY_DPD_R_U_THERE_ACK sent for Phase-1 SA to peer MK_WORKSTATION, sequence nr 0x247da834


[VPN-Status] 2012/10/01 14:19:51,708
IKE log: 141951.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:51,708
IKE log: 141951.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:51,708
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:51,711
IKE log: 141951.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:51,711
IKE log: 141951.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:51,712
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:54,745
IKE log: 141954.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:54,745
IKE log: 141954.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:54,745
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:54,748
IKE log: 141954.000000 Default message_recv: invalid payload type 132 in ISAKMP header (check passphrases, if applicable and in Phase 1)


[VPN-Status] 2012/10/01 14:19:54,748
IKE log: 141954.000000 Default dropped message from 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE


[VPN-Status] 2012/10/01 14:19:54,748
IKE info: dropped message from peer unknown 95.208.212.3 port 4294950912 due to notification type INVALID_PAYLOAD_TYPE

[TELNET] INFO: DISCONNECTED
Hat jemand eine Idee?

Gruss
findler
Beiträge: 54
Registriert: 16 Aug 2007, 10:50

Beitrag von findler »

IOS 6 hat Probleme mit fragmentierten UDP Paketen (oder Lancom tut sich damit schwer?)

Workaround: minimale Root & Client Zertifikate verwenden (z.b. /CN=a mit 1024 bit key) oder PSK verwenden (damit gehts mit ios 6 und OS X)

Mehr zu dem Thema google nach: ios 6 VPN UDP fragmentation

https://discussions.apple.com/message/19684739#19684739
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

Beitrag von mongostyles »

hmm, ärgerlich . . .
danke findler für den Hinweis.
Ist den schon bekannt ob Lancom und oder Apple hier was tun wird?

Klar, kann man bei zwei, drei Geräten den Workarround umsetzen,
aber bei größeren Umgebungen ist das einfach undenkbar ;)

Grüße
mongostyles
Beiträge: 68
Registriert: 06 Jul 2010, 13:37

iOS 6.1 es soll ja wieder tun...

Beitrag von mongostyles »

Guten Morgen,

laut meiner Recherche soll ab dem 6.1er iOS das Problem mit der Fragmentierung wieder behoben sein!
Ich habe es gerade getestet, scheitere jedoch trotzdem der trace:

Code: Alles auswählen

[VPN-Status] 2013/02/12 08:45:27,255  Devicetime: 2013/02/12 08:45:28,527
IKE info: Phase-1 [responder] for peer def-main-peer between initiator id E=user@email.de,CN=iphone,OU=VPN,O=BC,L=XY,ST=BAWUE,C=DE, responder id E=user@email.de,CN=vpn.domain.de,OU=VPN,O=BC,L=XY,ST=BAWUE,C=DE done
IKE info: NAT-T enabled in mode rfc, we are not behind a nat, the remote side is behind a nat
IKE info: SA ISAKMP for peer def-main-peer encryption aes-cbc authentication sha1
IKE info: life time ( 3600 sec/ 0 kb)

[VPN-Status] 2013/02/12 08:45:27,255  Devicetime: 2013/02/12 08:45:28,528
IKE info: Phase-1 SA Rekeying Timeout (Soft-Event) for peer def-main-peer set to 3240 seconds (Responder)

[VPN-Status] 2013/02/12 08:45:27,255  Devicetime: 2013/02/12 08:45:28,528
IKE info: Phase-1 SA Timeout (Hard-Event) for peer def-main-peer set to 3600 seconds (Responder)
Konfiguration ist die selbe die bei iOS 5.x noch tat.

Grüße
findler
Beiträge: 54
Registriert: 16 Aug 2007, 10:50

Beitrag von findler »

Seit der 6.1 geht alles wieder.
alexw
Beiträge: 40
Registriert: 01 Jan 2005, 01:15

Beitrag von alexw »

Also ich komme hier bei dieser Sache auch nicht wirklich weiter.
Verbindung mittels PSK ist gar kein Problem. Per Zertifikat möchte aber einfach nicht funktionieren.
VPN mittels Zertifikat über Shrew funktioniert auch einwandfrei.
Ich habe auch schon versucht minimale root und client certs zu benutzen, aber auch das hilft nicht.
Hier der Log:

Code: Alles auswählen

[VPN-Status] 2013/03/24 16:04:31,842
IKE info: The remote peer def-main-peer supports NAT-T in RFC mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote peer def-main-peer supports NAT-T in draft mode
IKE info: The remote server 176.199.40.198:3500 (UDP) peer def-main-peer id <no_id> supports draft-ietf-ipsec-isakmp-xauth
IKE info: The remote server 176.199.40.198:3500 (UDP) peer def-main-peer id <no_id> negotiated rfc-3706-dead-peer-detection


[VPN-Status] 2013/03/24 16:04:31,843
IKE info: phase-1 proposal failed: remote No 1 group = 5 <-> local No 1 group = 2
IKE info: Phase-1 remote proposal 1 failed for peer def-main-peer
IKE info: Phase-1 remote proposal 2 for peer def-main-peer matched with local proposal 1


[VPN-Status] 2013/03/24 16:04:32,818
IKE log: 160432.818055 Default rsa_sig_decode_hash: no CERT subject match the ID


[VPN-Status] 2013/03/24 16:04:32,818
IKE log: 160432.818230 Default rsa_sig_decode_hash: no public key found


[VPN-Status] 2013/03/24 16:04:32,818
IKE log: 160432.818356 Default dropped message from 176.x.x.x port 5500 due to notification type INVALID_HASH_INFORMATION
Ok, Fehler sagt mir, dass er keine passende Identität finden kann? Bei einem "/DN=ip" für client und "/DN=test" gibts aber nicht viel falsch einzugeben ;)
Auch der Konsolenlog vom iPhone hilft nicht wirklich weiter. Irgendwer noch eine Idee für mich?
backslash
Moderator
Moderator
Beiträge: 7129
Registriert: 08 Nov 2004, 21:26
Wohnort: Aachen

Beitrag von backslash »

Hi alexw
[VPN-Status] 2013/03/24 16:04:32,818
IKE log: 160432.818055 Default rsa_sig_decode_hash: no CERT subject match the ID
diese Fehlermeldung sollte dir doch schon sagen, was nicht stimmt:

Keine der im LANCOM konfigurierten Identitäten (siehe VPN -> IKE-Auth. IKE-Schlüssel und identitäten) paßt zu der im Zertifikat übermittelten (Subject = Identiträt)...

Hier stimmt also entweder das Zertifikat nicht oder du hast dich bei der Eingabe der (entfernten) Identität vertippt...

Gruß
Backslash
alexw
Beiträge: 40
Registriert: 01 Jan 2005, 01:15

Beitrag von alexw »

Hi backslash,

ganz genau so habe ich die Fehlermeldung auch verstanden. Ich kann das Zertifikat einem Shrew vorwerfen und es funktioniert, nur eben im Zusammenspiel mit dem IPSec von iOS mag das nicht.
Da ich das nicht nachvollziehen kann, habe ich mir auch extra minimale Certs für Router und iPhone erstellt, ebenfalls ohne Erfolg.

Kann man denn nicht anzeigen lassen was das iOS an den lancom geschickt hat, also was der lancom versucht zu finden? Der Log vom iPhone ist jedenfalls unbrauchbar.
findler
Beiträge: 54
Registriert: 16 Aug 2007, 10:50

Beitrag von findler »

Antworten