ubuntu升级内核(4.16.13)并开启BBR

2018年6月1日 杂谈 0条评论 阅读次数 1,298

升级内核

Ubuntu 16.04 x64

Kernel 4.16.14

apt update
apt upgrade -y
apt install -y libelf1
#下载内核依赖
mkdir ~/ssl
cd ~/ssl
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.0g-2ubuntu4_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.1.0g-2ubuntu4_amd64.deb
dpkg -i *.deb
#下载内核文件
mkdir ~/kernel
cd ~/kernel
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.14/linux-headers-4.16.14-041614-generic_4.16.14-041614.201806051643_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.14/linux-headers-4.16.14-041614_4.16.14-041614.201806051643_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.14/linux-image-unsigned-4.16.14-041614-generic_4.16.14-041614.201806051643_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.14/linux-modules-4.16.14-041614-generic_4.16.14-041614.201806051643_amd64.deb
dpkg -i *.deb
# 重启
init 6

kernel 4.9.0

没啥好写的

kernel 4.17.0(rc)

挖坑

centOS

挖坑

开启BBR

检验BBR算法

egrep 'CONFIG_TCP_CONG_BBR|CONFIG_NET_SCH_FQ' /boot/config-$(uname -r)

输出结果

CONFIG_TCP_CONG_BBR=m
CONFIG_NET_SCH_FQ_CODEL=m
CONFIG_NET_SCH_FQ=m

开启BBR算法

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p

输出结果

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

验证

sysctl --system
sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

输出结果

·····
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /etc/sysctl.d/99-sysctl.conf ...
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
* Applying /etc/sysctl.conf ...
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_available_congestion_control = reno cubic bbr
tcp_bbr                20480  2