Libreswan Documentation

Logo

Libreswan's Online Documentation

View the Project on GitHub libreswan/libreswan.github.io

Support
FAQ Common Error Messages
History
Implemented Standards
Kernel Support
HOWTO Additional ipsec.conf documentation
AWS Mesh
brendans Road Warrior Setup at Home
Configuration examples
Confuse !?@: github wiki
Enterprise cloud encryption
Entropy matters
EoIP shared ethernet LAN using IPsec
High Availability Fallover VPN in AWS
Host to host VPN
Host to host VPN with PSK
Libreswan as client to a Cisco ASA or VPN3000 server
Microsoft Azure configuration
Migrate from IKEv1 DPD to IKEv2 LIVENESS
Opportunistic IPsec
Opportunistic IPsec using LetsEncrypt
Pluto and DNSSEC
Read status output
Route based VPN
SElinux and Labeled IPsec VPN
Subnet extrusion
Subnet to subnet using NAT
Subnet to subnet VPN
Subnet to subnet VPN with PSK
Unauthenticated Opportunistic IPsec
Using Apache to serve PKCS
Using NSS Hardware Tokens
Using NSS with libreswan
VPN server for remote clients using IKEv2
VPN server for remote clients using IKEv2 split VPN
GSoC 2027 Code Project Ideas DRAFT
Contributor Guidance DRAFT
Completed Projects 2026 RFC 9593 Announcing Supported Authentication Methods in IKEv2
2026 Improve the ACQUIRE to IKE policy lookup
2026 Add HOST TO HOST Support on BSD
2021 RFC 8420 Add EdDSA Signature Authentication Support to IKEv2
2020 Session Resumption
2020 IKEv2 Interop testing with OpenBSD
2020 IKE Intermediate Exchange
2019 Libreswan Opportunistic IPsec using LetsEncrypt
2018 RSA PSS Support in compliance with RFC 7427 and RFC 8247
2018 RFC 7427 Add ECDSA Signature Authentication Support to IKEv2
2018 RFC 5685 Redirect Mechanism
2018 Managing Interface
2017 TCP encapsulation of IKE and IPsec
2017 RFC 7427 Add Signature Authentication Support to IKEv2
2017 Postquantum Preshared Keys
Presentations
IRC
Hacking Documentation
Git, GitHub, and Pull Requests
Merging GitHub Pull Requests
Programming Conventions
Testing Docker
KVM 1. Setup The Host
2. Configure Testing
3. Compile Libreswan
4. Test Libreswan
5. Accessing The Console
6. Maintenance and Internals
Bisecting
Debugging Pluto
Logging In Using SSH
Performance
Running A Custom Kernel
Running A Single Test
Running In The Background
Setup a Web Server
Testing Old Branches
Updating Test Results
Namespace Magic
Namespaces
Topology
Internals 3.14 X509
Benchmarking and Performance testing
Cipher suites and algorithm support
Cloud OE ideas
Compiling with AddressSanitizer
Compliance of RFC 7427 Signature Authentication in IKEv2
Coverity
Cryptographic Acceleration
Developer links strongswan android
Discouraged or forbidden C functions
IKEv2 Child SA
IKEv2 CP and EAP support
Introduction
Libreswan xfrm kernel support
Logging cleanup
New OE
Pluto
Pluto packet processing
Proposed ipsec ca command
Retransmit timings
Road Map
SAref code
Setting up system for debug logging
stf status
Testing 2017 Next Generation
Unbound
Uncrustify
Use Cases and Requirements document for ECC ECDSA support
Use Cases and Requirements document
XFRM Interface Development Notes
XFRM pCPU
XFRM pCPU RSS
Security Crypto boundary and certification
Libreswan and Heartbleed
Libreswan and TunnelCrack
Reporting a Vulnerability
Vulnerabilities
Meetups 2013 Helsinki
2014 San Francisco
2014 Toronto
2018 Toronto
Obsolete HOWTOs IKEv1 XAUTH with FreeOTP and FreeIPA
IKEv1 XAUTH with Google Authenticator One Time Passwords
Route based VPN using VTI
Testing Namespace
VPN server for remote clients using IKEv1 with L2TP
VPN server for remote clients using IKEv1 XAUTH with Certificates
VPN server for remote clients using IKEv1 XAUTH with PSK

Introduction

IPSec standards are produced and maintained by Internet Engineering Task Force which are implemented by many software including Libreswan. OpenIKED is one such native implementation of IKEv2 on OpenBSD. My project’s purpose is to enable Interop tests where one end is Libreswan on Linux and the other is the native IKE daemon on OpenBSD. This helps us test Linux kernel to BSD kernel and understand several issues with Linux when inter-operating with with Non-Linux Operating Systems.

Implementation

The libreswan KVM Testsuite libvirt/qemu testing system auto-installs Linux and then compiles libreswan on these virtual machines. It then fires up these machines for individual tests and verifies the expected results with reference output. The test suite also supports strongswan on Linux. To add OpenBSD to this, the following tasts we completed:

Perform a Non-interactive OpenBSD Base installation

OpenBSD’s autoinstall only allows unattended installation by automatically responding to installer questions with answers through a response file (auto_install.conf). But this installation system is not fully working to complete the entire install non-interactively. To solve this, a pexpect script using python was written which adds install.conf to the OpenBSD installer image by modifying the ISO image directly.

Mounting the testing directory over NFS

The Libreswan’s testing system uses a 9P File System with Libvirt/Qemu to mount the testing directory. Unfortunately, OpenBSD’s 9P filesystem was incompatibility with Linux and failed to work. It was therefor decided to use NFS instead. This has a disadvantage that if the openBSD’s IPsec is not working properly, it could make the NFS mounts unreachable to the host, and log files would be lost and the /testing directory would fail to work during part of the test and cause the test case to fail.

Using NFS for OpenBSD means that the Linux host operating system that launches all the testing virtual machines also needed to be configured as an NFS server.

Cloning the base install image

To provide support for OpenBSD being a responder (like the linux “east” machine) and being an initiator (like the linux “west” machine), after the initial openbsd install, the base image is clone into “openbsde” (OpenBSD East) and “openbsdw” (OpenBSD West) virtual machines. There was some unexpected behaviour when the openbsd machines used the “east” or “west” names in the individual tests, which is why the alternative names are used. This also needed some support in the base testing setup because until now, every test always had the machine “east” booted first. Now this can be either “east” (linux) or openbsde (openbsd).

Adding OpenBSD specific tests

Iniitally, two tests were created (interop-ikev2-openbbsd-01 and 02) that perform a basic standard IKEv2 PSK based connection. One test has openbsd initiating and one test has openbsd responding.

Issues encountered

OpenBSD’s documentation is very scarce and incomplete. This caused a lot of problems at the start of the project.

The 9P filesystems of Linux and OpenBSD turned out to be incompatible and could not be made to work together. To mount the 9P File system on OpenBSD, the Plan9port port package needs to be installed but this one does not work with the 9P filesystem of Qemu. This is because Qemu’s 9p is not the same as Plan9port. Plan 9’s 9p is 9p2000 which transports a subset of plan 9 system calls over the network while Qemu’s 9p is 9p2000.L and transports a subset of Linux system calls over the network. Significant time was spend in attempting to make this work before falling back to using NFS.

When the NFS server was up and running, the NFS mount were not working initially on OpenBSD. After analysis of logs and network traces using tcpdump, it became clear that Fedora’s firewall was blocking the packets. Disabling the firewall made the NFS mount work as intended. This was challenging as it was difficult to figure out whether the issue was with OpenBSD or Linux - especially due to the lack of documentation and lack of user experiences for OpenBSD. It seems most OpenBSD users work only with OpenBSD machines, resulting in hardly any information or documentation on interoperability with Linux.

Possible Future Work

Additionals tests that cover a lot more features of the OpenBSD IKE daemon should be added. X.509 certificates, ECDSA, IKE fragmentation are examples of test cases that still need to be written.

See if FreeBSD can be added similarly to how OpenBSD has been added.

A separate project would be to port libreswan to OpenBSD natively and then test interop of libreswan on Linux with libreswan on openbsd. While libreswan was recently re-ported to NetBSD, it has not yet been re-ported to OpenBSD of FreeBSD.

Source code

The Source code for this project is merged into the main branch of Libreswan Repository and will be released with libreswan version 4.0. The commits associated with this project are :

This project work was sponsored by Google as part of the Google Summer of Code 2020 Program. The implementation for this project is done by Ravi Teja(hello@rtcms.dev) under the guidance of Paul Wouters, Tuomo Soini, and Andrew Cagney.

License

This project is Licensed under GNU General Public License v2.0.