install networkmanager-l2tp
first:
yaourt -S networkmanager-l2tp
then reboot or systemctl restart NetworkManager
because
nmtui
can not create VPN connections, so I ended up creating one in the GUI and analysis generated config file
this can be done only via root, create the vpn config /etc/NetworkManager/system-connections/{vpn_name}
manually:
[connection]
id={vpn_name}
uuid=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
type=vpn
autoconnect=false
permissions=
[vpn]
gateway={ip_of_vpn_server}
ipsec-psk={PSK}
password-flags=2
user={given_user}
service-type=org.freedesktop.NetworkManager.l2tp
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
fill {vpn_name}
{ip_of_vpn_server}
, {PSK}
, {given_user}
, change uuid if needed (list current connections via nmcli c
) and make sure the config permission is 600
with owner root:root
, then:
systemctl restart NetworkManager # reload to detect the config
nmcli c up {vpn_name} --ask # establish the vpn connection, it will ask for password
nmcli # check connection status
nmcli c down {vpn_name} # close the vpn connection
Gateway
is the ip of the vpn serverUser name
is the given user- Password can be left blank to enter when connecting
- click
IPsec Settings...
button- Check
Enable IPsec tunnel to L2TP host
- paste PSK to
Pre-shared key
- IMPORTANT Uncheck
Enable IPsec tunnel to L2TP host
before clickOK
button, I think this is a bug
- Check
- click
Add
button and enable