Last active
May 14, 2024 18:53
-
-
Save duzun/1503ebefbb208b9072ef85b7190364a4 to your computer and use it in GitHub Desktop.
Enable TCP BBR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A script to enable TCP BBR on a Linux system. | |
# | |
# @author Dumitru Uzun (DUzun.Me) | |
# @version 1.0.0 | |
# @distro ArchLinux/Manjaro | |
# | |
old_cc=`sysctl net.ipv4.tcp_congestion_control | awk -F= '{print $2}' | sed -e s/\^\\s//` | |
echo old tcp_congestion_control: $old_cc; | |
# if [[ $old_cc == "bbr" ]]; then | |
# exit 0; | |
# fi | |
available_cc=`sysctl net.ipv4.tcp_available_congestion_control` | |
if [[ $available_cc != *"bbr"* ]]; then | |
sudo modprobe tcp_bbr | |
available_cc=`sysctl net.ipv4.tcp_available_congestion_control` | |
if [[ $available_cc != *"bbr"* ]]; then | |
echo "Looks like your kernel doesn't support BBR :-(" | |
exit 1; | |
fi | |
fi | |
sudo sysctl net.ipv4.tcp_congestion_control=bbr && \ | |
echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.d/10-custom-kernel-bbr.conf && \ | |
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.d/10-custom-kernel-bbr.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment