El túnel AWS StrongSwan IPSec con Cisco falla durante la fase 2 con TS_UNACCEPTABLE

El túnel AWS StrongSwan IPSec con Cisco falla durante la fase 2 con TS_UNACCEPTABLE

Necesito configurar un túnel IPSec de sitio a sitio con un proveedor al que necesitamos acceder a los servidores API de cada uno ubicados en las LAN utilizando sus respectivas IP públicas. Estamos usando AWS, configuré una VPC con 2 subredes y el proveedor está usando el firewall CISCO ASA.

Llevo unas semanas golpeándome la cabeza contra la pared, pero es en vano.

Aquí están los requisitos:

      AWS Subnet 1     10.100.128.0/20        AWS Subnet 2
    [Our API server]-----------------------[Ubuntu/StrongSwan]---------[Vendors VPN Gw = 41.x.x.6]-----[Vendor's API Server=41.x.x.233]
          |                                       |
13.x.x.115/10.100.133.21               13.x.x.175/10.100.11.25

Esto es lo que he hecho hasta ahora

  • Actualicé la tabla de enrutamiento de la subred 1 para que Gw esté hacia Ubuntu StrongSwan.
  • He configurado la instancia Ubuntu StrongSwan EC2 para que actúe como una instancia NAT.
  • Comprobación de origen/destino detenida
  • Permitir que el kernel reenvíenet.ipv4.ip_forward = 1
  • NAT de origen añadidosudo iptables -t nat -A POSTROUTING -s 10.100.133.21 -d 41.x.x.233 -j SNAT --to-source 13.x.x.115
  • NAT de destino agregadosudo iptables -t nat -A PREROUTING -d 13.x.x.115 -j DNAT --to-destination 10.100.133.21
  • Enmascare el resto del tráfico desde 10.100.128.0/20:sudo iptables -t nat -A POSTROUTING -s 10.100.128.0/20 -j MASQUERADE

Finalmente, configuré el túnel de la siguiente manera

conn %default
        # Tunnel properties
        type=tunnel
        authby=psk
        auto=start
        keyexchange=ikev2
        mobike=no
        rekey=yes
        reauth=no
        compress=no

        # Session configuration
        ikelifetime=86400s
        lifetime=3600s
        dpdaction=restart
        closeaction=restart
        dpddelay=10s
        dpdtimeout=30
        # keyingtries=1

        # Default ph1
        # Encryption, hash and authentication
        ike=aes256-sha256-ecp256!

        # Default ph2
        # phase2=esp
        # phase2alg=aes256-sha256!
        # No pfs
        esp=aes256-sha256!


conn TigoPesa-Tunnel
        # Us
        left=%defaultroute
        leftid=10.100.11.25
        leftsubnet=13.x.x.115/32
        # Them
        right=41.x.x.6
        rightid=41.x.x.6
        rightsubnet=41.x.x.233/32

y configuré PSK en el ipsec.secretscomo:

10.100.133.21 41.x.x.6 : PSK "xxxx"

Cada vez que intento abrir el túnel, ¡el siguiente error siempre me abofetea!

initiating IKE_SA TigoPesa-Tunnel[4] to 41.x.x.6
generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) N(HASH_ALG) N(REDIR_SUP) ]
sending packet: from 10.100.11.25[500] to 41.x.x.6[500] (272 bytes)
received packet: from 41.x.x.6[500] to 10.100.11.25[500] (447 bytes)
parsed IKE_SA_INIT response 0 [ SA KE No V V N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(FRAG_SUP) V ]
received Cisco Delete Reason vendor ID
received Cisco Copyright (c) 2009 vendor ID
received FRAGMENTATION vendor ID
selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/ECP_256
local host is behind NAT, sending keep alives
received 3 cert requests for an unknown ca
authentication of '10.100.11.25' (myself) with pre-shared key
establishing CHILD_SA TigoPesa-Tunnel{5}
generating IKE_AUTH request 1 [ IDi N(INIT_CONTACT) IDr AUTH SA TSi TSr N(EAP_ONLY) N(MSG_ID_SYN_SUP) ]
sending packet: from 10.100.11.25[4500] to 41.x.x.6[4500] (304 bytes)
received packet: from 41.x.x.6[4500] to 10.100.11.25[4500] (160 bytes)
parsed IKE_AUTH response 1 [ V IDr AUTH N(TS_UNACCEPT) ]
authentication of '41.x.x.6' with pre-shared key successful
IKE_SA TigoPesa-Tunnel[4] established between 10.100.11.25[10.100.11.25]...41.x.x.6[41.x.x.6]
scheduling rekeying in 85567s
maximum IKE_SA lifetime 86107s
received TS_UNACCEPTABLE notify, no CHILD_SA built
failed to establish CHILD_SA, keeping IKE_SA
establishing connection 'TigoPesa-Tunnel' failed

¡Alguien, por favor salve mi día! (Antecedentes por el bien de la comunicación, no soy ingeniero de redes, sino ingeniero de software)

información relacionada