bbr1
bbr3(适用海外机器)
安装支持bbrv3的内核,可使用该项目:https://github.com/byJoey/Actions-bbr-v3
启用 bbr
编辑/etc/sysctl.d/99-bbr.conf:
net.ipv4.tcp_congestion_control = bbr
net.core.default_qdisc = cake
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_moderate_rcvbuf = 1立即生效:sysctl --system
- 配置cake(本次开机有效,最大带宽填写你实际的值):
shell
tc qdisc replace dev eth0 root cake \
bandwidth 1000mbit \
diffserv4 \
ack-filter \
internet- cake 持久化
编辑/etc/systemd/system/cake.service(按你实际网卡改 eth0):
[Unit]
Description=Apply CAKE qdisc
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/sbin/tc qdisc replace dev eth0 root cake bandwidth 1000mbit diffserv4 ack-filter internet
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target启用并立即生效:
shell
systemctl daemon-reload
systemctl enable cake
systemctl start cake