Moin,
Da ich plane (zumindest teilweise, vielleicht auch ganz) auf den Fritzboxen von OpenVPN auf AVM-VPN umzusteigen (um teilweise auf Freetz verzichten zu können das nur wegen openvpn im Einsatz ist) hab ich probiert mein funktionierenden Strongswan auf meinem Root-Server anzupassen damit die Verbindung funktioniert. Dabei habe ich aber Probleme und Fragen die mir keiner bisher beantworten konnte:
- Ich möchte mehr als ein /24 Netz routen, da sich 3 Fritzboxen auf den Strongswan Server verbinden sollen und die Kommunikation untereinander möglich sein soll. 192.168.0.0/24, 192.168.1.0/24, 192.168.3.0/24 - daher habe ich 192.168.0.0/22 als Maske genommen.
Die Verbindung kommt (teilweise) zustande:
ike.log
log auf dem Host:
VPN Config für die Fritzbox:
ipsec.conf
ipsec.secrets
Es werden jedoch keine Daten übertragen... Ich hab das Strongswan sonst nur laufen für Roadwarrior (iOS Devices) - das funktioniert auch ohne Probleme. Das IPSEC natürlich eine ganz andere Nummer ist als OpenVPN ist mir klar, leider komme ich aber nicht weiter...
Kann hier vielleicht jemand helfen? Ich hab keine Ahnung mehr leider...
Da ich plane (zumindest teilweise, vielleicht auch ganz) auf den Fritzboxen von OpenVPN auf AVM-VPN umzusteigen (um teilweise auf Freetz verzichten zu können das nur wegen openvpn im Einsatz ist) hab ich probiert mein funktionierenden Strongswan auf meinem Root-Server anzupassen damit die Verbindung funktioniert. Dabei habe ich aber Probleme und Fragen die mir keiner bisher beantworten konnte:
- Ich möchte mehr als ein /24 Netz routen, da sich 3 Fritzboxen auf den Strongswan Server verbinden sollen und die Kommunikation untereinander möglich sein soll. 192.168.0.0/24, 192.168.1.0/24, 192.168.3.0/24 - daher habe ich 192.168.0.0/22 als Maske genommen.
Die Verbindung kommt (teilweise) zustande:
ike.log
Code:
2016-02-04 08:10:21 avmike:<remote FQDN>: Warning: source changed from 0.0.0.0:500 to <remote ip>:500
2016-02-04 08:10:21 avmike:mainmode <remote FQDN>: selected lifetime: 3600 sec(no notify)
2016-02-04 08:10:21 avmike:<remote FQDN> remote peer supported XAUTH
2016-02-04 08:10:21 avmike:<remote FQDN> remote peer supported DPD
2016-02-04 08:10:21 avmike:<remote FQDN> remote peer supported NAT-T RFC 3947
2016-02-04 08:10:22 avmike:<remote FQDN>: Warning: source changed from 0.0.0.0:500 to <remote ip>:500
2016-02-04 08:10:22 avmike:mainmode <remote FQDN>: add SA 1
2016-02-04 08:10:22 avmike:<remote FQDN>: switching to NAT-T (Initiator)
2016-02-04 08:10:22 avmike:<remote FQDN>: Warning: source changed from 0.0.0.0:500 to <remote ip>:4500
2016-02-04 08:10:22 avmike:<remote FQDN>: Phase 1 ready
2016-02-04 08:10:22 avmike:<remote FQDN>: current=0.0.0.0 new=<remote ip>:4500
2016-02-04 08:10:22 avmike:<remote FQDN>: no valid sa, reseting initialcontactdone flag
2016-02-04 08:10:22 avmike:<remote FQDN>: remote is behind a nat
2016-02-04 08:10:22 avmike:<remote FQDN>: sending initial contact message
2016-02-04 08:10:22 avmike:<remote FQDN>: start waiting connections
2016-02-04 08:10:22 avmike:<remote FQDN>: Phase 2 starting (start waiting)
2016-02-04 08:10:52 avmike:mainmode <remote FQDN>: del SA 1
2016-02-04 08:10:52 avmike:wolke_neighbour_renew_sa 0 SAs
2016-02-04 08:10:52 avmike:wolke_neighbour_renew_sa 0 SAs RENEW
2016-02-04 08:10:52 avmike:<remote FQDN>: Phase 1 starting (renew)
2016-02-04 08:10:52 avmike:< cb_sa_create_failed(name=<remote FQDN>,reason=IKE-Error 0x2027)
2016-02-04 08:10:52 avmike:mainmode <remote FQDN>: selected lifetime: 3600 sec(no notify)
2016-02-04 08:10:52 avmike:<remote FQDN> remote peer supported XAUTH
2016-02-04 08:10:52 avmike:<remote FQDN> remote peer supported DPD
2016-02-04 08:10:52 avmike:<remote FQDN> remote peer supported NAT-T RFC 3947
2016-02-04 08:10:52 avmike:mainmode <remote FQDN>: add SA 2
2016-02-04 08:10:52 avmike:<remote FQDN>: Phase 1 ready
2016-02-04 08:10:52 avmike:<remote FQDN>: current=<remote ip>:4500 new=<remote ip>:4500
2016-02-04 08:10:52 avmike:<remote FQDN>: local is behind a nat
2016-02-04 08:10:52 avmike:<remote FQDN>: remote is behind a nat
2016-02-04 08:10:52 avmike:<remote FQDN>: start waiting connections
2016-02-04 08:10:52 avmike:<remote FQDN>: NO waiting connections
log auf dem Host:
Code:
Feb 4 08:10:03 <remote> charon: 16[CFG] selected proposal: IKE:AES_CBC_256/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024
Feb 4 08:10:03 <remote> charon: 16[IKE] sending XAuth vendor ID
Feb 4 08:10:03 <remote> charon: 16[IKE] sending DPD vendor ID
Feb 4 08:10:03 <remote> charon: 16[IKE] sending NAT-T (RFC 3947) vendor ID
Feb 4 08:10:03 <remote> charon: 16[ENC] generating ID_PROT response 0 [ SA V V V ]
Feb 4 08:10:03 <remote> charon: 16[NET] sending packet: from <remote IP>[500] to <local DYN IP>[500] (136 bytes)
Feb 4 08:10:03 <remote> charon: 10[NET] sending packet: from <remote IP>[500] to <local DYN IP>[500]
Feb 4 08:10:04 <remote> charon: 09[NET] received packet: from <local DYN IP>[500] to <remote IP>[500]
Feb 4 08:10:04 <remote> charon: 09[NET] waiting for data on sockets
Feb 4 08:10:04 <remote> charon: 05[NET] received packet: from <local DYN IP>[500] to <remote IP>[500] (228 bytes)
Feb 4 08:10:04 <remote> charon: 05[ENC] parsed ID_PROT request 0 [ KE No NAT-D NAT-D ]
Feb 4 08:10:04 <remote> charon: 05[IKE] local host is behind NAT, sending keep alives
Feb 4 08:10:04 <remote> charon: 05[CFG] candidate "fritz-3", match: 1/1/2076 (me/other/ike)
Feb 4 08:10:04 <remote> charon: 05[ENC] generating ID_PROT response 0 [ KE No NAT-D NAT-D ]
Feb 4 08:10:04 <remote> charon: 05[NET] sending packet: from <remote IP>[500] to <local DYN IP>[500] (244 bytes)
Feb 4 08:10:04 <remote> charon: 10[NET] sending packet: from <remote IP>[500] to <local DYN IP>[500]
Feb 4 08:10:04 <remote> charon: 09[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500]
Feb 4 08:10:04 <remote> charon: 09[NET] waiting for data on sockets
Feb 4 08:10:04 <remote> charon: 04[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500] (108 bytes)
Feb 4 08:10:04 <remote> charon: 04[ENC] parsed ID_PROT request 0 [ ID HASH N(INITIAL_CONTACT) ]
Feb 4 08:10:04 <remote> charon: 04[CFG] looking for pre-shared key peer configs matching <remote IP>...<local DYN IP>[<local DYN FQDN>]
Feb 4 08:10:04 <remote> charon: 04[CFG] candidate "fritz-3", match: 1/20/2076 (me/other/ike)
Feb 4 08:10:04 <remote> charon: 04[CFG] selected peer config "fritz-3"
Feb 4 08:10:04 <remote> charon: 04[IKE] IKE_SA fritz-3[1] established between <remote IP>[<remote FQDN>]...<local DYN IP>[<local DYN FQDN>]
Feb 4 08:10:04 <remote> charon: 04[IKE] IKE_SA fritz-3[1] state change: CONNECTING => ESTABLISHED
Feb 4 08:10:04 <remote> charon: 04[ENC] generating ID_PROT response 0 [ ID HASH ]
Feb 4 08:10:04 <remote> charon: 04[NET] sending packet: from <remote IP>[4500] to <local DYN IP>[4500] (92 bytes)
Feb 4 08:10:04 <remote> charon: 10[NET] sending packet: from <remote IP>[4500] to <local DYN IP>[4500]
Feb 4 08:10:04 <remote> charon: 09[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500]
Feb 4 08:10:04 <remote> charon: 09[NET] waiting for data on sockets
Feb 4 08:10:04 <remote> charon: 02[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500] (92 bytes)
Feb 4 08:10:04 <remote> charon: 02[ENC] parsed INFORMATIONAL_V1 request 1319778430 [ HASH N(INITIAL_CONTACT) ]
Feb 4 08:10:24 <remote> charon: 01[IKE] sending keep alive to <local DYN IP>[4500]
Feb 4 08:10:24 <remote> charon: 10[NET] sending packet: from <remote IP>[4500] to <local DYN IP>[4500]
Feb 4 08:10:34 <remote> charon: 09[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500]
Feb 4 08:10:34 <remote> charon: 09[NET] waiting for data on sockets
Feb 4 08:10:34 <remote> charon: 09[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500]
Feb 4 08:10:34 <remote> charon: 09[NET] waiting for data on sockets
Feb 4 08:10:34 <remote> charon: 13[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500] (92 bytes)
Feb 4 08:10:34 <remote> charon: 13[ENC] parsed INFORMATIONAL_V1 request 1999035825 [ HASH D ]
Feb 4 08:10:34 <remote> charon: 13[IKE] received DELETE for IKE_SA fritz-3[1]
Feb 4 08:10:34 <remote> charon: 13[IKE] deleting IKE_SA fritz-3[1] between <remote IP>[<remote FQDN>]...<local DYN IP>[<local DYN FQDN>]
Feb 4 08:10:34 <remote> charon: 13[IKE] IKE_SA fritz-3[1] state change: ESTABLISHED => DELETING
Feb 4 08:10:34 <remote> charon: 13[IKE] IKE_SA fritz-3[1] state change: DELETING => DELETING
Feb 4 08:10:34 <remote> charon: 13[IKE] IKE_SA fritz-3[1] state change: DELETING => DESTROYING
Feb 4 08:10:34 <remote> charon: 11[NET] received packet: from <local DYN IP>[4500] to <remote IP>[4500] (496 bytes)
Feb 4 08:10:34 <remote> charon: 11[ENC] parsed ID_PROT request 0 [ SA V V V V V V ]
Feb 4 08:10:34 <remote> charon: 11[CFG] looking for an ike config for <remote IP>...<local DYN IP>
Feb 4 08:10:34 <remote> charon: 11[CFG] candidate: %any...<local DYN FQDN>, prio 2076
Feb 4 08:10:34 <remote> charon: 11[CFG] found matching ike config: %any...<local DYN FQDN> with prio 2076
Feb 4 08:10:34 <remote> charon: 11[IKE] received XAuth vendor ID
Feb 4 08:10:34 <remote> charon: 11[IKE] received DPD vendor ID
Feb 4 08:10:34 <remote> charon: 11[IKE] received NAT-T (RFC 3947) vendor ID
Feb 4 08:10:34 <remote> charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-02\n vendor ID
Feb 4 08:10:34 <remote> charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-03 vendor ID
Feb 4 08:10:34 <remote> charon: 11[ENC] received unknown vendor ID: <id>
Feb 4 08:10:34 <remote> charon: 11[IKE] <local DYN IP> is initiating a Main Mode IKE_SA
Feb 4 08:10:34 <remote> charon: 11[IKE] IKE_SA (unnamed)[2] state change: CREATED => CONNECTING
VPN Config für die Fritzbox:
Code:
/*
* C:\Users\test\AppData\Roaming\AVM\FRITZ!Fernzugang\strongswan\strongswan.cfg
* Thu Jun 25 09:40:07 2015
*/
vpncfg {
connections {
enabled = yes;
editable = no;
conn_type = conntype_lan;
name = "<remote FQDN>";
boxuser_id = 0;
always_renew = yes;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
remoteip = 0.0.0.0;
remote_virtualip = 0.0.0.0;
remotehostname = "<remote FQDN>";
keepalive_ip = 0.0.0.0;
localid {
fqdn = "<local DYN FQDN>";
}
remoteid {
fqdn = "<remote FQDN>";
}
mode = phase1_mode_idp;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "<KEY>";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = no;
use_cfgmode = no;
phase2localid {
ipnet {
ipaddr = 192.168.3.0;
mask = 255.255.255.0;
}
}
phase2remoteid {
ipnet {
ipaddr = 192.168.0.0;
mask = 255.255.252.0;
}
}
phase2ss = "esp-all-all/ah-none/comp-all/pfs";
accesslist = "permit ip any 192.168.0.0 255.255.252.0";
}
ike_forward_rules = "udp 0.0.0.0:500 0.0.0.0:500",
"udp 0.0.0.0:4500 0.0.0.0:4500";
}
ipsec.conf
Code:
conn %default
keyexchange=ikev2
ike=aes128-sha256-ecp256,aes256-sha384-ecp384,aes128-sha256-modp2048,aes128-sha1-modp2048,aes256-sha384-modp4096,aes256-sha256-modp4096,aes256-sha1-modp4096,aes128-sha256-modp1536,aes128-sha1-modp1536,aes256-sha384-modp2048,aes256-sha256-modp2048,aes256-sha1-modp2048,aes128-sha256-modp1024,aes128-sha1-modp1024,aes256-sha384-modp1536,aes256-sha256-modp1536,aes256-sha1-modp1536,aes256-sha384-modp1024,aes256-sha256-modp1024,aes256-sha1-modp1024!
esp=aes128gcm16-ecp256,aes256gcm16-ecp384,aes128-sha256-ecp256,aes256-sha384-ecp384,aes128-sha256-modp2048,aes128-sha1-modp2048,aes256-sha384-modp4096,aes256-sha256-modp4096,aes256-sha1-modp4096,aes128-sha256-modp1536,aes128-sha1-modp1536,aes256-sha384-modp2048,aes256-sha256-modp2048,aes256-sha1-modp2048,aes128-sha256-modp1024,aes128-sha1-modp1024,aes256-sha384-modp1536,aes256-sha256-modp1536,aes256-sha1-modp1536,aes256-sha384-modp1024,aes256-sha256-modp1024,aes256-sha1-modp1024,aes128gcm16,aes256gcm16,aes128-sha256,aes128-sha1,aes256-sha384,aes256-sha256,aes256-sha1!
dpdaction=clear
dpddelay=300s
rekey=no
left=%any
leftid=<remote FQDN>
leftsendcert=always
leftsubnet=0.0.0.0/0
leftcert=<keyfile>.pem
right=%any
rightdns=8.8.8.8,8.8.4.4
rightsourceip=%ipsecpool
conn IPSec-IKEv2
keyexchange=ikev2
auto=add
conn IPSec-IKEv2-EAP
also="IPSec-IKEv2"
rightauth=eap-tls
# rightauth=eap-mschapv2
# rightsendcert=never
eap_identity=%any
#conn CiscoIPSec
# keyexchange=ikev1
# # forceencaps=yes
# rightauth=pubkey
# rightauth2=xauth
# auto=add
conn fritz-3
keyexchange=ikev1
leftsubnet=192.168.0.0/22
right=<local DYN FQDN>
rightid=@<local DYN FQDN>
rightsubnet=192.168.3.0/24
ikelifetime=4h
keylife=1h
authby=secret
auto=add
ipsec.secrets
Code:
# This file holds shared secrets or RSA private keys for authentication.
# RSA private key for this host, authenticating it to any other host
# which knows the public part. Suitable public keys, for ipsec.conf, DNS,
# or configuration of other implementations, can be extracted conveniently
# with "ipsec showhostkey".
: RSA <keyfile>.pem
@<remote FQDN> @<local DYN FQDN> : PSK "<KEY>"
<local DYN FQDN> : PSK "<KEY>"
Es werden jedoch keine Daten übertragen... Ich hab das Strongswan sonst nur laufen für Roadwarrior (iOS Devices) - das funktioniert auch ohne Probleme. Das IPSEC natürlich eine ganz andere Nummer ist als OpenVPN ist mir klar, leider komme ich aber nicht weiter...
Kann hier vielleicht jemand helfen? Ich hab keine Ahnung mehr leider...