strongSwan - nenhuma configuração correspondente foi encontrada

2

Estou tentando configurar o strongSwan para configurar um iPhone, mas estou recebendo um erro que tenho problemas para superar.

não foi encontrada nenhuma configuração correspondente de pares

O log de depuração completo é o seguinte:

root@vpn-test:/home/ubuntu# ipsec start --nofork --debug-all
Starting strongSwan 5.3.5 IPsec [starter]...
Loading config setup
  charondebug=ike 1, knl 1, cfg 1
  uniqueids=no
Loading conn 'vpnserver-ikev2'
  auto=add
  compress=no
  dpdaction=clear
  dpddelay=300s
  eap_identity=%identity
  esp=aes256-sha512
  forceencaps=yes
  fragmentation=yes
  ike=aes256-sha512-modp4096
  inactivity=5s
  keyexchange=ikev2
  left=%any
  leftcert=/etc/ipsec.d/certs/vpn-server-cert-new.pem
  leftid=%any
  leftsendcert=always
  leftsubnet=172.31.0.0/16
  rekey=no
  right=%any
  rightauth=eap-radius
  rightdns=8.8.8.8
  rightid=%any
  rightsendcert=never
  rightsourceip=10.10.0.0/16
  type=tunnel
found netkey IPsec stack
Attempting to start charon...
00[DMN] Starting IKE charon daemon (strongSwan 5.3.5, Linux 4.4.0-87-generic, x86_64)
00[CFG] loading ca certificates from '/etc/ipsec.d/cacerts'
00[CFG]   loaded ca certificate "C=RO, ST=Bucharest, L=Bucharest, O=NimbleX, CN=test-ca.nimblex.net, [email protected]" from '/etc/ipsec.d/cacerts/ca.crt'
00[CFG] loading aa certificates from '/etc/ipsec.d/aacerts'
00[CFG] loading ocsp signer certificates from '/etc/ipsec.d/ocspcerts'
00[CFG] loading attribute certificates from '/etc/ipsec.d/acerts'
00[CFG] loading crls from '/etc/ipsec.d/crls'
00[CFG] loading secrets from '/etc/ipsec.secrets'
00[CFG]   loaded RSA private key from '/etc/ipsec.d/private/vpn-server-key.pem'
00[CFG]   loaded EAP secret for test %any%
00[CFG] opening triplet file /etc/ipsec.d/triplets.dat failed: No such file or directory
00[LIB] loaded plugins: charon test-vectors aes rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp agent xcbc hmac gcm attr kernel-netlink resolve socket-default connmark farp stroke updown eap-identity eap-sim eap-sim-pcsc eap-aka eap-aka-3gpp2 eap-simaka-pseudonym eap-simaka-reauth eap-md5 eap-gtc eap-mschapv2 eap-dynamic eap-radius eap-tls eap-ttls eap-peap eap-tnc xauth-generic xauth-eap xauth-pam xauth-noauth tnc-tnccs tnccs-20 tnccs-11 tnccs-dynamic dhcp lookip error-notify certexpire led addrblock unity
00[LIB] dropped capabilities, running as uid 0, gid 0
00[JOB] spawning 16 worker threads
charon (6255) started after 40 ms
11[CFG] received stroke: add connection 'vpnserver-ikev2'
11[CFG] adding virtual IP address pool 10.10.0.0/16
11[CFG]   loaded certificate "C=US, O=NimbleX VPN Server, CN=vpn-test.nimblex.net" from '/etc/ipsec.d/certs/vpn-server-cert-new.pem'
11[CFG]   id '%any' not confirmed by certificate, defaulting to 'C=US, O=NimbleX VPN Server, CN=vpn-test.nimblex.net'
11[CFG] added configuration 'vpnserver-ikev2'




13[NET] received packet: from 82.137.12.236[7558] to 172.31.9.29[500] (300 bytes)
13[ENC] parsed IKE_SA_INIT request 0 [ SA KE No N(REDIR_SUP) N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) ]
13[IKE] 82.137.12.236 is initiating an IKE_SA
13[IKE] local host is behind NAT, sending keep alives
13[IKE] remote host is behind NAT
13[ENC] generating IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) N(MULT_AUTH) ]
13[NET] sending packet: from 172.31.9.29[500] to 82.137.12.236[7558] (316 bytes)
14[NET] received packet: from 82.137.12.236[29079] to 172.31.9.29[4500] (348 bytes)
14[ENC] unknown attribute type (25)
14[ENC] parsed IKE_AUTH request 1 [ IDi N(INIT_CONTACT) N(MOBIKE_SUP) IDr CPRQ(ADDR DHCP DNS MASK ADDR6 DHCP6 DNS6 (25)) N(ESP_TFC_PAD_N) N(NON_FIRST_FRAG) SA TSi TSr N(EAP_ONLY) ]
14[CFG] looking for peer configs matching 172.31.9.29[vpn-test.nimblex.net]...82.137.12.236[10.140.156.120]
14[CFG] no matching peer config found
14[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
14[IKE] peer supports MOBIKE
14[ENC] generating IKE_AUTH response 1 [ N(AUTH_FAILED) ]
14[NET] sending packet: from 172.31.9.29[4500] to 82.137.12.236[29079] (68 bytes)

Em ipsec.secrets eu tenho:

vpn-test.nimblex.net : RSA "/etc/ipsec.d/private/vpn-server-key.pem"
    
por Bogdan 03.08.2017 / 00:17

1 resposta

1
11[CFG]   id '%any' not confirmed by certificate, defaulting to 'C=US, O=NimbleX VPN Server, CN=vpn-test.nimblex.net'

Como você pode ver, sua identidade local é padronizada para o DN do assunto do certificado. No entanto, o par propõe vpn-test.nimblex.net como identidade, mas nenhuma configuração é encontrada:

14[CFG] looking for peer configs matching 172.31.9.29[vpn-test.nimblex.net]...82.137.12.236[10.140.156.120]

Portanto, altere a identidade esperada no par para o DN do assunto ou defina leftid=vpn-test.nimblex.net , que só funciona, no entanto, se esse FQDN estiver contido em uma extensão subjectAlternativeName no certificado do servidor.

    
por 03.08.2017 / 08:11