惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

Rat's Blog - BBR

Ubuntu 18.04/18.10快速开启Google BBR的方法 - Rat's Blog 超级暴力版魔改BBR一键脚本 for Debian - Rat's Blog Debian/Ubuntu开启超级暴力版魔改BBR教程 - Rat's Blog OpenVZ平台魔改BBR一键脚本之Rinetd方式 - Rat's Blog OpenVZ平台安装魔改BBR:LKL一键安装脚本 - Rat's Blog BBR+BBR魔改+Lotsever(锐速)一键脚本 for Centos/Debian/Ubuntu - Rat's Blog 魔改BBR一键安装脚本 for Debian/CentOS - Rat's Blog Debian 9/10快速开启Google BBR的方法,实现高效单边加速 - Rat's Blog OpenVZ平台Google BBR加速TCP之Rinetd方式 - Rat's Blog
CentOS 6/7手动安装BBR和魔改BBR教程 - Rat's Blog
博主: Rat's · 2018-04-08 · via Rat's Blog - BBR

说明:现在的BBR一键脚本很多,脚本虽然方便,但也有缺陷,就是不能照顾到所有商家的系统,偶尔也会出点错。所以我们不能完全依赖一键脚本,得学会手动开启BBR或者魔改BBR,这里就说下CentOS 6/7手动开启教程。Debian/Ubuntu系统的手动开启教程很久前就说过了,查看:Linux VPS使用Google BBR拥塞算法加速TCP教程Debian/Ubuntu开启超级暴力版魔改BBR教程

安装BBR

1、安装BBR内核

#CentOS 6系统
#导入ELRepo公钥
wget https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm --import RPM-GPG-KEY-elrepo.org
#安装ELRepo
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
#升级最新内核
yum --enablerepo=elrepo-kernel install kernel-ml -y
#调整内核启动顺序
sed -i '/default=/d' /boot/grub/grub.conf && echo -e "\ndefault=0\c" >> /boot/grub/grub.conf 
#重启
reboot

#CentOS 7系统
#导入ELRepo公钥
wget https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm --import RPM-GPG-KEY-elrepo.org
#安装ELRepo
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
#升级最新内核
yum --enablerepo=elrepo-kernel install kernel-ml -y
#调整内核启动顺序
grub2-mkconfig -o /boot/grub2/grub.cfg && grub2-set-default 0
#重启
reboot

2、开启BBR

#查看最新内核,如果大于4.9,则进行下一步
uname -r
#修改配置
cat >>/etc/sysctl.conf << EOF
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF
#使配置生效
sysctl -p
#检查生效,输出带有tcp_bbr 20480  0即生效
lsmod | grep bbr

安装魔改BBR

由于通过ELRepo安装的最新内核版本太高,不支持魔改BBR,所以上面安装内核的方法不可用,只能手动安装稍低版本的内核。

1、安装新内核

#CentOS 6系统
#下载并安装内核
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-4.12.10-1.el6.elrepo.x86_64.rpm && yum -y install kernel-ml-4.12.10-1.el6.elrepo.x86_64.rpm
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-devel-4.12.10-1.el6.elrepo.x86_64.rpm && yum -y install kernel-ml-devel-4.12.10-1.el6.elrepo.x86_64.rpm
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-headers-4.12.10-1.el6.elrepo.x86_64.rpm && yum -y install kernel-ml-headers-4.12.10-1.el6.elrepo.x86_64.rpm
#调整内核启动顺序
sed -i '/default=/d' /boot/grub/grub.conf && echo -e "\ndefault=0\c" >> /boot/grub/grub.conf
#重启
reboot

#CentOS 7系统
#下载并安装内核
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-4.12.10-1.el7.elrepo.x86_64.rpm && yum -y install kernel-ml-4.12.10-1.el7.elrepo.x86_64.rpm
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-devel-4.12.10-1.el7.elrepo.x86_64.rpm && yum -y install kernel-ml-devel-4.12.10-1.el7.elrepo.x86_64.rpm
wget https://www.moerats.com/usr/down/CentOS_Kernel/kernel-ml-headers-4.12.10-1.el7.elrepo.x86_64.rpm && yum -y install kernel-ml-headers-4.12.10-1.el7.elrepo.x86_64.rpm
#调整内核启动顺序
grub2-mkconfig -o /boot/grub2/grub.cfg && grub2-set-default 0
#重启
reboot

检查当前已安装内核,并删除新内核以外的内核

rpm -qa | grep kernel
yum remove -y 内核名

3、开启魔改BBR
安装魔改BBR

#安装依赖
yum -y install make gcc
wget -O ./tcp_tsunami.c https://www.moerats.com/usr/down/CentOS_Kernel/tcp_tsunami.c
#安装魔改BBR
echo "obj-m:=tcp_tsunami.o" > Makefile
make -C /lib/modules/`uname -r`/build M=`pwd` modules CC=/usr/bin/gcc
chmod +x ./tcp_tsunami.ko
cp -rf ./tcp_tsunami.ko /lib/modules/`uname -r`/kernel/net/ipv4
insmod tcp_tsunami.ko
depmod -a
#修改配置
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=tsunami" >> /etc/sysctl.conf
sysctl -p

检查开启状态

lsmod | grep tsunami

如果返回tcp_tsunami 16384 26类似信息,则开启成功。

部分资料参考:小Z博客南琴浪博客


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/580/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。