BBR 是一种协议算法,在 Openwrt 路由上启用 BBR 还是有一定作用的。 Openwrt 18.* 后都自带模块 kmod-tcp-bbr
安装就可以。
看内核版本
root@OpenWrt:~# uname -r
4.9.184
安装 kmod-tcp-bbr
opkg update
opkg install kmod-tcp-bbr
会安装相关的 ipk
Configuring kmod-sched-core.
Configuring kmod-sched.
Configuring kmod-tcp-bbr.
查看相关情况
root@OpenWrt:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = cubic
root@OpenWrt:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = cubic reno bbr
root@OpenWrt:~# sysctl net.core.default_qdisc
net.core.default_qdisc = fq_codel
root@OpenWrt:~# lsmod | grep bbr
tcp_bbr 4832 0
root@OpenWrt:~# cat /etc/sysctl.conf
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file
root@OpenWrt:~# ls -l /etc/sysctl.d/
-rw-r--r-- 1 root root 675 Jun 27 12:18 10-default.conf
-rw-r--r-- 1 root root 379 Jun 27 12:18 11-nf-conntrack.conf
-rw-r--r-- 1 root root 184 Jun 27 12:18 12-tcp-bbr.conf
root@OpenWrt:~# cat /etc/sysctl.d/12-tcp-bbr.conf
# Do not edit, changes to this file will be lost on upgrades
# /etc/sysctl.conf can be used to customize sysctl settings
net.ipv4.tcp_congestion_control=bbr
net.core.default_qdisc=fq
root@OpenWrt:~# sysctl -p
root@OpenWrt:~# lsmod | grep bbr
tcp_bbr 4832 0
还没生效,重启路由后再看看
root@OpenWrt:~# lsmod | grep bbr
tcp_bbr 4832 21
root@OpenWrt:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr
BBR 加速生效了!