Before building L2TP/IPsec, you need to master basic networking, Linux operations, and the fundamentals of cryptography. In this episode you also set up two Linux VMs, install Libreswan, strongSwan, xl2tpd, ppp, and OpenSSL, and verify the first installation.

Welcome to the Learn L2TP IPsec series! This series will guide you to mastery of L2TP/IPsec — a Layer 2 VPN that combines the L2TP tunneling protocol with IPsec encryption and authentication — from conceptual foundations to production-grade deployment. There are 23 episodes in total, organized into six phases.
But before we touch any configuration, there are a few essential skills and software packages you need to have in place. Why are these prerequisites important? Because L2TP/IPsec is not a single daemon — it is three layers of a system working together: IPsec for encryption, L2TP for tunneling, and PPP for user sessions. If you do not understand one of these layers, troubleshooting later will feel like dismantling a black box.
Episode 0 is your roadmap: we will make sure you have the essential skills, set up two Linux VMs, install all required packages, and run the first verification. Once this episode is done, you can follow the rest of the series comfortably.
L2TP/IPsec lives between Layer 2 and Layer 3 of the OSI model. You must be comfortable with IP routing, NAT (especially for NAT-T in episode 14), and iptables/nftables firewalls, because a VPN gateway almost always adds MASQUERADE rules and opens ports. Also understand the concept of encapsulation: how one packet is wrapped inside another packet.
Check these skills by running:
ip addr show
ip route show
sudo iptables -t nat -L -nYou also need to know the OSI model's Layer 2 versus Layer 3. L2TP is a Layer 2 protocol that carries PPP frames, while IPsec protects IP packets at Layer 3. We will examine this concept in full in episodes 2 and 5.
All the daemons we use — ipsec (pluto/charon), xl2tpd, pppd — run on Linux and are managed through systemd. Get used to commands like systemctl start, systemctl enable, and journalctl -u. Pick one package manager (apt for Debian/Ubuntu, dnf for Fedora, pacman for Arch) and master how to install packages and find their versions.
Understand three cryptography foundations without memorizing the math: symmetric encryption like AES for encrypting data, asymmetric keys for key exchange and digital signatures, Diffie-Hellman for producing a shared secret over an open network, and X.509 certificates as digital identities. These concepts become the common language when we discuss IKE in episode 4 and certificates in episodes 6 and 16.
Prepare two Linux VMs based on Debian or Ubuntu: one acting as the server (L2TP/IPsec gateway) and one as the client. Allocate at least 1 CPU and 1 GB of RAM for each. Note down the public and private IP addresses of both VMs, because all examples in this series use the following scheme:
Server (LNS) : 203.0.113.10 (public), 10.10.10.1/24 (LAN)
Client (LAC) : 198.51.100.20 (public), 10.10.10.50/24 (LAN)
PPP pool : 192.168.42.0/24 (dialed in by the client)Replace 203.0.113.10 and 198.51.100.20 with your public IPs. The 203.0.113.x and 198.51.100.x blocks are RFC 5737 documentation ranges that are safe for examples.
Install everything on the server; on the client only what is needed. On Debian/Ubuntu:
sudo apt update
sudo apt install libreswan xl2tpd ppp opensslTo study strongSwan as an alternative (episode 10), install it on the second VM as well so it does not conflict with Libreswan:
sudo apt install strongswanThe two IPsec daemons must not run simultaneously on the same machine, because both manage the kernel IPsec stack and use UDP ports 500 and 4500.
Before moving on, make sure all binaries are available and their versions are clear:
ipsec --version
xl2tpd --version
pppd --version
openssl versionNote down each version. As of this series being written, ipsec --version on the Libreswan side shows Libreswan 5.3.2, strongSwan shows strongSwan 6.0.7, and xl2tpd shows xl2tpd 1.3.20. Minor version differences generally do not change the configuration syntax we discuss.
Info
Libreswan 5.x disables IKEv1 by default since release 5.0. Keep this in mind from the start, because most classic L2TP/IPsec remote-access setups use IKEv1 — we will enable it explicitly in episode 9.
A recap of the prerequisites you have prepared in episode 0:
If anything is still missing, stop and complete it before continuing. A strong foundation will make the next 22 episodes feel much lighter.
In episode 0 you have laid the groundwork for the entire series: understanding the networking, Linux, and cryptography skills required, preparing two VMs, installing Libreswan, strongSwan, xl2tpd, ppp, and OpenSSL, and verifying all versions.
Key takeaways:
In the next episode, episode 1, we will discuss the history, background, and why L2TP/IPsec — from the evolution of PPTP toward L2F, the birth of L2TP through RFC 2661, to the decision to combine it with IPsec through RFC 3193. Make sure both VMs are ready, because the Learn L2TP IPsec journey is just beginning!