Closed Frozen-byte closed 8 years ago
Comparing to my /var/log/syslog, you seem to have a lot more strongswan packages installed, I only have the following :
I've had connection issues when one of the extra strongswan plugins was installed.
From the following line :
loaded IKE secret for @vpnpsk @psk
for the IPSec Options, you seem to be filling in the Group Name and Gateway ID which I've always left blank.
Are you using "vpnpsk" and "psk" for the Group Name and Gateway ID on the Android device?
Sorry just noticed you were using Kubuntu, so I assume you are using Plasma-nm KDE front-end for NetworkManager-l2tp. I don't know if that front-end needs to be modified to support the changes to NetworkManager-l2tp1.2.2.
Unfortunately in some situations strongSwan's "ipsec up {connection name}" command doesn't return failure if the IPsec connection was unsuccessful, and I'm not able to check with "ipsec status", which I've submitted a bug : https://bugs.launchpad.net/ubuntu/+source/strongswan/+bug/1587886 I'm still looking into it.
Temporary Workaround for the Apparmor bug is to execute as sudo:
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.charon
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.stroke
I've uninstalled many modules and left the Groupname nad GatewayID blank, no changes. My error stays. The server answers NO_PROPOSAL_CHOSEN all the time.
Do you may know the android default settings? I may setup ipsec/xl2dp manually and test the connection.
Unless you have a Cisco VPN server, the default on most operating systems is to keep the Group details blank.
Sorry I have no idea what Android is using.
You can have a look at /var/run/nm-ipsec-l2tp.????/ipsec.conf for a strongswan connection sample and you will also need to add the PSK to /etc/ipsec.secrets.
After doing an 'ipsec up {connection name}' make sure it is really up with an 'ipsec status {connection name}'
one other option is to remove strongswan, then build and install libreswan into /usr/local (like you did with xl2tpd)
Files are created when I attempt to connect the VPN:
cat /var/run/nm-ipsec-l2tp.28766/ipsec.conf
conn nm-ipsec-l2tp-28766
auto=add
type=transport
authby=secret
keyingtries=0
left=%defaultroute
leftprotoport=udp/l2tp
rightprotoport=udp/l2tp
right=*snip*
keyexchange=ikev1
cat /var/run/nm-ppp-options.xl2tpd.28766
ipparam nm-l2tp-service-28766
nodetach
usepeerdns
noipdefault
nodefaultroute
noauth
noccp
refuse-pap
nopcomp
noaccomp
lcp-echo-failure 0
lcp-echo-interval 0
plugin /usr/lib/pppd/2.4.7//nm-l2tp-pppd-plugin.so
cat /var/run/nm-xl2tpd.conf.28766
[global]
access control = yes
port = 1701
[lac l2tp]
lns = *snip*
pppoptfile = /var/run/nm-ppp-options.xl2tpd.28766
autodial = yes
tunnel rws = 8
tx bps = 100000000
rx bps = 100000000
BTW: My network Interfaces are named enp0s25 and wlo1 and '/usr/lib/pppd/2.4.7//nm-l2tp-pppd-plugin.so' exists
Sorry I meant you could use the connection in /var/run/nm-ipsec-l2tp.28766/ipsec.conf as a starting template to possiblly add and/or remove options till it works with the strongSwan command-line.
You will need to add a pre-shared key to /etc/ipsec.secrets with a line something like:
: PSK this-is-my-PSK
with this-is-my-PSK replaced by the actual PSK.
Either add the connection to /etc/ipsec.conf or load your own ipsec.conf file with something like the following, then bring up the IPsec connection:
sudo ipsec restart --conf /var/run/nm-ipsec-l2tp.28766/ipsec.conf --debug
sudo ipsec up nm-ipsec-l2tp-28766
sudo ipsec status
You can see all the ipsec.conf options here : https://wiki.strongswan.org/projects/strongswan/wiki/ConnSection
Some IKEv1 PSK examples here : https://wiki.strongswan.org/projects/strongswan/wiki/IKEv1Examples
FINALLY! I connected with the following config values:
conn nm-ipsec-l2tp-7828
auto=add
type=transport
authby=psk
left=%any
fragmentation=yes
leftprotoport=udp/l2tp
rightprotoport=udp/l2tp
right=*snip*
keyexchange=ikev1
ike=3des-sha1-modp1024
and added the PSK into /etc/ipsec-secrets
the magic line is: ike=3des-sha1-modp1024
to establish the Tunnel.
ipsec status
also returns positive.
Guess I have to gamble with the xl2tpd settings now, since the Tunnel does not answer:
echo "c l2tp" > /var/run/xl2tpd/l2tp-control
xl2tpd[3525]: Calling on tunnel 30933
Maximum retries exceeded for tunnel 30933. Closing.
Glad to hear you got it working with that line. Sounds like a bug with the negotiation of the proposal.
For xl2tpd command-line usage, I wouldn't use unmodified xl2tp config files generated by NetworkManager-l2tp as it is required to talk to the /usr/lib/pppd/2.4.7/nm-l2tp-pppd-plugin.so
plugin specified in one of the generated config files.
Another option is to modify the following line in src/nm-l2tp-service.c :
write_config_option (ipsec_fd, " authby=secret\n"
" keyingtries=0\n"
" left=%%defaultroute\n"
" leftprotoport=udp/l2tp\n"
" rightprotoport=udp/l2tp\n");
to add ike=3des-sha1-modp1024
or just add the following line after that code:
write_config_option (ipsec_fd, " ike=3des-sha1-modp1024\n");
and then make
and sudo make install
Works good (forked your repo with the changes I made) But I am afraid to tell you, the pppd is still not able to create the DBus interface:
connection 'nm-ipsec-l2tp-31736' established successfully
** Message: ipsec ready for action
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
** Message: xl2tpd started with pid 31805
xl2tpd[31805]: setsockopt recvref[30]: Protocol not available
xl2tpd[31805]: Using l2tp kernel support.
xl2tpd[31805]: xl2tpd version xl2tpd-1.3.7 started on Laptop PID:31805
xl2tpd[31805]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.
xl2tpd[31805]: Forked by Scott Balmos and David Stipp, (C) 2001
xl2tpd[31805]: Inherited by Jeff McAdams, (C) 2002
xl2tpd[31805]: Forked again by Xelerance (www.xelerance.com) (C) 2006-2016
xl2tpd[31805]: Listening on IP address 0.0.0.0, port 38165
xl2tpd[31805]: get_call: allocating new tunnel for host *snip*, port 1701.
xl2tpd[31805]: Connecting to host *snip*, port 1701
xl2tpd[31805]: control_finish: message type is (null)(0). Tunnel is 0, call is 0.
xl2tpd[31805]: control_finish: sending SCCRQ
** (nm-l2tp-service:31736): WARNING **: Looks like pppd didn't initialize our dbus module
The "Looks like pppd didn't initialize our dbus module" message happens after a 10 second timeout waiting for xl2tpd/pppd.
The timeout value can be bumped up by changing the following line in src/nm-l2tp-service.c
:
#define NM_L2TP_WAIT_PPPD 10000 /* 10 seconds */
The KDE frontend might need to be updated to match the DBus changes in commit https://github.com/nm-l2tp/network-manager-l2tp/commit/66a5355c971a77aaa7b06540025521084116609a , I'll try and install Kubuntu on top of Ubuntu and see if I can reproduce.
I've reproduced the issue with Kubuntu.
Looking at KDE's Plasma-nm source code on the following page: https://github.com/KDE/plasma-nm/tree/master/vpn it hasn't been updated for the DBus changes with the nm version 1.2.2 VPN plug-ins, in particular pptp and l2tp (which is based on the pptp changes).
Ubuntu 16.04 is still shipping the old network-manager-pptp 1.1.93 which still works with Plasma-nm.
For network-manager-l2tp, you should be able to do the following in the master branch to get a version old enough to still work with Plasma-nm :
git checkout 65c0ae8
I ran into a different issue with xl2tpd, so not able to confirm if it works with Plasma-nm at the moment, but will try again later.
Ignore my previous message (I somehow forgot to enable IPsec).
I'm using HEAD of the network-manager-l2tp master branch and it seems to be working for me with Kubuntu on a VM, only issue I see is a nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
issue :
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: Call established with 123.54.5.87, Local: 13740, Remote: 2671, Serial: 1 (ref=0/0)
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: start_pppd: I'm running:
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "/usr/sbin/pppd"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "passive"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "nodetach"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: ":"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "file"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "/var/run/nm-ppp-options.xl2tpd.22430"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "plugin"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "pppol2tp.so"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "pppol2tp"
Jun 20 23:35:17 kubuntu NetworkManager[775]: xl2tpd[22496]: "7"
Jun 20 23:35:17 kubuntu pppd[22497]: Plugin /usr/lib/pppd/2.4.7/nm-l2tp-pppd-plugin.so loaded.
Jun 20 23:35:17 kubuntu NetworkManager[775]: ** Message: nm-l2tp-ppp-plugin: (plugin_init): initializing
Jun 20 23:35:17 kubuntu pppd[22497]: Plugin pppol2tp.so loaded.
Jun 20 23:35:17 kubuntu pppd[22497]: pppd 2.4.7 started by root, uid 0
Jun 20 23:35:17 kubuntu NetworkManager[775]: ** Message: nm-l2tp-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
Jun 20 23:35:17 kubuntu NetworkManager[775]: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
Jun 20 23:35:17 kubuntu NetworkManager[775]: <info> [1466429717.5991] manager: (ppp0): new Generic device (/org/freedesktop/NetworkManager/Devices/5)
Jun 20 23:35:17 kubuntu pppd[22497]: Using interface ppp0
Jun 20 23:35:17 kubuntu pppd[22497]: Connect: ppp0 <-->
Jun 20 23:35:17 kubuntu NetworkManager[775]: ** Message: nm-l2tp-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
Someone else reported a similar issue elsewhere with the "Looks like pppd didn't initialize our dbus module" message and I asked them to increase the 10 second timeout in src/nm-l2tp-service.c
:
#define NM_L2TP_WAIT_PPPD 10000 /* 10 seconds */
Thank you for your help @dkosovic I can connect to the VPN now.
To summarize my steps:
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.charon
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.stroke
Glad to hear. I'll close this issue.
To overcome the apparmor issue, I've requested a patch ( https://launchpadlibrarian.net/267770874/usr.lib.ipsec.patch ) to add attach_disconnected
that is applied to:
With the appamour issue hopefully solved, I'll be able to add a test to check the IPsec connection is really up before starting the L2TP connection.
I've got to get back to the xl2tpd issue which required a local rebuild, but as I haven't been able to reproduce in a while, I'm not sure if I can.
When I try to connect to my companies L2TP/IPsec via PSK it is not working. On Android Device I can connect without any problems-
Logs when I try to connect to the VPN: nm-l2tp --debug
syslog:
in addition here is the ike-scan report:
I've installed: Kubuntu 16.04 xl2tpd-1.3.7 (compiled from master branch) pppd 2.4.7 strongSwan U5.3.5/K4.4.0-24-generic network manager 1.2.0 and applied:
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.charon
apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.stroke