编译BBR内核模块

下载bbr文件并创建Makefile

wget -O ./tcp_bbr.c https://raw.githubusercontent.com/google/bbr/v2alpha/net/ipv4/tcp_bbr.c
echo "obj-m:=tcp_bbr.o" > Makefile

编译并移动到系统内核模块目录

make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc
cp -rf ./tcp_tsunami.ko /lib/modules/$(uname -r)/kernel/net/ipv4

加载模块并启用

modprobe tcp_bbr
depmod -a
sysctl net.ipv4.tcp_congestion_control=bbr

系统启动自加载模块

修改文件/etc/modules并加入模块

echo "tcp_bbr" >> /etc/modules