安装编译所需的依赖包和一些常用的软件包: `apt -y update` `apt -y install build-essential libncurses-dev libssl-dev libelf-dev bison bc flex rsync debhelper dwarves git` 获取源码: `git clone -b v3 https://github.com/google/bbr.git` `cd bbr/` 复制系统默认的内核配置文件: `cp /boot/config-$(uname -r) .config` 执行如下命令保留旧.config文件中的所有选项,并将新选项设置为推荐(即默认)值: `make olddefconfig` 打开配置菜单: `make menuconfig` 依次进入Networking support->Networking options->TCP: advanced congestion control->,把BBR TCP选项设置为编译成模块 为节约编译时间和减少硬盘占用,建议关闭DEBUG功能,依次进入Kernel hacking->Compile-time checks and compiler options->Debug information (Disable debug information)->,按下图所示设置为Disable debug information: 编译并创建deb软件包: `make bindeb-pkg -j$(nproc)` 编译完成后在上级目录安装新的内核并重启: ```shell cd .. apt install ./linux-headers-6.4.0+_6.4.0-g7542cc7c41c0-1_amd64.deb apt install ./linux-image-6.4.0+_6.4.0-g7542cc7c41c0-1_amd64.deb systemctl reboot ``` 查看tcp_bbr模块信息: `modinfo tcp_bbr` 启用BBRv3: ```shell echo "net.core.default_qdisc = fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.conf sysctl -p ``` 执行下面的命令检查BBR模块是否启动成功: `lsmod` 过程中如果SSH连接不稳定,可以使用screen: `apt-get install screen` `screen -S BBBBBBR` 快捷键 Ctrl+A+D离开窗口 恢复 screen 会话: `screen -r BBBBBBR` treesky 2025-03-04 上一篇: Debian 12安装Proxmox 下一篇: Debian挂载数据盘笔记 评论已关闭
评论已关闭