Skip to content

Instantly share code, notes, and snippets.

@matinrco
Created December 7, 2022 11:27
Show Gist options
  • Save matinrco/00613644daa6b50d8c2883c7f71e9675 to your computer and use it in GitHub Desktop.
Save matinrco/00613644daa6b50d8c2883c7f71e9675 to your computer and use it in GitHub Desktop.
Enable bbr in ubuntu 22.04/20.04

Enable bbr in ubuntu 22.04/20.04

Requirements:

  • Linux kernel version must be greater than 4.19

    to check kernel version, run uname -r. sample output:

    5.4.0-132-generic
    
  • Have the CONFIG_TCP_CONG_BBR and CONFIG_NET_SCH_FQ options compiled and added to the kernel.

    to check, run sudo cat /boot/config-$(uname -r) | grep 'CONFIG_TCP_CONG_BBR'. sample output:

    CONFIG_TCP_CONG_BBR=m
    

    to check other options, run sudo cat /boot/config-$(uname -r) | grep 'CONFIG_NET_SCH_FQ'.sample output:

    CONFIG_NET_SCH_FQ_CODEL=m
    CONFIG_NET_SCH_FQ=m
    CONFIG_NET_SCH_FQ_PIE=m
    

Enable BBR

First, check if BBR is enabled on the system. To do this, run:

sysctl net.ipv4.tcp_available_congestion_control

And you will get an output screen like this:

net.ipv4.tcp_available_congestion_control = reno cubic

Another check can be done with this command:

sysctl net.ipv4.tcp_congestion_control

Sample Output:

net.ipv4.tcp_congestion_control = cubic

And to enable BBR, edit the /etc/sysctl.conf file:

sudo nano /etc/sysctl.conf

At the end of the file, add the following lines:

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

Save the file, and refresh your configuration by using this command:

sudo sysctl -p

Now restart the server to apply the changes.

Verify if BBR is enabled in your system:

sysctl net.ipv4.tcp_congestion_control

output:

net.ipv4.tcp_congestion_control = bbr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment