Rat's

魔改Google BBR一键安装脚本,比正常版BBR强
说明:本方法出自于hostloc论坛大佬Yankee发布的BBR魔改,并由Vicer博主制作的一键包。魔改基本就是...
扫描右侧二维码阅读全文
24
2017/06

魔改Google BBR一键安装脚本,比正常版BBR强

说明:本方法出自于hostloc论坛大佬Yankee发布的BBR魔改,并由Vicer博主制作的一键包。魔改基本就是修改BBR源码,调整参数,使其更强劲。

更新:
[2017.07.25]
修复一个由检测gcc版本引起的不可预料的错误。
[2017.07.15]
自动检测gcc版本,如果gcc版本大于4.9的将不会再安装gcc
[2017.07.12]
支持用户自行指定内核版本(需要与-f命令同时使用)。

提示

1、执行过程中会重新编译模块。
2、模块默认为开机自动加载。
3、模块名称:tcp_bbr_powered
4、可用modprobe tcp_bbr_powered命令进行加载模块。
5、可执行lsmod |grep 'bbr_powered',结果不为空,则加载模块成功。
6、可执行sysctl -w net.ipv4.tcp_congestion_control=bbr_powered使用此模块。

方法

本方法已在debianubuntu上测试通过。

提示:关于CentOS系统魔改请参考:BBR+BBR魔改+Lotsever(锐速)一键脚本 for Centos/Debian/Ubuntu

1、安装BBR并开启
使用命令:

wget --no-check-certificate -qO 'BBR.sh' 'https://moeclub.org/attachment/LinuxShell/BBR.sh' && chmod a+x BBR.sh && bash BBR.sh -f
# 备用地址
wget --no-check-certificate -qO 'BBR.sh' 'https://www.moerats.com/usr/down/BBR.sh' && chmod a+x BBR.sh && bash BBR.sh -f

2、魔改BBR
一键地址默认是选择官方提供的最新版本的内核,如想要指定内核则运行指定内核版本一键包即可!

(1)一键地址

wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://moeclub.org/attachment/LinuxShell/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh
# 备用地址
wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://www.moerats.com/usr/down/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh

(2)指定内核版本(以v4.12.9内核版本为例)

wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://moeclub.org/attachment/LinuxShell/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh -f v4.12.9
# 备用地址
wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://www.moerats.com/usr/down/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh -f v4.12.9

安装完成即可!

原文地址:https://moeclub.org/2017/06/24/278/
方法来源:http://www.hostloc.com/thread-372277-1-1.html

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。
最后修改:2019 年 01 月 20 日 10 : 30 PM

发表评论 取消回复

36 条评论

  1. 果冻

    你好,请问下教程中1、安装BBR并开启 和 2、魔改BBR 是一定要先执行1后再执行2对吧?还是如果我要按照魔改的直接执行2就可以?谢谢

    1. Rat's
      @果冻

      步骤是先安装加速对应的内核,然后再选择对应的加速。差不多都是2步。

  2. mi

    老哥再请教,我在armbian下自编译报下面的错,请教是什么原因呢?
    root@aml:~# mkdir .tmp
    root@aml:~# cd .tmp/
    root@aml:~/.tmp# wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxSoftware/bbr/tcp_bbr_powered.c.deb' >./tcp_bbr_powered.c
    root@aml:~/.tmp# echo 'obj-m:=tcp_bbr_powered.o' >./Makefile
    root@aml:~/.tmp# make -s -C /lib/modules/$(uname -r)/build M=pwd modules CC=which gcc
    /root/.tmp/tcp_bbr_powered.c:67:20: error: field ?.ycle_mstamp?.has incomplete type
    struct skb_mstamp cycle_mstamp; / time of this cycle phase start /

    ^~~~~~~~~~~~

    In file included from ./include/linux/list.h:9:0,

    from ./include/linux/module.h:9, from /root/.tmp/tcp_bbr_powered.c:30:

    /root/.tmp/tcp_bbr_powered.c: In function ?.br_set_tso_segs_goal?.
    /root/.tmp/tcp_bbr_powered.c:220:27: error: implicit declaration of function ?.cp_tso_autosize?.[-Werror=implicit-function-declaration]
    bbr->tso_segs_goal = min(tcp_tso_autosize(sk, tp->mss_cache, min_segs),

    ^

    ./include/linux/kernel.h:812:22: note: in definition of macro ?._typecheck?
    (!!(sizeof((typeof(x) )1 == (typeof(y) )1)))

    ^

    ./include/linux/kernel.h:836:24: note: in expansion of macro ?._safe_cmp?
    __builtin_choose_expr(__safe_cmp(x, y), \

    ^~~~~~~~~~

    ./include/linux/kernel.h:845:19: note: in expansion of macro ?._careful_cmp?
    #define min(x, y) __careful_cmp(x, y, <)

    ^~~~~~~~~~~~~

    /root/.tmp/tcp_bbr_powered.c:220:23: note: in expansion of macro ?.in?
    bbr->tso_segs_goal = min(tcp_tso_autosize(sk, tp->mss_cache, min_segs),

    1. Rat's
      @mi

      这个系统没用过,你谷歌下吧

  3. mi

    请教一个问题,我是按你的脚本里的源码自己编译的,已经成功了,有个疑问,现在lsmod查看有2个模块,分别是tcp_bbr和tcp_bbr_powered,请教这个是正常的吗?另外有什么其它方法验证已经成功了吗?

    1. Rat's
      @mi

      一般是正常的,有BBR模块就行了,至于有没有成功,从服务器里下个文件体验下感觉。

  4. 重启系统后发现22端口关闭了是怎么回事呀??我只是重启的时候不小心退出了xshell,然后就连不上22号了

    1. Rat's
      @凡

      换系统或者用我文章给的另一个脚本。

  5. alex

    现在搬瓦工自带bbr加速吗,安装的时候选择一下就好,看油管爽歪歪。

    1. Rat's
      @alex

      瓦工有带BBR的系统,不过至于有没有自动开启我还没仔细看过。

  6. zky

    锐速安装后连不上,重装系统和55r,在换bbr安装也是连不上

    1. Rat's
      @zky

      你可以检查下防火墙看看。

  7. Michael Wang

    魔改是什么意思? 魔在哪里?

    1. Rat's
      @Michael Wang

      魔改就是修改的意思,调整一些参数,让速度更快。

  8. catcom

    还是很奇怪,指定版本后还是Error! Header not be matched by Linux Kernel. 环境:Linode,Ubuntu 16.04,默认内核4.15.12。

    1. Rat's
      @catcom

      不支持4.15版本内核。

  9. tk

    魔改BBR 一键的脚本,出错:Error! Header not be matched by Linux Kernel.

    1. tk
      @tk

      加上带 -f 参数 显示:Error! Header not be matched by Linux Kernel.

      1. Rat's
        @tk

        先使用uname -r查看内核版本,然后加上-f参数,如果依然这个提示,可能是该脚本魔改BBR内核版本过低导致,使用我博客另一个魔改BBR教程就可以了。

    2. Rat's
      @tk

      魔改内核不匹配,你用Vicer博主的BBR一键包后再使用魔改BBR脚本吧。

  10. Shino

    博主你好,我安装的是Vicer博主的BBR一键包 这个是谷歌原包还是魔改呢?
    root@de:~# lsmod | grep bbr
    tcp_bbr 20480 14
    这个20480代表着什么呢,原版是怎么样的呢,因为我在欧洲vps上,怕滥用会被ban

    1. Rat's
      @Shino

      那个是原包,还需要运行一下魔改脚本,后面的数字是内核中BBR模块运行状态的信息,用BBR不会被ban的,尽管用。

      1. Shino
        @Rat's

        不是魔改版就好。。安全第一不敢乱用。。

        1. Rat's
          @Shino

          自己玩的爽就行,没见过安装BBR被ban的。