Skip to content

Instantly share code, notes, and snippets.

@wudi
Forked from duzun/arch_enable_bbr.sh
Created December 20, 2018 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wudi/f26649489043e6cba57b9628168655bd to your computer and use it in GitHub Desktop.
Save wudi/f26649489043e6cba57b9628168655bd to your computer and use it in GitHub Desktop.
Enable TCP BBR
#!/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