OPNsense Forum

International Forums => German - Deutsch => Topic started by: its-me on September 04, 2019, 10:15:35 am

Title: IPsec/Mehrere Phase2
Post by: its-me on September 04, 2019, 10:15:35 am
Hallo :)

ich nutze eine OPNsense 19.7.3 mit einem IKEv1 IPsec-Tunnel zu einem Remote-Standort. Die Hardware-Konfiguration am Remote-Standort ist unbekannt. Die OPNsense ersetzt seit kurzem eine pfSense, mit der der Tunnel wunderbar funktioniert hat. Der Zugriff vom lokalen Netz zu zwei Remote-Netzen wird durch ein NAT der OPNsense geleitet. Der Zugriff von Remote zu Lokal ist nicht freigegeben.
Für den Zugriff in die beiden Remote-Netze ist in der IPsec-Konfigurationjeweils ein Phase2-Eintrag hinterlegt sowie jeweils ein One-to-One NAT-Eintrag.
Nun zum Problem (welches mit der pfSense nicht bestand): während des Tunnel-Aufbaus ist zunächst eines der beiden durch die Phsae2-Einträge angegebenen Netze erreichbar. Nach kurzer Zeit wird der zweite Phase2-Eintrag abgearbeitet und die Verbindung zum zweiten Netzbereich hergestellt, und sobald dieser verbunden ist, ist der erste Netzbereich nicht mehr erreichbar. In Phase1 habe ich es sowohl mit "Tunnel Isolation" aktiviert als auch mit deaktiviert ausprobiert, das macht leider keinen Unterschied.
Hast du eine Idee, woran es liegen könnte?
Danke!
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 04, 2019, 11:26:41 am
Screenshots von P1 und P2 bitte :)
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 04, 2019, 11:41:00 am
Sehr gern :)
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 04, 2019, 11:45:18 am
Und dazu gibt es noch die one-to-one nat rules
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 04, 2019, 11:50:56 am
Wieso ist in P1 nicht "Install Policy" angeklickt?
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 04, 2019, 12:13:16 pm
Install Policy war in der alten Konfiguration auch nicht aktiv. Ich habe es zum Testen jetzt aktiviert, es macht aber keinen Unterschied :/
Was passiert im Hintergrund wenn das aktiv ist?

Bei Phase2-2 ist auf dem Screenshot "Disabled" gesetzt damit der andere Subnetzbereich definitiv verbunden bleibt, der ist nämlich etwas wichtiger.
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 04, 2019, 01:06:45 pm
Ich würde noch tunnel isolation raus, nat refelection auf disabled und den automatically ping raus.

Und dann die Logs bitte wenn das eine geht und das erste nicht mehr.
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 04, 2019, 03:31:29 pm
danke, aber das geht leider auch nicht. wie detailliert sollen die Logs denn sein?
In der Oberfläche werden auch leider immer nur ein paar log-Einträge angezeigt. Den gesamten Log-Stream müsste ich dann ja am besten in eine Datei umleiten?
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 04, 2019, 08:14:46 pm
Console, clog -f /var/log/ipsec.log
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 05, 2019, 10:39:59 am
Anbei die ipsec.log als zip, sonst ist sie zu groß!
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 05, 2019, 11:30:48 am
Ist das die Datei selbst? clog format ist ja binary .. das ist bisschen eklig im Editor.
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 05, 2019, 12:35:03 pm
ich hab die Datei ipsec.log über WinSCP kopiert, sensitive informationen mit notepad++ entfernt, gezippt und dann hoch geladen - da war nix im Binärformat :)
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 05, 2019, 12:49:25 pm
ah ok, kannst du bitte das debug raus machen .. ist sonst unleserlich, sorry.
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 05, 2019, 12:58:23 pm
Mit log-level Basic sieht es so aus:

Code: [Select]
Sep  5 13:01:11 OPNsense charon: 00[DMN] Starting IKE charon daemon (strongSwan 5.8.0, FreeBSD 11.2-RELEASE-p14-HBSD, amd64)
Sep  5 13:01:11 OPNsense charon: 00[KNL] unable to set UDP_ENCAP: Invalid argument
Sep  5 13:01:11 OPNsense charon: 00[NET] enabling UDP decapsulation for IPv6 on port 4500 failed
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading ca certificates from '/usr/local/etc/ipsec.d/cacerts'
Sep  5 13:01:11 OPNsense charon: 00[CFG]   loaded ca certificate "C=DE, xxxxxx, CN=internal-sslvpn-ca" from '/usr/local/etc/ipsec.d/cacerts/41101fc5.0.crt'
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading aa certificates from '/usr/local/etc/ipsec.d/aacerts'
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading ocsp signer certificates from '/usr/local/etc/ipsec.d/ocspcerts'
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading attribute certificates from '/usr/local/etc/ipsec.d/acerts'
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading crls from '/usr/local/etc/ipsec.d/crls'
Sep  5 13:01:11 OPNsense charon: 00[CFG] loading secrets from '/usr/local/etc/ipsec.secrets'
Sep  5 13:01:11 OPNsense charon: 00[CFG]   loaded IKE secret for xxx.xxx.xxx.xxx
Sep  5 13:01:11 OPNsense charon: 00[CFG] expanding file expression '/usr/local/etc/ipsec.secrets.opnsense.d/*.secrets' failed
Sep  5 13:01:11 OPNsense charon: 00[CFG] loaded 0 RADIUS server configurations
Sep  5 13:01:11 OPNsense charon: 00[LIB] loaded plugins: charon aes des blowfish rc2 sha2 sha1 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf curve25519 xcbc cmac hmac gcm attr kernel-pfkey kernel-pfroute resolve socket-default stroke vici updown eap-identity eap-md5 eap-mschapv2 eap-radius eap-tls eap-ttls eap-peap xauth-generic xauth-eap xauth-pam whitelist addrblock counters
Sep  5 13:01:11 OPNsense charon: 00[JOB] spawning 16 worker threads
Sep  5 13:01:11 OPNsense charon: 16[CFG] received stroke: add connection 'con1-000'
Sep  5 13:01:11 OPNsense charon: 16[CFG] added configuration 'con1-000'
Sep  5 13:01:11 OPNsense charon: 05[CFG] received stroke: route 'con1-000'
Sep  5 13:01:11 OPNsense charon: 15[CFG] received stroke: add connection 'con1-001'
Sep  5 13:01:11 OPNsense charon: 15[CFG] added child to existing configuration 'con1-000'
Sep  5 13:01:11 OPNsense charon: 05[CFG] received stroke: route 'con1-001'
Sep  5 13:01:16 OPNsense charon: 05[NET] <1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (288 bytes)
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> parsed ID_PROT request 0 [ SA V V V V V V V V V ]
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received DPD vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-stenberg-ipsec-nat-traversal-01 vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-stenberg-ipsec-nat-traversal-02 vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-ietf-ipsec-nat-t-ike-00 vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-ietf-ipsec-nat-t-ike-02 vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-ietf-ipsec-nat-t-ike-02\n vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received draft-ietf-ipsec-nat-t-ike-03 vendor ID
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> received NAT-T (RFC 3947) vendor ID
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> received unknown vendor ID: 69:93:69:22:87:41:c6:d4:ca:09:4c:93:e2:42:c9:de:19:e7:b7:c6:00:00:00:05:00:00:05:00
Sep  5 13:01:16 OPNsense charon: 05[IKE] <1> xxx.xxx.xxx.xxx is initiating a Main Mode IKE_SA
Sep  5 13:01:16 OPNsense charon: 05[CFG] <1> selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_1024
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> generating ID_PROT response 0 [ SA V V V ]
Sep  5 13:01:16 OPNsense charon: 05[NET] <1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (144 bytes)
Sep  5 13:01:16 OPNsense charon: 05[NET] <1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (252 bytes)
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> parsed ID_PROT request 0 [ KE No NAT-D NAT-D ]
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> generating ID_PROT response 0 [ KE No NAT-D NAT-D ]
Sep  5 13:01:16 OPNsense charon: 05[NET] <1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (268 bytes)
Sep  5 13:01:16 OPNsense charon: 05[NET] <1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:01:16 OPNsense charon: 05[ENC] <1> parsed ID_PROT request 0 [ ID HASH N(INITIAL_CONTACT) ]
Sep  5 13:01:16 OPNsense charon: 05[CFG] <1> looking for pre-shared key peer configs matching yyy.yyy.yyy.yyy...xxx.xxx.xxx.xxx[xxx.xxx.xxx.xxx]
Sep  5 13:01:16 OPNsense charon: 05[CFG] <1> selected peer config "con1-000"
Sep  5 13:01:16 OPNsense charon: 05[IKE] <con1-000|1> IKE_SA con1-000[1] established between yyy.yyy.yyy.yyy[yyy.yyy.yyy.yyy]...xxx.xxx.xxx.xxx[xxx.xxx.xxx.xxx]
Sep  5 13:01:16 OPNsense charon: 05[IKE] <con1-000|1> scheduling reauthentication in 13763s
Sep  5 13:01:16 OPNsense charon: 05[IKE] <con1-000|1> maximum IKE_SA lifetime 14303s
Sep  5 13:01:16 OPNsense charon: 05[ENC] <con1-000|1> generating ID_PROT response 0 [ ID HASH ]
Sep  5 13:01:16 OPNsense charon: 05[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (92 bytes)
Sep  5 13:01:16 OPNsense charon: 05[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (332 bytes)
Sep  5 13:01:16 OPNsense charon: 05[ENC] <con1-000|1> parsed QUICK_MODE request 3621287927 [ HASH SA No KE ID ID ]
Sep  5 13:01:16 OPNsense charon: 05[CFG] <con1-000|1> selected proposal: ESP:AES_CBC_256/HMAC_SHA2_256_128/MODP_1024/NO_EXT_SEQ
Sep  5 13:01:16 OPNsense charon: 05[IKE] <con1-000|1> received 10000000000 lifebytes, configured 0
Sep  5 13:01:16 OPNsense charon: 05[ENC] <con1-000|1> generating QUICK_MODE response 3621287927 [ HASH SA No KE ID ID ]
Sep  5 13:01:16 OPNsense charon: 05[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (348 bytes)
Sep  5 13:01:16 OPNsense charon: 05[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (76 bytes)
Sep  5 13:01:16 OPNsense charon: 05[ENC] <con1-000|1> parsed QUICK_MODE request 3621287927 [ HASH ]
Sep  5 13:01:16 OPNsense charon: 05[IKE] <con1-000|1> CHILD_SA con1-001{3} established with SPIs c1b5f409_i bc74ae50_o and TS 192.168.250.0/24 === 192.168.0.0/17
Sep  5 13:01:26 OPNsense charon: 13[IKE] <con1-000|1> sending DPD request
Sep  5 13:01:26 OPNsense charon: 13[ENC] <con1-000|1> generating INFORMATIONAL_V1 request 3406066776 [ HASH N(DPD) ]
Sep  5 13:01:26 OPNsense charon: 13[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (108 bytes)
Sep  5 13:01:26 OPNsense charon: 13[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:01:26 OPNsense charon: 13[ENC] <con1-000|1> parsed INFORMATIONAL_V1 request 214071174 [ HASH N(DPD_ACK) ]
Sep  5 13:01:36 OPNsense charon: 13[IKE] <con1-000|1> sending DPD request
Sep  5 13:01:36 OPNsense charon: 13[ENC] <con1-000|1> generating INFORMATIONAL_V1 request 43016422 [ HASH N(DPD) ]
Sep  5 13:01:36 OPNsense charon: 13[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (108 bytes)
Sep  5 13:01:36 OPNsense charon: 13[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:01:36 OPNsense charon: 13[ENC] <con1-000|1> parsed INFORMATIONAL_V1 request 540057284 [ HASH N(DPD_ACK) ]
Sep  5 13:01:46 OPNsense charon: 13[IKE] <con1-000|1> sending DPD request
Sep  5 13:01:46 OPNsense charon: 13[ENC] <con1-000|1> generating INFORMATIONAL_V1 request 1223108931 [ HASH N(DPD) ]
Sep  5 13:01:46 OPNsense charon: 13[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (108 bytes)
Sep  5 13:01:46 OPNsense charon: 13[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:01:46 OPNsense charon: 13[ENC] <con1-000|1> parsed INFORMATIONAL_V1 request 1176428986 [ HASH N(DPD_ACK) ]
Sep  5 13:01:56 OPNsense charon: 05[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (332 bytes)
Sep  5 13:01:56 OPNsense charon: 05[ENC] <con1-000|1> parsed QUICK_MODE request 342500649 [ HASH SA No KE ID ID ]
Sep  5 13:01:56 OPNsense charon: 05[CFG] <con1-000|1> selected proposal: ESP:AES_CBC_256/HMAC_SHA2_256_128/MODP_1024/NO_EXT_SEQ
Sep  5 13:01:56 OPNsense charon: 05[IKE] <con1-000|1> received 10000000000 lifebytes, configured 0
Sep  5 13:01:56 OPNsense charon: 05[ENC] <con1-000|1> generating QUICK_MODE response 342500649 [ HASH SA No KE ID ID ]
Sep  5 13:01:56 OPNsense charon: 05[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (348 bytes)
Sep  5 13:01:56 OPNsense charon: 05[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (76 bytes)
Sep  5 13:01:56 OPNsense charon: 05[ENC] <con1-000|1> parsed QUICK_MODE request 342500649 [ HASH ]
Sep  5 13:01:56 OPNsense charon: 05[IKE] <con1-000|1> CHILD_SA con1-000{4} established with SPIs c34361c1_i f540373f_o and TS 192.168.250.0/24 === 194.0.149.0/25
Sep  5 13:02:33 OPNsense charon: 05[IKE] <con1-000|1> sending DPD request
Sep  5 13:02:33 OPNsense charon: 05[ENC] <con1-000|1> generating INFORMATIONAL_V1 request 3696687235 [ HASH N(DPD) ]
Sep  5 13:02:33 OPNsense charon: 05[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (108 bytes)
Sep  5 13:02:33 OPNsense charon: 12[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:02:33 OPNsense charon: 12[ENC] <con1-000|1> parsed INFORMATIONAL_V1 request 62191751 [ HASH N(DPD_ACK) ]
Sep  5 13:02:43 OPNsense charon: 12[IKE] <con1-000|1> sending DPD request
Sep  5 13:02:43 OPNsense charon: 12[ENC] <con1-000|1> generating INFORMATIONAL_V1 request 2944087970 [ HASH N(DPD) ]
Sep  5 13:02:43 OPNsense charon: 12[NET] <con1-000|1> sending packet: from yyy.yyy.yyy.yyy[500] to xxx.xxx.xxx.xxx[500] (108 bytes)
Sep  5 13:02:43 OPNsense charon: 12[NET] <con1-000|1> received packet: from xxx.xxx.xxx.xxx[500] to yyy.yyy.yyy.yyy[500] (108 bytes)
Sep  5 13:02:43 OPNsense charon: 12[ENC] <con1-000|1> parsed INFORMATIONAL_V1 request 1670222920 [ HASH N(DPD_ACK) ]
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 10, 2019, 09:11:28 am
kann jemand mit den Logs etwas anfangen? Ich bin über jede Hilfe dankbar!
Title: Re: IPsec/Mehrere Phase2
Post by: mimugmail on September 10, 2019, 07:17:58 pm
Hast du mal nach der Meldung mit den Bytes gegoogelt? Die hab ich noch nie gesehen, komisch
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 11, 2019, 07:31:21 am
du meinst "xxx.xxx.xxx.xxx" und "yyy.yyy.yyy.yyy"? - das sind placeholder für IP-Adressen :)
das in eckigen Klammern dahinter wird der UDP-Port sein
Title: Re: IPsec/Mehrere Phase2
Post by: its-me on September 19, 2019, 11:26:22 am
Das Problem besteht immer noch, und ich komme da leider nicht weiter :(