how to connect to ikev2/L2TP vpn server from centos 7?

Issues related to configuring your network
Post Reply
sudip06
Posts: 5
Joined: 2018/10/04 18:07:51

how to connect to ikev2/L2TP vpn server from centos 7?

Post by sudip06 » 2018/10/04 18:10:18

Hello,
I have to connect to ikev2/L2TP vpn server from centos 7. I am just thinking of vpn option in network manager, isnt it possible to connect it from there? Can somebody please help me out as I am very new to is vpn thing. I wont like to install any further software if its not really needed. I am just wondering if I could use the vpn option("VPN OFF", "VPN Settings") already present in networking manager on centos 7.

Thanks a lot.
Sudip

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by tunk » 2018/10/05 10:01:16

I've never used Network Manager, but I have used openconnect from the command line.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by TrevorH » 2018/10/05 13:36:02

These are the packages I use to connect to an l2tp VPN.

Code: Select all

xl2tpd.x86_64                                                   1.3.8-3.el7                                   epel         
NetworkManager-l2tp.x86_64                                      1.2.10-1.el7                                  epel         
NetworkManager-l2tp-gnome.x86_64                                1.2.10-1.el7                                  epel         
libreswan.x86_64                                                3.23-5.el7_5                                  updates 
Mostly I use the command line not NM.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sudip06
Posts: 5
Joined: 2018/10/04 18:07:51

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by sudip06 » 2018/10/05 16:27:16

Can you please share the command from command line? I have also installed the above mentioned packages.

Best Regards,
Sudip

sudip06
Posts: 5
Joined: 2018/10/04 18:07:51

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by sudip06 » 2018/10/05 16:49:36

tunk wrote:
2018/10/05 10:01:16
I've never used Network Manager, but I have used openconnect from the command line.
Can you please share how you use.
I have received the following:


VPN : Ikev2/L2TP
VPN Host: <ip address>
Username: <username>
Password: <password>
PSK : <password>

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by TrevorH » 2018/10/05 17:37:07

Use the NM applet, Edit Connetions menu choice then add a new connection. The first thing it asks you is the connection type and you should choose "Layer 2 Tunneling Protocol - L2TP" then you have a GUI to fill in all that information.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sudip06
Posts: 5
Joined: 2018/10/04 18:07:51

Re: how to connect to ikev2/L2TP vpn server from centos 7?

Post by sudip06 » 2018/10/05 18:16:00

Thanks a lot for the help. I set up a vpn account in NM and here is the debug output from the same.

output from "journalctl -u NetworkManager"

Code: Select all

NetworkManager[1044]: 002 loading secrets from "/etc/ipsec.d/nm-l2tp-ipsec-0cab31fe-7133-45a6-8196-b39f356b6ef0.secrets"
NetworkManager[1044]: 002 loading secrets from "/etc/ipsec.d/nm-l2tp-ipsec-49823d44-9586-4400-886d-74181156fb01.secrets"
NetworkManager[1044]: debugging mode enabled
NetworkManager[1044]: cannot load config '/var/run/nm-l2tp-ipsec-0cab31fe-7133-45a6-8196-b39f356b6ef0.conf': can't load file '/var/run/nm-l2tp-ipsec-0cab31fe-7133-45a6-8196-b39f356b6ef0.conf'
NetworkManager[1044]: opening file: /var/run/nm-l2tp-ipsec-0cab31fe-7133-45a6-8196-b39f356b6ef0.conf
nm-l2tp-service[23003]: g_dbus_method_invocation_take_error: assertion 'error != NULL' failed
NetworkManager[1044]: <info>  [1538762370.8648] vpn-connection[0x55f544a3c4c0,0cab31fe-7133-45a6-8196-b39f356b6ef0,"VPN 2",0]: VPN plugin: state changed: stopped (6)
NetworkManager[1044]: <info>  [1538762370.8668] vpn-connection[0x55f544a3c4c0,0cab31fe-7133-45a6-8196-b39f356b6ef0,"VPN 2",0]: VPN service disappeared
NetworkManager[1044]: <warn>  [1538762370.8677] vpn-connection[0x55f544a3c4c0,0cab31fe-7133-45a6-8196-b39f356b6ef0,"VPN 2",0]: VPN connection: failed to connect: 'Message recipient disconnected from message bus without replying'

Incidentally, phase 1 and phase 2 algorithms are empty, should it be something?


Thanks a lot,
Sudip

Post Reply