|
@@ -10,6 +10,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+debian_wireguard_install(){
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -25,10 +28,10 @@ dpkg -l|grep linux-headers
|
|
|
|
|
|
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
|
|
|
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
|
|
|
-
|
|
|
+
|
|
|
|
|
|
apt update
|
|
|
-
|
|
|
+
|
|
|
|
|
|
apt install wireguard resolvconf -y
|
|
|
|
|
@@ -54,7 +57,7 @@ echo "[Interface]
|
|
|
PrivateKey = $(cat sprivatekey)
|
|
|
|
|
|
|
|
|
-Address = 10.0.0.1/24
|
|
|
+Address = 10.0.0.1/24
|
|
|
|
|
|
|
|
|
|
|
@@ -119,7 +122,7 @@ PersistentKeepalive = 25"|sed '/^#/d;/^\s*$/d' > client.conf
|
|
|
|
|
|
|
|
|
chmod 777 -R /etc/wireguard
|
|
|
-
|
|
|
+
|
|
|
sysctl_config() {
|
|
|
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
|
|
@@ -131,7 +134,7 @@ sysctl_config() {
|
|
|
|
|
|
sysctl_config
|
|
|
lsmod | grep bbr
|
|
|
-
|
|
|
+
|
|
|
|
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
|
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
|
|
@@ -146,6 +149,12 @@ systemctl enable wg-quick@wg0
|
|
|
|
|
|
wg
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+wget -qO- https://git.io/fpnQt | bash
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
check_sys(){
|
|
|
if [[ -f /etc/redhat-release ]]; then
|
|
@@ -168,8 +177,8 @@ check_sys(){
|
|
|
|
|
|
wireguard_config(){
|
|
|
if [[ ${release} == "centos" ]]; then
|
|
|
- yum install -y wget vim curl
|
|
|
-
|
|
|
+ yum install -y wget vim curl
|
|
|
+
|
|
|
wget -qO- git.io/fhnhS | bash
|
|
|
fi
|
|
|
|
|
@@ -179,10 +188,9 @@ wireguard_config(){
|
|
|
fi
|
|
|
|
|
|
if [[ ${release} == "debian" ]]; then
|
|
|
-
|
|
|
- wget -qO- https://git.io/fpnQt | bash
|
|
|
+ debian_wireguard_install
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
check_sys && wireguard_config
|