MENU

CentOS更新内核并开启BBR

April 19, 2018 • Read: 6991 • 笔记阅读设置

CentOS7更新内核并开启BBR

tags:网站 Linux


CentOS7更新内核

ELRepo官方网站:http://elrepo.org
kernel-ml官方网站:http://elrepo.org/tiki/kernel-ml

安装ELRepo仓库

# Import the public key:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

# To install ELRepo for RHEL-7, SL-7 or CentOS-7:
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

# 清除缓存
yum clean all

# 重建缓存
yum makecache

更新内核

Linux Kernel 官方网站:https://www.kernel.org/
截止2018年4月19日 最新内核版本为 4.16.3

# 安装新内核
yum --enablerepo=elrepo-kernel install kernel-ml

# 查看已安装内核
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

输出结果类似以下内容:

[root@host ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (4.16.2-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux 7 Rescue 5a67985d75d94c9fa703a4a0773fd2d7 (3.10.0-693.21.1.el7.x86_64)
2 : CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)
3 : CentOS Linux (4.10.4-1.el7.elrepo.x86_64) 7 (Core)
4 : CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
5 : CentOS Linux (0-rescue-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 7 (Core)
[root@host ~]# 

把新内核(4.16.2-1.el7.elrepo.x86_64)设置为默认:

# 0 为内核前序号
grub2-set-default 0

重启主机

reboot

查看当前内核版本

uname -r

返回结果如下:

[root@host ~]# uname -r
4.16.2-1.el7.elrepo.x86_64
[root@host ~]# 

开启BBR

编辑/etc/sysctl.conf 添加以下内容:

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

关于IPV6开启BBR
IPV6 在BBR开启后默认支持。

原文

Both sysctl (net.ipv4.tcp_allowed_congestion_control and net.ipv4.tcp_available_congestion_control) and /proc entries (/proc/sys/net/ipv4/tcp_congestion_control) applies to every IPv4 and IPv6 TCP connections.

应用设置

sysctl -p

查看BBR开启状态

lsmod | grep bbr

若出输出如下结果,则开启成功。

[root@host ~]# lsmod | grep bbr
tcp_bbr                20480  14 
[root@host ~]# 
Last Modified: October 26, 2023