02Chapter 2: Tunnelling: packets inside packetsThis chapter assumes you know IP addressing and subnets, how a routing table and default route work, and the difference between TCP and UDP. It also assumes you can use a Linux shell. The rest of the tutorial builds on the mechanism described here.6 min read
03Chapter 3: What a VPN adds to a tunnelThis chapter assumes you know IP addressing and subnets, how a routing table and a default route work, and the difference between TCP and UDP. It also assumes you can use a Linux command line. The previous chapter showed that a tunnel wraps one packet inside another. Here we ask what must be added t7 min read
04Chapter 4: Overhead, MTU and fragmentationThis chapter assumes you know IP addressing and subnets, how a routing table and default route work, the difference between TCP and UDP, and basic Linux command-line use. It also builds on the previous chapters' idea of encapsulation: a tunnel wraps an inner packet in an outer packet.6 min read
05Chapter 5: GRE: a simple tunnel with no protectionThis chapter assumes you know IP addressing, subnets and routing tables, and the idea of encapsulation from the earlier chapter on tunnelling. You should also be comfortable with a Linux shell. GRE (Generic Routing Encapsulation) is the plainest tunnel in common use. It wraps one packet in another a6 min read
06Chapter 6: Confidentiality, integrity and authenticationA tunnel on its own only moves packets. It does not hide them, protect them from changes, or prove who sent them. This chapter covers the three properties that turn a tunnel into a VPN, and the primitives that provide each one.6 min read
07Chapter 7: How two peers agree on keysThis chapter assumes you know what encapsulation is, understand the confidentiality, integrity and authentication goals from the previous chapter, and can read a Linux command line. It explains how two machines that have never met agree on a shared secret over a network anyone can watch. It also cov8 min read
08Chapter 8: IPsec: ESP, IKE and the two modesThis chapter assumes you know how encapsulation works (a packet carried as the payload of another packet), the basics of IP routing, and the three security goals of confidentiality, integrity and authentication. It also assumes you know what a key exchange does. Here you will see how IPsec combines 7 min read
09Chapter 9: Tunnels through NATThis chapter assumes you know IP addressing and subnets, how a routing table and default route work, and the difference between TCP and UDP. It also assumes you have read the earlier chapters on encapsulation and on IPsec (ESP and IKE). Here you will see why Network Address Translation (NAT) breaks 7 min read
10Chapter 10: TLS-based VPNsThis chapter assumes you know what encapsulation is, how a routing table and default route work, and the difference between TCP and UDP. It also assumes you have read the earlier chapters on key exchange, public keys and certificates. You should be comfortable with a Linux command line.7 min read
11Chapter 11: WireGuard: a minimal modern VPNThis chapter assumes you know IP addressing and subnets, how a routing table and default route work, the difference between TCP and UDP, and basic Linux command-line use. It also assumes you have read the earlier chapters on encapsulation, authentication and encryption, and key exchange.6 min read
12Chapter 12: SSH tunnels for single servicesThis chapter assumes you know TCP versus UDP, basic IP addressing, and how to use a Linux shell. It also assumes you have read the earlier chapters on encapsulation and key exchange. A VPN carries whole IP packets. An SSH tunnel carries individual TCP connections, one service at a time, over a conne5 min read
13Chapter 13: Split tunnelling, full tunnelling and DNSThis chapter assumes you know how a routing table and a default route work, how longest-prefix matching picks a route, and the difference between TCP and UDP. You should also be comfortable on a Linux command line and have seen the idea of a tunnel as a virtual interface. After this chapter you shou6 min read
14Chapter 14: What a VPN does and does not protectThis chapter assumes you know how routing tables, default routes and DNS resolution work. It also assumes you have met the main VPN types (IPsec, TLS-based VPNs, WireGuard and SSH tunnels) in earlier chapters. Here the question is what a VPN actually buys you. The answer depends on the threat you ar6 min read
15Chapter 15: Troubleshooting a tunnel that will not pass trafficThis chapter assumes you have read the earlier chapters on encapsulation, GRE, IPsec, WireGuard and routing policy. You should be comfortable with routing tables, the difference between TCP and UDP, and a Linux shell. The examples use GRE and WireGuard, but the method applies to any tunnel.7 min read