From 3cd08abcb16350e59b8c369df895f4ba160f8223 Mon Sep 17 00:00:00 2001 From: Azalea Gui <22280294+hykilpikonna@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:55:57 -0400 Subject: [PATCH] [+] Script to enable bbr --- scripts/bin/enable-bbr | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 scripts/bin/enable-bbr diff --git a/scripts/bin/enable-bbr b/scripts/bin/enable-bbr new file mode 100755 index 0000000..5045b6b --- /dev/null +++ b/scripts/bin/enable-bbr @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Check the current congestion control algorithm +current_algo=$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}') + +if [ "$current_algo" == "bbr" ]; then + echo "BBR is already enabled." + exit 0 +fi + +echo "Enabling BBR..." + +# Load the BBR kernel module +sudo modprobe tcp_bbr + +# Add BBR to the sysctl configuration +echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf +echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf + +# Apply the changes +sudo sysctl -p + +# Verify that BBR is now enabled +new_algo=$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}') +if [ "$new_algo" == "bbr" ]; then + echo "BBR successfully enabled." +else + echo "Failed to enable BBR." +fi \ No newline at end of file