nm-l2tp / NetworkManager-l2tp

L2TP and L2TP/IPsec support for NetworkManager
GNU General Public License v2.0
488 stars 84 forks source link

ipsec.secrets identity and left|rightid confusion #35

Closed joshuadugie closed 7 years ago

joshuadugie commented 7 years ago

At issue is the "Gateway ID" field under the "IPsec Settings..." dialog for the VPN. If the VPN server is configured with leftid set to a FQDN, e.g., vpn.example.com, within its ipsec.conf and is using IKEv1...

In both cases, the connection fails since the strongSwan client does not recognize the server's reported identity of the FQDN. This can be fixed by commenting out lines 994 to 1016 in order to make the overwritten ipsec.secrets file instead be the template of : PSK "The_VPN_PSK". In this case, strongSwan does use the global PSK for the server and the connection is established.

To fix this, either this client could:

  1. detect IKEv1 being used
  2. if "Gateway ID" is used for other purposes, create another field separate from "Gateway ID" to be used for the server identity in ipsec.secrets
  3. ignore "Gateway ID" entirely and always use the : PSK "The_VPN_PSK" template if "Gateway ID" is a FQDN
  4. allow the user to specify that no identity should be used in ipsec.secrets, resulting in the correct template of : PSK "The_VPN_PSK"
dkosovic commented 7 years ago

Apologies for my tardiness, been on holiday leave with little Internet access and no Linux.

Will try and work on it tommorow and also think about it a bit more.

dkosovic commented 7 years ago

Thanks for the bug report.

No ID is used now in the temporarily generated ipsec.secrets

joshuadugie commented 7 years ago

Thank you.