CentOS7安装BBR加速

发布于 2022-01-23  345 次阅读


原文链接

https://www.baishitou.cn/3804.html

1.yum系统更新

yum update

2.查看系统版本

cat /etc/redhat-release

输出如下则表示已升级到7.6

CentOS Linux release 7.6.1810 (Core)

3.安装elrepo并升级内核

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y

4.安装完成后使用下面命令查看当前已安装的内核

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

0 : CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux 7 Rescue ee7953a3b5944053a26f29daf8c71e2f (3.10.0-862.14.4.el7.x86_64)
2 : CentOS Linux (3.10.0-862.14.4.el7.x86_64) 7 (Core)
3 : CentOS Linux (3.10.0-862.3.2.el7.x86_64) 7 (Core)
4 : CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
5 : CentOS Linux (0-rescue-4bbda2095d924b72b05507b68bd509f0) 7 (Core)

5.把CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)内核设置为默认

grub2-set-default 0

6.重启服务器

init 6

7.配置

vim /etc/sysctl.conf

8.添加如下内容

net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

9.加载系统参数(正常情况下会输出我们之前加入的内容)

sysctl -p

10.验证bbr是否已经开启

sysctl net.ipv4.tcp_available_congestion_control
如果返回
net.ipv4.tcp_available_congestion_control = reno cubic bbr
则安装 成功

lsmod | grep bbr
如果返回
tcp_bbr 20480 2
则安装成功


信任是利益的武器,捅伤别人,保护自己