diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67cdfc8..5751a64 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,13 +103,13 @@ jobs: iptables -nL -t nat | grep -q '192\.168\.43\.0/24' if [ "$1" = "centos" ]; then grep pluto /var/log/secure - grep pluto /var/log/secure | grep -q 'added connection description "l2tp-psk"' - grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"' + grep pluto /var/log/secure | grep -q 'added IKEv1 connection "l2tp-psk"' + grep pluto /var/log/secure | grep -q 'added IKEv1 connection "xauth-psk"' grep xl2tpd /var/log/messages else grep pluto /var/log/auth.log - grep pluto /var/log/auth.log | grep -q 'added connection description "l2tp-psk"' - grep pluto /var/log/auth.log | grep -q 'added connection description "xauth-psk"' + grep pluto /var/log/auth.log | grep -q 'added IKEv1 connection "l2tp-psk"' + grep pluto /var/log/auth.log | grep -q 'added IKEv1 connection "xauth-psk"' grep xl2tpd /var/log/syslog fi cat /var/log/fail2ban.log @@ -147,11 +147,11 @@ jobs: systemctl restart ipsec sleep 10 grep pluto /var/log/secure | tail -n 20 - grep pluto /var/log/secure | grep -q 'added connection description "ikev2-cp"' + grep pluto /var/log/secure | grep -q 'added IKEv2 connection "ikev2-cp"' else sleep 10 grep pluto /var/log/auth.log | tail -n 20 - grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"' + grep pluto /var/log/auth.log | grep -q 'added IKEv2 connection "ikev2-cp"' fi bash ikev2.sh <&2 <> /etc/ipsec.d/ikev2.conf < Makefile.inc.local <<'EOF' -WERROR_CFLAGS = -w -USE_DNSSEC = false -USE_DH2 = true -USE_DH31 = false -USE_NSS_AVA_COPY = true -USE_NSS_IPSEC_PROFILE = false -USE_GLIBC_KERN_FLIP_HEADERS = true +WERROR_CFLAGS=-w +USE_DNSSEC=false +USE_DH2=true +USE_DH31=false +USE_NSS_AVA_COPY=true +USE_NSS_IPSEC_PROFILE=false +USE_GLIBC_KERN_FLIP_HEADERS=true +USE_NSS_KDF=false +FINALNSSDIR=/etc/ipsec.d EOF if ! grep -qs IFLA_XFRM_LINK /usr/include/linux/if_link.h; then - echo "USE_XFRM_INTERFACE_IFLA_HEADER = true" >> Makefile.inc.local + echo "USE_XFRM_INTERFACE_IFLA_HEADER=true" >> Makefile.inc.local fi if [ "$(packaging/utils/lswan_detect.sh init)" = "systemd" ]; then apt-get -yq install libsystemd-dev || exiterr2 @@ -276,7 +278,7 @@ conn xauth-psk rightmodecfgclient=yes modecfgpull=yes xauthby=file - ike-frag=yes + fragmentation=yes cisco-unity=yes also=shared diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 6d016b6..6bf420b 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -185,7 +185,7 @@ yum "$REPO1" -y install fail2ban || exiterr2 bigecho "Compiling and installing Libreswan..." -SWAN_VER=3.32 +SWAN_VER=4.1 swan_file="libreswan-$SWAN_VER.tar.gz" swan_url1="https://github.com/libreswan/libreswan/archive/v$SWAN_VER.tar.gz" swan_url2="https://download.libreswan.org/$swan_file" @@ -196,16 +196,18 @@ fi tar xzf "$swan_file" && /bin/rm -f "$swan_file" cd "libreswan-$SWAN_VER" || exit 1 cat > Makefile.inc.local <<'EOF' -WERROR_CFLAGS = -w -USE_DNSSEC = false -USE_DH2 = true -USE_DH31 = false -USE_NSS_AVA_COPY = true -USE_NSS_IPSEC_PROFILE = false -USE_GLIBC_KERN_FLIP_HEADERS = true +WERROR_CFLAGS=-w +USE_DNSSEC=false +USE_DH2=true +USE_DH31=false +USE_NSS_AVA_COPY=true +USE_NSS_IPSEC_PROFILE=false +USE_GLIBC_KERN_FLIP_HEADERS=true +USE_NSS_KDF=false +FINALNSSDIR=/etc/ipsec.d EOF if ! grep -qs IFLA_XFRM_LINK /usr/include/linux/if_link.h; then - echo "USE_XFRM_INTERFACE_IFLA_HEADER = true" >> Makefile.inc.local + echo "USE_XFRM_INTERFACE_IFLA_HEADER=true" >> Makefile.inc.local fi NPROCS=$(grep -c ^processor /proc/cpuinfo) [ -z "$NPROCS" ] && NPROCS=1 @@ -276,7 +278,7 @@ conn xauth-psk rightmodecfgclient=yes modecfgpull=yes xauthby=file - ike-frag=yes + fragmentation=yes cisco-unity=yes also=shared @@ -487,9 +489,9 @@ fi bigecho "Starting services..." -restorecon /etc/ipsec.d/*db >/dev/null -restorecon /usr/local/sbin -Rv >/dev/null -restorecon /usr/local/libexec/ipsec -Rv >/dev/null +restorecon /etc/ipsec.d/*db 2>/dev/null +restorecon /usr/local/sbin -Rv 2>/dev/null +restorecon /usr/local/libexec/ipsec -Rv 2>/dev/null sysctl -e -q -p