Closed bblough closed 1 year ago
nm-l2tp-service --debug
is more useful for debugging IPsec Main Mode (phase 1) and Quick Mode (phase 2) issues. Both Main Mode and Quick Mode seem successful from the logs. In this case, I would recommend using the following for debugging so everything is in one place:
sudo journalctl --no-hostname _SYSTEMD_UNIT=NetworkManager.service + SYSLOG_IDENTIFIER=pppd
Do you have other L2TP devices behind the same NAT connected to the VPN server at the same time? Generally NAT-Traversal does not work for multiple L2TP clients behind the same NAT if the clients are all using UDP source port 1701, as the server is unable to differentiate between multiple L2TP connections coming from the same NAT. See "Unable to establish L2TP connection with UDP source port 1701" section for a workaround :
https://github.com/nm-l2tp/NetworkManager-l2tp#l2tp-connection-issues-with-udp-source-port-1701
journalctl --no-hostname _SYSTEMD_UNIT=NetworkManager.service + SYSLOG_IDENTIFIER=pppd
from that time period unfortunately doesn't seem any more helpful:
Jan 03 10:48:52 NetworkManager[943611]: <info> [1672771732.1008] audit: op="connection-activate" uuid="c6205c9a-8eae-4f51-b873-24517e34a7de" name="VPN to Home" pid=944183 uid=0 result="success"
Jan 03 10:48:52 NetworkManager[943611]: <info> [1672771732.1054] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: Saw the service appear; activating connection
Jan 03 10:48:54 NetworkManager[943611]: <info> [1672771734.8481] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN connection: (ConnectInteractive) reply received
Jan 03 10:48:58 NetworkManager[943611]: <info> [1672771738.9448] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: state changed: starting (3)
Jan 03 10:49:12 NetworkManager[943611]: <warn> [1672771752.9563] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: failed: connect-failed (1)
Jan 03 10:49:12 NetworkManager[943611]: <warn> [1672771752.9563] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: failed: connect-failed (1)
Jan 03 10:49:12 NetworkManager[943611]: <info> [1672771752.9564] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: state changed: stopping (5)
Jan 03 10:49:13 NetworkManager[943611]: <info> [1672771753.0619] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: state changed: stopped (6)
Jan 03 10:49:13 NetworkManager[943611]: <warn> [1672771753.0723] vpn-connection[0x559987d864c0,c6205c9a-8eae-4f51-b873-24517e34a7de,"VPN to Home",0]: VPN plugin: failed: connect-failed (1)
Regarding the other devices - I have previously connected to the server with other devices (leading me to believe the server config is OK), but there are currently no other L2TP devices here on this network (connected or otherwise).
Something really weird happening with that xl2tpd version. I've never seen the control_finish: message type is (null)(0)
error before. Some claim changing to a different version of xl2tpd solves the issue, e.g.:
If you were running network-manager-l2tp >= 1.20.0, it's pretty simple to switch from xl2tpd to Katalix go-l2tp's kl2tpd. Unfortunately you seem to be running network-manager-l2tp 1.2.18.
It's pretty easy to build and install the latest network-manager-l2tp 1.20.8 from the Debian Sid source package with the following :
mkdir nm-l2tp
cd nm-l2tp
dget https://deb.debian.org/debian/pool/main/n/network-manager-l2tp/network-manager-l2tp_1.20.8-1.dsc
cd network-manager-l2tp-1.20.8
debuild -us -uc
cd ..
sudo dpkg -i network-manager-l2tp_1.20.8-1_amd64.deb network-manager-l2tp-gnome_1.20.8-1_amd64.deb
You might need to install some or all of the following dependencies to build xl2tpd:
sudo apt install \
build-essential \
devscripts \
libtool \
network-manager-dev \
libnm-dev \
libnma-dev \
ppp-dev \
libdbus-glib-1-dev \
libsecret-1-dev \
libgtk-3-dev \
libglib2.0-dev \
libssl-dev \
libnss3-dev \
libxml2-utils
NetworkManager-l2tp >= 1.20.0 will use kl2tpd as the default L2TP daemon and fall back to xl2tpd if it can't find it, kl2tpd can readily be installed with :
sudo apt install golang-go
go install "github.com/katalix/go-l2tp/...@latest"
sudo mkdir /usr/local/sbin
sudo cp go/bin/kl2tpd /usr/local/sbin
I did see that serverfault post and the releated ubuntu thread. Based on my reading of it, the version of xl2tpd that I'm running (1.3.12) is the version that works, with 1.3.16 being the one with issues.
That said, I built/installed xl2tpd 1.3.18 from testing/unstable, but that doesn't seem to have had any effect good or bad.
I started to build nm-l2tp 1.20.8 from unstable, but the build-deps aren't immediately satisfiable on bullseye due to lack of gtk4. So to make that work I'm either going to have to compile all of the gtk4 dependencies (there are only a few direct deps, but I'm not sure how long the recursive dependency list is), or upgrade the system to bookworm ahead of its release. Either way, it might be a few days before I can get the time to do either of those.
I was skeptical about the "exact same problem" answer to that serverfault post as the Ubuntu LTO issue, manifests in totally different xl2tpd error messages.
Sorry I forgot that Debian 11 wouldn't come with a gtk4 based GNOME Control Center. The unstable network-manager-l2tp 1.20.8 source package builds both the gtk3 and gtk4 VPN plugin. Last week I back ported to Ubuntu 22.04 and 20.04 and had to remove the following gtk4 related stuff from the package source, you'll be able to do the same modifications:
usr/lib/*/NetworkManager/libnm-gtk4-vpn-plugin-l2tp-editor.so
line.--with-gtk4
line.You might also need to change the debian/changelog file and replace unstable
in the first line to be bullseye
. You may or may not need to change the Standards-Version
in the debian/control file to an older version if you get an error, I had to with Ubuntu 20.04, but not 22.04.
Thanks for the info. That will make things a lot easier.
OK, so this is now working. Unfortunately, I don't know why exactly.
A few weeks ago, I was able to connect with another, "good" device, but was not able to connect with the "bad" device I've been trying to troubleshoot recently. So there definitely was a client-related issue with this particular device. I promise, I'm not imagining it :-)
I had been working under the assumption that the server was still operating fine, but it turns out that it was not. So even with a perfectly working client, connections would not have been successful.
When I found/fixed the server issue, the "bad" device was able to connect, even though it couldn't previously. So something I changed during the troubleshooting process (config changes, library upgrades, etc.) fixed the client issue, only I didn't realize it at the time because it was masked by the server issue.
It's not a satisfying resolution (I really would have liked to have found a root cause - I dislike "accidental" fixes), but it does seem to be resolved.
Thanks for taking the time to help me work through this. Sorry I don't have an actual answer as to what the client-related problem was.
Hi,
If there's a more proper place to ask for help with this, please let me know.
I'm trying to connect to an L2TP VPN using nm-l2tp, and I'm unable to establish a connection. I have connected successfully with other devices, so I'm under the impression that the server config is fine. The system in question is running Debian 11 (Bullseye), and kernel and package versions are listed below.
The logs below reflect an attempt using strongswan, though at one point I also tried libreswan (4.3-1+deb11u1) with no noticeable improvement.
As far as I can tell, it looks like the ipsec tunnel is getting created successfully, but I don't see any entries for pppd in syslog/journalctl. I've also looked for pppd in the process list during connection attempts, but didn't see it. So I'm thinking maybe pppd isn't getting started for some reason, but I haven't been able to figure out why.
Any help would be appreciated.
kernel/package info
modules
nm-l2tp-service --debug
syslog