From 0e24f8b0860696280976c5c902667ed2f5487a77 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Thu, 9 Jun 2022 13:44:16 -0500 Subject: [PATCH] Cleanup --- docs/images/script-demo.svg | 2 +- extras/add_vpn_user.sh | 3 +-- extras/ikev2changeaddr.sh | 2 +- extras/ikev2onlymode.sh | 2 +- extras/ikev2setup.sh | 10 +++++----- extras/quickstart.sh | 3 +-- extras/update_vpn_users.sh | 6 +++--- vpnsetup.sh | 3 +-- vpnsetup_alpine.sh | 8 +++----- vpnsetup_amzn.sh | 8 +++----- vpnsetup_centos.sh | 8 +++----- vpnsetup_ubuntu.sh | 10 ++++------ 12 files changed, 27 insertions(+), 38 deletions(-) diff --git a/docs/images/script-demo.svg b/docs/images/script-demo.svg index 9495363..9f04bd7 100644 --- a/docs/images/script-demo.svg +++ b/docs/images/script-demo.svg @@ -1 +1 @@ -##CreatingVPNconfiguration...##VPNcredentialsnotsetbyuser.GeneratingrandomPSKandpassword...##Installingpackagesrequiredforsetup...++apt-get+apt-get-yqq+apt-get-yqqupdate+apt-get-yqqinstall+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrepsednet-tools##TryingtoautodiscoverIPofthisserver...##InstallingpackagesrequiredfortheVPN...+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-devlibcap-ng-utilslibselinux1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolslibevent-devlibsystemd-devuuid-runtimepppxl2tpd##InstallingFail2BantoprotectSSH...+apt-get-yqqinstallfail2ban##DownloadingIKEv2script...+wget+wget-t+wget-t3+wget-t3-T+wget-t3-T30+wget-t3-T30-q+wget-t3-T30-q-O+wget-t3-T30-q-Oikev2.shhttps://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras/ikev2setup.sh##DownloadingLibreswan...+wget-t3-T30-q-Olibreswan-4.4.tar.gzhttps://github.com/libreswan/libreswan/archive/v4.4.tar.gz##CompilingandinstallingLibreswan,pleasewait...+make+make-j2-sbase+make-sinstall-base##VPNsetupinprogress...Pleasebepatient.##Updatingsysctlsettings...##UpdatingIPTablesrules...##Enablingservicesonboot...##Startingservices...================================================IPsecVPNserverisnowreadyforuse!ConnecttoyournewVPNwiththesedetails:ServerIP:192.0.2.1IPsecPSK:DEMO_ONLY_DO_NOT_USEUsername:vpnuserPassword:DEMO_ONLY_DO_NOT_USEWritethesedown.You'llneedthemtoconnect!Importantnotes:vpnsetup.net/notesVPNclientsetup:vpnsetup.net/clientsIKEv2guide:vpnsetup.net/ikev2##StartingIKEv2setupinautomode,usingdefaultoptions.IKEv2setupsuccessful.DetailsforIKEv2mode:VPNserveraddress:192.0.2.1VPNclientname:vpnclientClientconfigurationisavailableat:/root/vpnclient.p12(forWindows&Linux)/root/vpnclient.sswan(forAndroid)/root/vpnclient.mobileconfig(foriOS&macOS)*IMPORTANT*Passwordforclientconfigfiles:DEMO_ONLY_DO_NOT_USEWritethisdown,you'llneeditforimport!Nextsteps:ConfigureIKEv2VPNclients.See:https://vpnsetup.net/ikev2+apt-get-yqqinstallwget+apt-get-yqqinstallwgetdnsutils+apt-get-yqqinstallwgetdnsutilsopenssl+apt-get-yqqinstallwgetdnsutilsopenssliptables+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawk+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrep+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrepsed+apt-get-yqqinstalllibnss3-dev+apt-get-yqqinstalllibnss3-devlibnspr4-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-config+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-devlibcap-ng-utilsx1-devx1-devlibcurl4-nss-devx1-devlibcurl4-nss-devflexx1-devlibcurl4-nss-devflexbisonx1-devlibcurl4-nss-devflexbisongccx1-devlibcurl4-nss-devflexbisongccmakex1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolsx1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolslibevent-dev+wget-t3-T30-q-Oikev2.sh+wget-t3-T30-q-Olibreswan-4.4.tar.gz+make-j2+make-j2-s+make-s##CheckingforMOBIKEsupport...notavailable##GeneratingCAandservercertificates...##Generatingclientcertificate...##Creatingclientconfiguration...##AddinganewIKEv2connection...##RestartingIPsecservice... +##CreatingVPNconfiguration...##VPNcredentialsnotsetbyuser.GeneratingrandomPSKandpassword...##Installingpackagesrequiredforsetup...++apt-get+apt-get-yqq+apt-get-yqqupdate+apt-get-yqqinstall+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrepsednet-tools##TryingtoautodiscoverIPofthisserver...##InstallingpackagesrequiredfortheVPN...+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-devlibcap-ng-utilslibselinux1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolslibevent-devlibsystemd-devuuid-runtimepppxl2tpd##InstallingFail2BantoprotectSSH...+apt-get-yqqinstallfail2ban##DownloadingIKEv2script...+wget+wget-t+wget-t3+wget-t3-T+wget-t3-T30+wget-t3-T30-q+wget-t3-T30-q-O+wget-t3-T30-q-Oikev2.shhttps://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras/ikev2setup.sh##DownloadingLibreswan...+wget-t3-T30-q-Olibreswan-4.4.tar.gzhttps://github.com/libreswan/libreswan/archive/v4.4.tar.gz##CompilingandinstallingLibreswan,pleasewait...+make+make-j2-sbase+make-sinstall-base##VPNsetupinprogress...Pleasebepatient.##Updatingsysctlsettings...##UpdatingIPTablesrules...##Enablingservicesonboot...##Startingservices...================================================IPsecVPNserverisnowreadyforuse!ConnecttoyournewVPNwiththesedetails:ServerIP:192.0.2.1IPsecPSK:DEMO_ONLY_DO_NOT_USEUsername:vpnuserPassword:DEMO_ONLY_DO_NOT_USEWritethesedown.You'llneedthemtoconnect!Importantnotes:vpnsetup.net/notesVPNclientsetup:vpnsetup.net/clientsIKEv2guide:vpnsetup.net/ikev2##StartingIKEv2setupinautomode,usingdefaultoptions.IKEv2setupsuccessful.DetailsforIKEv2mode:VPNserveraddress:192.0.2.1VPNclientname:vpnclientClientconfigurationisavailableat:/root/vpnclient.p12(forWindows&Linux)/root/vpnclient.sswan(forAndroid)/root/vpnclient.mobileconfig(foriOS&macOS)*IMPORTANT*Passwordforclientconfigfiles:DEMO_ONLY_DO_NOT_USEWritethisdown,you'llneeditforimport!Nextsteps:ConfigureIKEv2VPNclients.See:https://vpnsetup.net/clients+apt-get-yqqinstallwget+apt-get-yqqinstallwgetdnsutils+apt-get-yqqinstallwgetdnsutilsopenssl+apt-get-yqqinstallwgetdnsutilsopenssliptables+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawk+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrep+apt-get-yqqinstallwgetdnsutilsopenssliptablesiproute2gawkgrepsed+apt-get-yqqinstalllibnss3-dev+apt-get-yqqinstalllibnss3-devlibnspr4-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-config+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-dev+apt-get-yqqinstalllibnss3-devlibnspr4-devpkg-configlibpam0g-devlibcap-ng-devlibcap-ng-utilsx1-devx1-devlibcurl4-nss-devx1-devlibcurl4-nss-devflexx1-devlibcurl4-nss-devflexbisonx1-devlibcurl4-nss-devflexbisongccx1-devlibcurl4-nss-devflexbisongccmakex1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolsx1-devlibcurl4-nss-devflexbisongccmakelibnss3-toolslibevent-dev+wget-t3-T30-q-Oikev2.sh+wget-t3-T30-q-Olibreswan-4.4.tar.gz+make-j2+make-j2-s+make-s##CheckingforMOBIKEsupport...notavailable##GeneratingCAandservercertificates...##Generatingclientcertificate...##Creatingclientconfiguration...##AddinganewIKEv2connection...##RestartingIPsecservice... diff --git a/extras/add_vpn_user.sh b/extras/add_vpn_user.sh index 74701f0..3234b5d 100755 --- a/extras/add_vpn_user.sh +++ b/extras/add_vpn_user.sh @@ -90,8 +90,7 @@ Password: $VPN_PASSWORD Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================ diff --git a/extras/ikev2changeaddr.sh b/extras/ikev2changeaddr.sh index a45b668..a5ba519 100755 --- a/extras/ikev2changeaddr.sh +++ b/extras/ikev2changeaddr.sh @@ -104,7 +104,7 @@ check_ikev2() { if ! grep -qs "conn ikev2-cp" /etc/ipsec.d/ikev2.conf; then cat 1>&2 <<'EOF' Error: You must first set up IKEv2 before changing IKEv2 server address. - See: vpnsetup.net/ikev2 + See: https://vpnsetup.net/ikev2 EOF exit 1 fi diff --git a/extras/ikev2onlymode.sh b/extras/ikev2onlymode.sh index d7c1faf..369d308 100755 --- a/extras/ikev2onlymode.sh +++ b/extras/ikev2onlymode.sh @@ -59,7 +59,7 @@ EOF if ! check_ikev2_exists; then cat 1>&2 <<'EOF' Error: Your must first set up IKEv2 before selecting IKEv2-only mode. - See: vpnsetup.net/ikev2 + See: https://vpnsetup.net/ikev2 EOF exit 1 fi diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index dd47c39..5f88572 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -151,7 +151,7 @@ confirm_or_abort() { show_header() { cat <<'EOF' -IKEv2 Script Copyright (c) 2020-2022 Lin Song 7 Jun 2022 +IKEv2 Script Copyright (c) 2020-2022 Lin Song 10 Jun 2022 EOF } @@ -175,7 +175,7 @@ Options: -h, --help show this help message and exit To customize IKEv2 or client options, run this script without arguments. -For documentation, see: vpnsetup.net/ikev2 +For documentation, see: https://vpnsetup.net/ikev2 EOF exit 1 } @@ -1076,7 +1076,7 @@ create_config_readme() { && [ "$use_defaults" = "1" ] && [ ! -t 1 ] && [ ! -f "$readme_file" ]; then cat > "$readme_file" <<'EOF' These IKEv2 client config files were created during IPsec VPN setup. -To configure IKEv2 clients, see: https://vpnsetup.net/ikev2 +To configure IKEv2 clients, see: https://vpnsetup.net/clients EOF if [ "$export_to_home_dir" = "1" ]; then chown "$SUDO_USER:$SUDO_USER" "$readme_file" @@ -1271,7 +1271,7 @@ EOF cat <<'EOF' Next steps: Configure IKEv2 clients. See: -https://vpnsetup.net/ikev2 +https://vpnsetup.net/clients ================================================ @@ -1299,7 +1299,7 @@ check_ipsec_conf() { cat 1>&2 </dev/null 2>&1 || exiterr "'openssl' not found. Abort." if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then cat 1>&2 <<'EOF' -For usage information, visit vpnsetup.net/notes, then click on Manage VPN Users. +For usage information, visit https://github.com/hwdsl2/setup-ipsec-vpn, +then click on Manage VPN Users. EOF exit 1 fi @@ -107,8 +108,7 @@ cat <<'EOF' Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================== diff --git a/vpnsetup.sh b/vpnsetup.sh index 971f145..09eceba 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -27,8 +27,7 @@ YOUR_IPSEC_PSK='' YOUR_USERNAME='' YOUR_PASSWORD='' -# Important notes: vpnsetup.net/notes -# VPN client setup: vpnsetup.net/clients +# VPN client setup: https://vpnsetup.net/clients # ===================================================== diff --git a/vpnsetup_alpine.sh b/vpnsetup_alpine.sh index 2b879de..5baec76 100755 --- a/vpnsetup_alpine.sh +++ b/vpnsetup_alpine.sh @@ -26,8 +26,7 @@ YOUR_IPSEC_PSK='' YOUR_USERNAME='' YOUR_PASSWORD='' -# Important notes: vpnsetup.net/notes -# VPN client setup: vpnsetup.net/clients +# VPN client setup: https://vpnsetup.net/clients # ===================================================== @@ -529,8 +528,7 @@ Password: $VPN_PASSWORD Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================ @@ -553,7 +551,7 @@ cat <<'EOF' IKEv2 is already set up on this server. Next steps: Configure IKEv2 clients. See: -https://vpnsetup.net/ikev2 +https://vpnsetup.net/clients To manage IKEv2 clients, run: sudo ikev2.sh diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index 39ba3d9..159b696 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -26,8 +26,7 @@ YOUR_IPSEC_PSK='' YOUR_USERNAME='' YOUR_PASSWORD='' -# Important notes: vpnsetup.net/notes -# VPN client setup: vpnsetup.net/clients +# VPN client setup: https://vpnsetup.net/clients # ===================================================== @@ -545,8 +544,7 @@ Password: $VPN_PASSWORD Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================ @@ -569,7 +567,7 @@ cat <<'EOF' IKEv2 is already set up on this server. Next steps: Configure IKEv2 clients. See: -https://vpnsetup.net/ikev2 +https://vpnsetup.net/clients To manage IKEv2 clients, run: sudo ikev2.sh diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 44a2f3c..0d5f459 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -28,8 +28,7 @@ YOUR_IPSEC_PSK='' YOUR_USERNAME='' YOUR_PASSWORD='' -# Important notes: vpnsetup.net/notes -# VPN client setup: vpnsetup.net/clients +# VPN client setup: https://vpnsetup.net/clients # ===================================================== @@ -685,8 +684,7 @@ Password: $VPN_PASSWORD Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================ @@ -709,7 +707,7 @@ cat <<'EOF' IKEv2 is already set up on this server. Next steps: Configure IKEv2 clients. See: -https://vpnsetup.net/ikev2 +https://vpnsetup.net/clients To manage IKEv2 clients, run: sudo ikev2.sh diff --git a/vpnsetup_ubuntu.sh b/vpnsetup_ubuntu.sh index 2e813c1..e1e4484 100755 --- a/vpnsetup_ubuntu.sh +++ b/vpnsetup_ubuntu.sh @@ -27,8 +27,7 @@ YOUR_IPSEC_PSK='' YOUR_USERNAME='' YOUR_PASSWORD='' -# Important notes: vpnsetup.net/notes -# VPN client setup: vpnsetup.net/clients +# VPN client setup: https://vpnsetup.net/clients # ===================================================== @@ -647,8 +646,7 @@ Password: $VPN_PASSWORD Write these down. You'll need them to connect! -Important notes: vpnsetup.net/notes -VPN client setup: vpnsetup.net/clients +VPN client setup: https://vpnsetup.net/clients ================================================ @@ -657,7 +655,7 @@ EOF cat <<'EOF' WARNING: /dev/ppp is missing, and IPsec/L2TP mode may not work. Please use IKEv2 or IPsec/XAuth mode to connect. - Debian 11/10 users, see vpnsetup.net/debian10 + Debian 11/10 users, see https://vpnsetup.net/debian10 EOF fi @@ -679,7 +677,7 @@ cat <<'EOF' IKEv2 is already set up on this server. Next steps: Configure IKEv2 clients. See: -https://vpnsetup.net/ikev2 +https://vpnsetup.net/clients To manage IKEv2 clients, run: sudo ikev2.sh