其实这个在好久好久之前就已经用过了…但是最近又重新开始购买 VPS 才发现网上那些教程都老学校了
于是…
sudo su
经由
liolok
指正fq
已经是旧时代的选择了, 所以这里用最新cake
(这个应该不是谎言)
echo "net.core.default_qdisc=cake" >> /etc/sysctl.d/bbr.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.d/bbr.conf
modprobe tcp_bbr
sysctl -p /etc/sysctl.d/bbr.conf
sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control
reboot
#!/bin/bash# 检查是否是 ROOT 运行if [[ $(id -u) -ne 0 ]]; then echo "Please run as root" exit 1fi# 写入配置文件echo "net.core.default_qdisc=cake" > /etc/sysctl.d/90-bbr.confecho "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.d/90-bbr.conf# 加载 BBR 模块modprobe tcp_bbr# 加载 BBR 配置sysctl -p /etc/sysctl.d/90-bbr.conf# 检查配置if [[ $(sysctl -n net.ipv4.tcp_available_congestion_control) != *"bbr"* ]]; then echo "BBR is not available" exit 1fiif [[ $(sysctl -n net.ipv4.tcp_congestion_control) != "bbr" ]]; then echo "Failed to enable BBR" exit 1fi
Enabling BBR On Arch Linux 6.5.5+ (估计是 Copilot 的学习资料)
Sysctl Enable_BBR