Compare commits
No commits in common. "30f0f598e4470280991a61c16d91771b3e64c348" and "160fbe70a81e0b7c90034fd216ac3f3239c0519a" have entirely different histories.
30f0f598e4
...
160fbe70a8
@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
|
|||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
如果无法下载,请点这里。
|
如果无法使用 wget 下载,请点这里。
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
你也可以使用 `curl` 下载。例如:
|
你也可以使用 `curl` 下载。例如:
|
||||||
|
@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
|
|||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
Click here if you are unable to download.
|
Click here if you are unable to download using wget.
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
You may also use `curl` to download. For example:
|
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 |
@ -151,7 +151,7 @@ confirm_or_abort() {
|
|||||||
show_header() {
|
show_header() {
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
|
|
||||||
IKEv2 Script Copyright (c) 2020-2022 Lin Song 8 May 2022
|
IKEv2 Script Copyright (c) 2020-2022 Lin Song 30 Apr 2022
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -1300,15 +1300,6 @@ cat 1>&2 <<EOF
|
|||||||
Error: IKEv2 configuration section found in $IPSEC_CONF.
|
Error: IKEv2 configuration section found in $IPSEC_CONF.
|
||||||
This script cannot automatically remove IKEv2 from this server.
|
This script cannot automatically remove IKEv2 from this server.
|
||||||
To manually remove IKEv2, see vpnsetup.net/ikev2
|
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
|
EOF
|
||||||
abort_and_exit
|
abort_and_exit
|
||||||
fi
|
fi
|
||||||
|
@ -310,7 +310,7 @@ remove_vpn() {
|
|||||||
|
|
||||||
print_vpn_removed() {
|
print_vpn_removed() {
|
||||||
echo
|
echo
|
||||||
echo "IPsec VPN removed! Please reboot your server. This is optional, but recommended."
|
echo "IPsec VPN removed! Please reboot your server."
|
||||||
}
|
}
|
||||||
|
|
||||||
vpnuninstall() {
|
vpnuninstall() {
|
||||||
|
@ -80,6 +80,7 @@ check_os() {
|
|||||||
exiterr "This script only supports Ubuntu and Debian."
|
exiterr "This script only supports Ubuntu and Debian."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
|
||||||
os_ver=$(sed 's/\..*//' /etc/debian_version | 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
|
if [ "$os_ver" = "8" ] || [ "$os_ver" = "jessiesid" ]; then
|
||||||
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
|
||||||
@ -535,6 +536,19 @@ apply_gcp_mtu_fix() {
|
|||||||
fi
|
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() {
|
enable_on_boot() {
|
||||||
bigecho "Enabling services on boot..."
|
bigecho "Enabling services on boot..."
|
||||||
IPT_PST=/etc/init.d/iptables-persistent
|
IPT_PST=/etc/init.d/iptables-persistent
|
||||||
@ -633,7 +647,7 @@ IKEv2 guide: vpnsetup.net/ikev2
|
|||||||
EOF
|
EOF
|
||||||
if [ ! -e /dev/ppp ]; then
|
if [ ! -e /dev/ppp ]; then
|
||||||
cat <<'EOF'
|
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.
|
IKEv2 (vpnsetup.net/ikev2) or IPsec/XAuth mode to connect.
|
||||||
Debian 11/10 users, see vpnsetup.net/debian10
|
Debian 11/10 users, see vpnsetup.net/debian10
|
||||||
|
|
||||||
@ -687,6 +701,7 @@ vpnsetup() {
|
|||||||
create_vpn_config
|
create_vpn_config
|
||||||
update_sysctl
|
update_sysctl
|
||||||
update_iptables
|
update_iptables
|
||||||
|
apply_xl2tpd_fix
|
||||||
apply_gcp_mtu_fix
|
apply_gcp_mtu_fix
|
||||||
enable_on_boot
|
enable_on_boot
|
||||||
start_services
|
start_services
|
||||||
|
Loading…
Reference in New Issue
Block a user