-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbbrplus.sh
More file actions
60 lines (51 loc) · 1.42 KB
/
bbrplus.sh
File metadata and controls
60 lines (51 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#Change working directory to home directory
cd
#Update system
apt update && apt full-upgrade -y
#Install build dependencies
apt install -y \
wget \
ca-certificates \
build-essential \
linux-headers-amd64 \
| tee build-deps.txt
#Update CA Certificates
update-ca-certificates
#Build and install TCP-BBR Plus
mkdir bbrplus-debian
cd bbrplus-debian
wget https://raw.githubusercontent.com/Xaster/bbrplus-debian/master/Makefile
wget https://raw.githubusercontent.com/Xaster/bbrplus-debian/master/tcp_bbr_plus.c
make
make install
cd
#Config TCP-BBR Plus
[ ! -f /etc/sysctl.conf ] && touch /etc/sysctl.conf
sed -i '/net.core.default_qdisc.*/d' /etc/sysctl.conf
sed -i '/net.ipv4.tcp_congestion_control.*/d' /etc/sysctl.conf
cat >> /etc/sysctl.conf << \EOF
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr_plus
EOF
sysctl -p
#Remove build dependencies
apt purge --auto-remove -y $(cat build-deps.txt | grep "Unpacking " | cut -d " " -f 2)
apt clean
#Remove temporary files
rm -rf \
$HOME/bbrplus-debian \
$HOME/build-deps.txt \
/var/lib/apt/lists/*
#Check TCP-BBR Plus status
sysctl net.ipv4.tcp_available_congestion_control | grep -q bbr_plus
if [ $? -eq 0 ];then
lsmod | grep -q tcp_bbr_plus
if [ $? -eq 0 ];then
echo -e "\033[92m TCP-BBR Plus has been built and load. \033[0m"
else
echo -e "\033[91m TCP-BBR Plus load failed. \033[0m"
fi
else
echo -e "\033[91m TCP-BBR Plus not found. \033[0m"
fi