1
0
mirror of synced 2024-11-23 21:36:09 +03:00

Compare commits

...

4 Commits

Author SHA1 Message Date
hwdsl2
30f0f598e4 Update docs 2022-05-08 03:23:45 -05:00
hwdsl2
81d26c08fa Update IKEv2 script
- Add a check for IKEv2-only mode before removing IKEv2.
2022-05-08 02:59:28 -05:00
hwdsl2
eed8e236a3 Cleanup 2022-05-08 02:43:47 -05:00
hwdsl2
0425be8c4a Remove xl2tpd workaround
- The fixed xl2tpd package is now in the Ubuntu repos. This workaround
  is no longer necessary.
  Ref: https://bugs.launchpad.net/ubuntu/+source/xl2tpd/+bug/1951832
2022-05-08 02:26:17 -05:00
6 changed files with 15 additions and 21 deletions

View File

@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
</details>
<details>
<summary>
如果无法使用 wget 下载,请点这里。
如果无法下载,请点这里。
</summary>
你也可以使用 `curl` 下载。例如:

View File

@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
</details>
<details>
<summary>
Click here if you are unable to download using wget.
Click here if you are unable to download.
</summary>
You may also use `curl` to download. For example:

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -151,7 +151,7 @@ confirm_or_abort() {
show_header() {
cat <<'EOF'
IKEv2 Script Copyright (c) 2020-2022 Lin Song 30 Apr 2022
IKEv2 Script Copyright (c) 2020-2022 Lin Song 8 May 2022
EOF
}
@ -1300,6 +1300,15 @@ cat 1>&2 <<EOF
Error: IKEv2 configuration section found in $IPSEC_CONF.
This script cannot automatically remove IKEv2 from this server.
To manually remove IKEv2, see vpnsetup.net/ikev2
EOF
abort_and_exit
fi
if grep -qs "ikev1-policy=drop" "$IPSEC_CONF" \
|| grep -qs "ikev1-policy=reject" "$IPSEC_CONF"; then
cat 1>&2 <<EOF
Error: IKEv2-only mode is currently enabled on this VPN server.
You must first disable IKEv2-only mode before removing IKEv2.
Otherwise, you will NOT be able to connect to this VPN server.
EOF
abort_and_exit
fi

View File

@ -310,7 +310,7 @@ remove_vpn() {
print_vpn_removed() {
echo
echo "IPsec VPN removed! Please reboot your server."
echo "IPsec VPN removed! Please reboot your server. This is optional, but recommended."
}
vpnuninstall() {

View File

@ -80,7 +80,6 @@ check_os() {
exiterr "This script only supports Ubuntu and Debian."
;;
esac
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = "8" ] || [ "$os_ver" = "jessiesid" ]; then
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
@ -536,19 +535,6 @@ apply_gcp_mtu_fix() {
fi
}
apply_xl2tpd_fix() {
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bookwormsid" ] && [ "$os_arch" = "x86_64" ]; then
xl2tpd_url="https://mirrors.kernel.org/ubuntu/pool/universe/x/xl2tpd"
deb_file="xl2tpd_1.3.16-1ubuntu0.1_amd64.deb"
cd /opt/src || exit 1
if wget -t 3 -T 30 -q -O "$deb_file" "$xl2tpd_url/$deb_file"; then
bigecho "Applying fix for xl2tpd..."
apt-get -yqq install "./$deb_file" >/dev/null
fi
/bin/rm -f "$deb_file"
fi
}
enable_on_boot() {
bigecho "Enabling services on boot..."
IPT_PST=/etc/init.d/iptables-persistent
@ -647,7 +633,7 @@ IKEv2 guide: vpnsetup.net/ikev2
EOF
if [ ! -e /dev/ppp ]; then
cat <<'EOF'
Warning: /dev/ppp is missing, and IPsec/L2TP mode may not work. Please use
WARNING: /dev/ppp is missing, and IPsec/L2TP mode may not work. Please use
IKEv2 (vpnsetup.net/ikev2) or IPsec/XAuth mode to connect.
Debian 11/10 users, see vpnsetup.net/debian10
@ -701,7 +687,6 @@ vpnsetup() {
create_vpn_config
update_sysctl
update_iptables
apply_xl2tpd_fix
apply_gcp_mtu_fix
enable_on_boot
start_services