CentOS7安装bbr

  1. yum系统更新(更新到7.3)
yum update

2.查看系统版本

cat /etc/redhat-release

输出如下,则表示已升级到7.3

CentOS Linux release 7.3.1611 (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

正常情况下将输出如下,

Transaction Summary
================================================================================
Install  1 Package

Total download size: 39 M
Installed size: 169 M
Downloading packages:
kernel-ml-4.9.0-1.el7.elrepo.x86_64.rpm                    |  39 MB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : kernel-ml-4.9.0-1.el7.elrepo.x86_64                          1/1
  Verifying  : kernel-ml-4.9.0-1.el7.elrepo.x86_64                          1/1

Installed:
  kernel-ml.x86_64 0:4.9.0-1.el7.elrepo

Complete!

3.更新grub文件并重启(reboot后,ssh会断开,稍等一会儿重新连接)

egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
grub2-set-default 0
reboot

4.开机后查看内核是否已更换为4.9

uname -r

输出如下内容则表示内核4.9已经启动了

4.9.0-1.el7.elrepo.x86_64

5.开启bbr

vi /etc/sysctl.conf

添加如下内容

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

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

sysctl -p

4.确定bbr已经开启

a.若

sysctl net.ipv4.tcp_available_congestion_control

返回

net.ipv4.tcp_available_congestion_control = bbr cubic reno

则成功

b.若

lsmod | grep bbr

返回形如

tcp_bbr                16384  1

则成功