Thank you for looking into this @hmmsjan!
I have attempted to setup libreswan. Luckily, work have a ipsec.conf
for strongswan that I can use. I assume this ipsec.conf
is old as some online searching appears to show strongswan moved to a new config format. I had to remove a few options that were not supported by libreswan. I am currently stuck at the following error though:
$ sudo ipsec restart
Redirecting to: systemctl restart ipsec.service
$ sudo ipsec up libreswan_testvpn
"libreswan_testvpn": we cannot identify ourselves with either end of this connection. 0.0.0.0 or 131.111.2.3 are not usable
$ journalctl -xeu ipsec.service
Aug 19 09:15:01 fedora pluto[19477]: SELinux support is enabled in ENFORCING mode.
Aug 19 09:15:01 fedora pluto[19477]: systemd watchdog for ipsec service configured with timeout of 200000000 usecs
Aug 19 09:15:01 fedora pluto[19477]: watchdog: sending probes every 100 secs
Aug 19 09:15:01 fedora pluto[19477]: kernel: directional SA supported by kernel
Aug 19 09:15:01 fedora pluto[19477]: kernel: IPTFS ipsec SA error: requires option CONFIG_XFRM_IPTFS
Aug 19 09:15:01 fedora pluto[19477]: kernel: MIGRATE SA supported by kernel
Aug 19 09:15:01 fedora systemd[1]: Started ipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec.
â–‘â–‘ Subject: A start job for unit ipsec.service has finished successfully
â–‘â–‘ Defined-By: systemd
â–‘â–‘ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
â–‘â–‘
â–‘â–‘ A start job for unit ipsec.service has finished successfully.
â–‘â–‘
â–‘â–‘ The job identifier is 40497.
Aug 19 09:15:01 fedora pluto[19477]: seccomp security is not enabled
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": IKE SA proposals (connection add):
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 1:IKE=AES_GCM_16_256-HMAC_SHA2_512+HMAC_SHA2_256-NONE-ECP_256+ECP_384+ECP_521+CURVE25519+MODP4096+MODP3072+MODP2048+>
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 2:IKE=AES_GCM_16_128-HMAC_SHA2_512+HMAC_SHA2_256-NONE-ECP_256+ECP_384+ECP_521+CURVE25519+MODP4096+MODP3072+MODP2048+>
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 3:IKE=CHACHA20_POLY1305-HMAC_SHA2_512+HMAC_SHA2_256-NONE-ECP_256+ECP_384+ECP_521+CURVE25519+MODP4096+MODP3072+MODP20>
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 4:IKE=AES_CBC_256-HMAC_SHA2_512+HMAC_SHA2_256-HMAC_SHA2_512_256+HMAC_SHA2_256_128-ECP_256+ECP_384+ECP_521+CURVE25519>
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 5:IKE=AES_CBC_128-HMAC_SHA2_512+HMAC_SHA2_256-HMAC_SHA2_512_256+HMAC_SHA2_256_128-ECP_256+ECP_384+ECP_521+CURVE25519>
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": Child SA proposals (connection add):
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 1:ESP=AES_GCM_16_256-NONE-NONE-ESN:YES+NO
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 2:ESP=AES_GCM_16_128-NONE-NONE-ESN:YES+NO
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 3:ESP=CHACHA20_POLY1305-NONE-NONE-ESN:YES+NO
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 4:ESP=AES_CBC_256-HMAC_SHA2_512_256+HMAC_SHA2_256_128-NONE-ESN:YES+NO
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": 5:ESP=AES_CBC_128-HMAC_SHA2_512_256+HMAC_SHA2_256_128-NONE-ESN:YES+NO
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": warning: keyingtries=1 ignored, UP connection will attempt to establish until marked DOWN
Aug 19 09:15:01 fedora pluto[19477]: "libreswan_testvpn": added IKEv2 connection
Aug 19 09:15:01 fedora pluto[19477]: addconn: "libreswan_testvpn": warning: keyingtries=1 ignored, UP connection will attempt to establish until marked DOWN
Aug 19 09:15:01 fedora pluto[19477]: addconn: "libreswan_testvpn": added IKEv2 connection
Aug 19 09:15:01 fedora pluto[19477]: addconn:
Aug 19 09:15:01 fedora pluto[19477]: listening for IKE messages
Aug 19 09:15:01 fedora pluto[19477]: Kernel supports NIC esp-hw-offload
Aug 19 09:15:01 fedora pluto[19477]: adding interface virbr0 192.168.122.1:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: adding interface virbr0 192.168.122.1:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: adding interface wlo1 10.30.8.50:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: adding interface wlo1 10.30.8.50:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: adding interface lo 127.0.0.1:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: adding interface lo 127.0.0.1:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: adding interface lo [::1]:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: adding interface lo [::1]:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: loading secrets from "/etc/ipsec.secrets"
Aug 19 09:15:01 fedora pluto[19477]: "/etc/ipsec.secrets" line 2: WARNING: ignored unrecognized keyword: EAP
Aug 19 09:15:01 fedora pluto[19477]: addconn: listening for IKE messages
Aug 19 09:15:01 fedora pluto[19477]: addconn: Kernel supports NIC esp-hw-offload
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface virbr0 192.168.122.1:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface virbr0 192.168.122.1:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface wlo1 10.30.8.50:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface wlo1 10.30.8.50:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface lo 127.0.0.1:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface lo 127.0.0.1:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface lo [::1]:UDP/500
Aug 19 09:15:01 fedora pluto[19477]: addconn: adding interface lo [::1]:UDP/4500 (NAT)
Aug 19 09:15:01 fedora pluto[19477]: addconn: loading secrets from "/etc/ipsec.secrets"
Aug 19 09:15:01 fedora pluto[19477]: addconn: "/etc/ipsec.secrets" line 2: WARNING: ignored unrecognized key
Aug 19 09:15:01 fedora pluto[19477]: addconn: word: EAP
Aug 19 09:15:01 fedora pluto[19477]: addconn:
Aug 19 09:15:04 fedora pluto[19477]: | initiate: remote_host=<null> (using host from connection) (initiate_connection() +69 programs/pluto/initiate.c)
Aug 19 09:15:04 fedora pluto[19477]: | connection $1: "libreswan_testvpn"
Aug 19 09:15:04 fedora pluto[19477]: | host: 0.0.0.0->131.111.2.3
Aug 19 09:15:04 fedora pluto[19477]: | id: ... -> C=GB, ST=..., O=..., CN=...
Aug 19 09:15:04 fedora pluto[19477]: | routing+kind: UNROUTED TEMPLATE
Aug 19 09:15:04 fedora pluto[19477]: | selectors: <unset-selector> -> 0.0.0.0/0 ->; lease: -> ->
Aug 19 09:15:04 fedora pluto[19477]: | spds:
Aug 19 09:15:04 fedora pluto[19477]: | policy: IKEv2+RSASIG+ECDSA+RSASIG_v1_5+ENCRYPT+TUNNEL+PFS+IKE_FRAG_ALLOW+ESN_NO+ESN_YES
Aug 19 09:15:04 fedora pluto[19477]: "libreswan_testvpn": we cannot identify ourselves with either end of this connection. 0.0.0.0 or 131.111.2.3 are not usable
Here is my /etc/ipsec.conf
:
# @@CONFDIR@@/ipsec.conf - Libreswan 4.x configuration file
#
# see 'man ipsec.conf' and 'man pluto' for more information
#
# For example configurations and documentation, see https://libreswan.org/wiki/
config setup
# If logfile= is unset, syslog is used to send log messages too.
# Note that on busy VPN servers, the amount of logging can trigger
# syslogd (or journald) to rate limit messages.
#logfile=/var/log/pluto.log
# Debugging should only be used to find bugs, not configuration issues!
# "base" regular debug, "tmi" is excessive (!) and "private" will log
# sensitive key material (not available in FIPS mode). The "cpu-usage"
# value logs timing information and should not be used with other
# debug options as it will defeat getting accurate timing information.
# Default is "none"
# plutodebug="base"
# plutodebug="tmi"
#plutodebug="none"
# Whether to log IP addresses of incoming connections. Disable when
# logfile privacy is required.
#logip=yes
# The startup mode of the DDoS defense mechanism. Acceptable values
# are busy, unlimited or auto (the default). This option can also be
# given to the IKE daemon while running, for example by issuing ipsec
# whack --ddos--busy. When in busy mode, pluto activates the IKEv2
# anti-DDoS # counter measures.
#ddos-mode=auto
# DDoS defense mechanism threshold
# The number of half-open IKE SAs before the pluto IKE daemon will be
# placed in (anti-ddos) busy mode. The default is 25000.
# IKEv1 policy (accept, reject or drop)
# See RFC XXX - Deprecation of IKEv1 and obsoleted algorithms
#ikev1-policy=accept
# IKEv2 global redirect (during IKE_SA_INIT)
# Whether to send requests for the remote peer to redirect IKE/IPsec
# SA's during IKE_SA_INIT. Valid options are no (the default), yes
# and auto, where auto means that the requests will be sent if DDoS
# mode is active (see ddos-mode). If set, the option
# global-redirect-to= must also be set to indicate where to redirect
# peers to. this can be given to the IKE daemon while running using
# ipsec whack --global-redirect{-to}
#global-redirect=no
#global-redirect-to=<ip or hostname>, ...
# The number of half-open IKE SAs before the IKE daemon starts
# refusing all new IKE attempts. Established IKE peers are not
# affected.
#max-halfopen-ike=5000
# Whether pluto performs DNSSEC validation.
#dnssec-enable=yes
# To accept IKE and IPsec encapsulation over TCP. Requires at least
# Linux 5.7 kernel or a kernel with TCP backport (like RHEL8 4.18.0-291)
# To enable IKE and IPsec over TCP for VPN client, also specify
# tcp-remote-port=4500 in the client's conn section.
#listen-tcp=no
# SECCOMP syscall filtering (enabled,disabled or tolerant)
# Whether to log (when tolerant) or restart (when enabled) when
# a rogue syscall is attempted by pluto indicating a remote code
# exploit attempt. # If using custom _updown scripts, this might
# trigger false positives.
#seccomp=disabled
# if it exists, include system wide crypto-policy defaults
#include /etc/crypto-policies/back-ends/libreswan.config
# It is best to add your IPsec connections as separate files
# in /etc/ipsec.d/
#include /etc/ipsec.d/*.conf
conn libreswan_testvpn
keyexchange=ikev2
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
# eap_identity=%any
reauth=no
left=%any
leftid=...
# leftauth=eap
leftautheap=tls
# leftsourceip=%config
# leftfirewall=yes
rightid="C=GB, ST=..., O=..., CN=..."
rightca="C=US, ST=..., L=..., O=..., CN=..."
rightsubnet=0.0.0.0/0
auto=add
and my /etc/ipsec.secrets
:
... : EAP "..."
Any ideas?