How To Install libreswan.x86_64 on Amazon Linux 2

In this tutorial we learn how to install libreswan.x86_64 in Amazon Linux 2. libreswan.x86_64 is IPsec implementation with IKEv1 and IKEv2 keying protocols

Introduction

In this tutorial we learn how to install libreswan.x86_64 on Amazon Linux 2.

What is libreswan.x86_64

Libreswan is a free implementation of IPsec & IKE for Linux. IPsec is the Internet Protocol Security and uses strong cryptography to provide both authentication and encryption services. These services allow you to build secure tunnels through untrusted networks. Everything passing through the untrusted net is encrypted by the ipsec gateway machine and decrypted by the gateway at the other end of the tunnel. The resulting tunnel is a virtual private network or VPN. This package contains the daemons and userland tools for setting up Libreswan. It supports the NETKEY/XFRM IPsec kernel stack that exists in the default Linux kernel. Libreswan also supports IKEv2 (RFC-7296) and Secure Labeling Libreswan is based on Openswan-2.6.38 which in turn is based on FreeS/WAN-2.04

We can use yum to install libreswan.x86_64 on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install libreswan.x86_64.

Install libreswan.x86_64 on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install libreswan.x86_64 using yum by running the following command:

sudo yum -y install libreswan.x86_64

How To Uninstall libreswan.x86_64 on Amazon Linux 2

To uninstall only the libreswan.x86_64 package we can use the following command:

sudo yum remove libreswan.x86_64

libreswan.x86_64 Package Contents on Amazon Linux 2

/etc/ipsec.conf
/etc/ipsec.d
/etc/ipsec.d/policies
/etc/ipsec.d/policies/block
/etc/ipsec.d/policies/clear
/etc/ipsec.d/policies/clear-or-private
/etc/ipsec.d/policies/portexcludes.conf
/etc/ipsec.d/policies/private
/etc/ipsec.d/policies/private-or-clear
/etc/ipsec.secrets
/etc/pam.d/pluto
/etc/prelink.conf.d
/etc/prelink.conf.d/libreswan-fips.conf
/usr/lib/systemd/system/ipsec.service
/usr/lib64/fipscheck/pluto.hmac
/usr/libexec/ipsec
/usr/libexec/ipsec/_import_crl
/usr/libexec/ipsec/_keycensor
/usr/libexec/ipsec/_plutorun
/usr/libexec/ipsec/_secretcensor
/usr/libexec/ipsec/_stackmanager
/usr/libexec/ipsec/_unbound-hook
/usr/libexec/ipsec/_updown
/usr/libexec/ipsec/_updown.klips
/usr/libexec/ipsec/_updown.netkey
/usr/libexec/ipsec/addconn
/usr/libexec/ipsec/algparse
/usr/libexec/ipsec/auto
/usr/libexec/ipsec/barf
/usr/libexec/ipsec/cavp
/usr/libexec/ipsec/enumcheck
/usr/libexec/ipsec/eroute
/usr/libexec/ipsec/klipsdebug
/usr/libexec/ipsec/look
/usr/libexec/ipsec/newhostkey
/usr/libexec/ipsec/pf_key
/usr/libexec/ipsec/pluto
/usr/libexec/ipsec/readwriteconf
/usr/libexec/ipsec/rsasigkey
/usr/libexec/ipsec/setup
/usr/libexec/ipsec/show
/usr/libexec/ipsec/showhostkey
/usr/libexec/ipsec/spi
/usr/libexec/ipsec/spigrp
/usr/libexec/ipsec/tncfg
/usr/libexec/ipsec/verify
/usr/libexec/ipsec/whack
/usr/sbin/ipsec
/usr/share/doc/libreswan-3.25
/usr/share/doc/libreswan-3.25/CHANGES
/usr/share/doc/libreswan-3.25/CHANGES.freeswan.pluto
/usr/share/doc/libreswan-3.25/CHANGES.openswan
/usr/share/doc/libreswan-3.25/COPYING
/usr/share/doc/libreswan-3.25/CREDITS
/usr/share/doc/libreswan-3.25/CREDITS.freeswan
/usr/share/doc/libreswan-3.25/CREDITS.openswan
/usr/share/doc/libreswan-3.25/LICENSE
/usr/share/doc/libreswan-3.25/PlutoFlow.png
/usr/share/doc/libreswan-3.25/PlutoFlow.svg
/usr/share/doc/libreswan-3.25/ProgrammingConventions.txt
/usr/share/doc/libreswan-3.25/README.IANA-PEN
/usr/share/doc/libreswan-3.25/README.KLIPS
/usr/share/doc/libreswan-3.25/README.OCF
/usr/share/doc/libreswan-3.25/README.XAUTH
/usr/share/doc/libreswan-3.25/README.labeledipsec
/usr/share/doc/libreswan-3.25/README.md
/usr/share/doc/libreswan-3.25/README.nss
/usr/share/doc/libreswan-3.25/README.rfcs
/usr/share/doc/libreswan-3.25/README.x509
/usr/share/doc/libreswan-3.25/examples
/usr/share/doc/libreswan-3.25/examples/hub-spoke.conf
/usr/share/doc/libreswan-3.25/examples/ipv6.conf
/usr/share/doc/libreswan-3.25/examples/l2tp-cert.conf
/usr/share/doc/libreswan-3.25/examples/l2tp-psk.conf
/usr/share/doc/libreswan-3.25/examples/linux-linux.conf
/usr/share/doc/libreswan-3.25/examples/mast-l2tp-psk.conf
/usr/share/doc/libreswan-3.25/examples/oe-authnull.conf
/usr/share/doc/libreswan-3.25/examples/oe-dnssec-client.conf
/usr/share/doc/libreswan-3.25/examples/oe-dnssec-server.conf
/usr/share/doc/libreswan-3.25/examples/oe-exclude-dns.conf
/usr/share/doc/libreswan-3.25/examples/oe-letsencrypt-README.txt
/usr/share/doc/libreswan-3.25/examples/oe-letsencrypt-client.conf
/usr/share/doc/libreswan-3.25/examples/oe-letsencrypt-server.conf
/usr/share/doc/libreswan-3.25/examples/oe-upgrade-authnull.conf
/usr/share/doc/libreswan-3.25/examples/sysctl.conf
/usr/share/doc/libreswan-3.25/examples/xauth.conf
/usr/share/doc/libreswan-3.25/ipsecsaref.png
/usr/share/doc/libreswan-3.25/l2tp-overhead.txt
/usr/share/doc/libreswan-3.25/libreswan-sysctl.conf
/usr/share/doc/libreswan-3.25/nss-howto.txt
/usr/share/doc/libreswan-3.25/opportunistic-v1.historic
/usr/share/doc/libreswan-3.25/opportunistic-v1.historic/opportunism-spec.txt
/usr/share/doc/libreswan-3.25/opportunistic-v1.historic/opportunism.nr
/usr/share/doc/libreswan-3.25/pluto-internals.txt
/usr/share/doc/libreswan-3.25/win2k-notes.txt
/usr/share/doc/libreswan-3.25/windows-cross-compile.txt
/usr/share/man/man5/ipsec.conf.5.gz
/usr/share/man/man5/ipsec.secrets.5.gz
/usr/share/man/man5/ipsec_eroute.5.gz
/usr/share/man/man5/ipsec_klipsdebug.5.gz
/usr/share/man/man5/ipsec_pf_key.5.gz
/usr/share/man/man5/ipsec_spi.5.gz
/usr/share/man/man5/ipsec_spigrp.5.gz
/usr/share/man/man5/ipsec_tncfg.5.gz
/usr/share/man/man5/ipsec_trap_count.5.gz
/usr/share/man/man5/ipsec_trap_sendcount.5.gz
/usr/share/man/man5/ipsec_version.5.gz
/usr/share/man/man8/ipsec.8.gz
/usr/share/man/man8/ipsec__import_crl.8.gz
/usr/share/man/man8/ipsec__keycensor.8.gz
/usr/share/man/man8/ipsec__plutorun.8.gz
/usr/share/man/man8/ipsec__secretcensor.8.gz
/usr/share/man/man8/ipsec__stackmanager.8.gz
/usr/share/man/man8/ipsec__unbound-hook.8.gz
/usr/share/man/man8/ipsec__updown.8.gz
/usr/share/man/man8/ipsec__updown.klips.8.gz
/usr/share/man/man8/ipsec__updown.netkey.8.gz
/usr/share/man/man8/ipsec_addconn.8.gz
/usr/share/man/man8/ipsec_auto.8.gz
/usr/share/man/man8/ipsec_barf.8.gz
/usr/share/man/man8/ipsec_checknss.8.gz
/usr/share/man/man8/ipsec_eroute.8.gz
/usr/share/man/man8/ipsec_import.8.gz
/usr/share/man/man8/ipsec_initnss.8.gz
/usr/share/man/man8/ipsec_klipsdebug.8.gz
/usr/share/man/man8/ipsec_look.8.gz
/usr/share/man/man8/ipsec_newhostkey.8.gz
/usr/share/man/man8/ipsec_pf_key.8.gz
/usr/share/man/man8/ipsec_pluto.8.gz
/usr/share/man/man8/ipsec_readwriteconf.8.gz
/usr/share/man/man8/ipsec_rsasigkey.8.gz
/usr/share/man/man8/ipsec_setup.8.gz
/usr/share/man/man8/ipsec_show.8.gz
/usr/share/man/man8/ipsec_showhostkey.8.gz
/usr/share/man/man8/ipsec_spi.8.gz
/usr/share/man/man8/ipsec_spigrp.8.gz
/usr/share/man/man8/ipsec_tncfg.8.gz
/usr/share/man/man8/ipsec_verify.8.gz
/usr/share/man/man8/ipsec_whack.8.gz
/usr/share/man/man8/pluto.8.gz
/var/log/pluto/peer
/var/run/pluto

References

Summary

In this tutorial we learn how to install libreswan.x86_64 on Amazon Linux 2 using yum.