<div dir="ltr"><div>Hello all,</div><div><br></div><div>I've done some cursory searching but I haven't seen my issue addressed.</div><div><br></div><div>We have a Cisco ASAv that we've been using vpnc to open a IPsec tunnel. The vpnc client seems to have issues handling rekey events, and is quite old, so I am trying to connect to the same VPN gateway using libreswan to do comparative testing. So far, I have not been successful in establishing a link.</div><div><br></div><div>I am using CentOS 8, which comes with libreswan 3.29<br></div><div><br></div><div>For reference, here is the vpnc config (items in brackets are redacted):<br></div><div><br></div><div>IPSec ID <our_ipsec_group_id><br>IPSec gateway <gateway_ip><br>IPSec obfuscated secret <obfuscated-psk><br>Local Port 0<br>Xauth password <vpn user password><br>Xauth username <vpn username></div><div><br></div><div>To map this to libreswan, I've done the following:</div><div><br></div><div>/etc/ipsec.d/myconn.secrets contains:</div><div># note that <psk> is the de-obfuscated form of <obfuscated-psk> contained in the vpnc config<br></div><div><gateway_ip> %any : PSK "<psk>"</div><div>@<vpn username> : XAUTH "<vpn user password>"</div><div><br></div><div>/etc/ipsec.d/myconn.conf contains:<br></div><div>conn myconn</div><div>  ikev2=no<br>  authby=secret<br>  left=%defaultroute<br>  leftxauthclient=yes<br>  leftmodecfgclient=yes<br>  leftxauthusername=<vpn username><br>  leftid=@<our_ipsec_group_id><br>  right=<gateway_ip><br>  rightxauthserver=yes<br>  rightmodecfgserver=yes</div><div>  rightid=@<our_ipsec_group_id><br></div><div>  ike_frag=yes<br>  auto=ignore<br>  ike=aes256-sha1;dh2<br>  phase2=esp<br>  phase2alg=aes256-sha1;dh2<br>  nat-ikev1-method=rfc<br>  remote-peer-type=cisco<br>  salifetime=900</div><div><br></div><div>(I'm aware several of these settings are insecure, such as dh2)</div><div><br></div><div>I use the following commands to attempt to bring up the tunnel:</div><div>ipsec auto --add myconn</div><div>ipsec auto --up myconn</div><div><br></div><div>When I do this, I get the following output:<br><br>002 "myconn" #1: initiating Main Mode<br>104 "myconn" #1: STATE_MAIN_I1: initiate<br>106 "myconn" #1: STATE_MAIN_I2: sent MI2, expecting MR2<br>010 "myconn" #1: STATE_MAIN_I2: retransmission; will wait 0.5 seconds for response<br>003 "myconn" #1: ignoring informational payload INVALID_COOKIE, msgid=00000000, length=40<br>003 "myconn" #1: received and ignored notification payload: INVALID_COOKIE</div><div><br></div><div>The last three lines repeat with increasing retransmission delays.</div><div><br></div><div>On the ASAv side, I get this interesting error:<br><br>%ASA-4-713903: Group = <my ip>, IP = <my ip>, Can't find a valid tunnel group, aborting...!<br>%ASA-4-713903: IP = <my ip> Header invalid, missing SA payload! (next payload = 4)</div><div><br></div><div>On working clients, it will show Group = <our_ipsec_group_id></div><div><br></div><div>The documentation I've read says the `leftid` parameter should set this, and I've tried both "leftid=@[<our_ipsec_group_id>]" and "leftid=@<our_ipsec_group_id>" to no avail.</div><div><br></div><div>So, that's where I'm presently stuck.</div><div><br></div><div>TL;DR: under what circumstances would libreswan insist on sending the IP as the group instead of what's set as `leftid`? Can I get there from here?<br></div><div><br></div><div>Thanks,</div><div><br></div><div>Nathan<br></div></div>