VPS教程 ·

魔改版BBR一键脚本 For Debian8/Ubuntu16+

简介

BBR相信大家都不陌生,是谷歌开发的一个存在于Linux内核中的拥塞算法。为了优化国内与服务器之间的网络质量,loc的大佬专门魔改改进了下这个BBR,成为了新的BBR魔改版。我也就乘机水一篇文章好了~在Debian 8 和Ubuntu16 + 系统上一键部署魔改版BBR,自动换内核成 4.10.15 ,自动安装Headers。用户只需要将系统安装成 Debian 8 或者 Ubuntu 16 即可,剩下的交给脚本来吧。据说效果比原版BBR和锐速都要好哦~

Github地址:https://github.com/FunctionClub/YankeeBBR

参考资料

魔改BBR原帖:http://www.hostloc.com/thread-372277-1-2.html

萌新教程: http://www.hostloc.com/thread-372335-1-1.html

脚本技术: https://doub.io/wlzy-16/

部分商家的VPS可能会遇到换内核之后无法启动系统的情况,所以请运行脚本前一定要备份好重要数据!!

安装脚本

安装过程中如果出现这张图片,请选择NO 来删除其他内核:

然后根据提示重启系统。
重启完成后,运行

即可启动魔改版BBR

查看魔改BBR状态

如果看到有 tsunami 就表示开启成功!

参与评论

  • 啊啊啊

    [email protected]:~# sysctl net.ipv4.tcp_available_congestion_control
    net.ipv4.tcp_available_congestion_control = cubic reno

    2月前 (11-25)
    回复
    回复啊啊啊
  • 啊啊啊

    这是什么情况

    2月前 (11-25)
    回复
    回复啊啊啊
  • 绫子

    求问QWQ
    --2017-11-11 09:35:28-- https://gist.github.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c
    Resolving gist.github.com (gist.github.com)... 192.30.253.119, 192.30.253.118
    Connecting to gist.github.com (gist.github.com)|192.30.253.119|:443... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c [following]
    --2017-11-11 09:35:28-- https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c
    Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 151.101.64.133, 151.101.128.133, 151.101.192.133, ...
    Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|151.101.64.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 32858 (32K) [text/plain]
    Saving to: ‘./tcp_tsunami.c’

    100%[==============================================>] 32,858 --.-K/s in 0.002s

    2017-11-11 09:35:28 (20.1 MB/s) - ‘./tcp_tsunami.c’ saved [32858/32858]

    make: *** /lib/modules/3.10.0-514.2.2.el7.x86_64/build: No such file or directory. Stop.
    insmod: ERROR: could not load module tcp_tsunami.ko: No such file or directory
    cp: cannot stat ‘./tcp_tsunami.ko’: No such file or directory
    modprobe: FATAL: Module tcp_tsunami not found.
    WARNING: timestamping does nothing in combination with -O. See the manual
    for details.

    --2017-11-11 09:35:31-- https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/sysctl.conf
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.192.133, 151.101.0.133, 151.101.64.133, ...
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.192.133|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 2704 (2.6K) [text/plain]
    Saving to: ‘/etc/sysctl.conf’

    100%[==============================================>] 2,704 --.-K/s in 0s

    2017-11-11 09:35:31 (21.1 MB/s) - ‘/etc/sysctl.conf’ saved [2704/2704]

    net.ipv4.ip_forward = 1
    fs.file-max = 51200
    net.core.rmem_max = 67108864
    net.core.wmem_max = 67108864
    net.core.netdev_max_backlog = 250000
    net.core.somaxconn = 4096
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_tw_reuse = 1
    net.ipv4.tcp_tw_recycle = 0
    net.ipv4.tcp_fin_timeout = 30
    net.ipv4.tcp_keepalive_time = 1200
    net.ipv4.ip_local_port_range = 10000 65000
    net.ipv4.tcp_max_syn_backlog = 8192
    net.ipv4.tcp_max_tw_buckets = 5000
    net.ipv4.tcp_fastopen = 3
    net.ipv4.tcp_rmem = 4096 87380 67108864
    net.ipv4.tcp_wmem = 4096 65536 67108864
    net.ipv4.tcp_mtu_probing = 1
    net.core.default_qdisc = fq
    sysctl: setting key "net.ipv4.tcp_congestion_control": No such file or directory
    net.ipv4.tcp_congestion_control = tsunami

    2月前 (11-11)
    回复
    回复绫子
  • 雨落无声

    请告知:
    1.你的服务器虚拟化类型,是OpenVZ还是KVM/Xen。
    2.现在的内核版本是多少
    3.Gcc版本目前多少

    2月前 (11-11)
    回复
    回复雨落无声
  • 风凡

    可以帮看下什么原因吗?

    [email protected]:~# bash bbr.sh start
    converted 'https://gist.github.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c' (ANSI_X3.4-1968) -> 'https://gist.github.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c' (UTF-8)
    --2017-10-26 07:44:40-- https://gist.github.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c
    Resolving gist.github.com (gist.github.com)... 192.30.253.118, 192.30.253.119
    Connecting to gist.github.com (gist.github.com)|192.30.253.118|:443... connected.
    WARNING: The certificate of 'gist.github.com' is not trusted.
    WARNING: The certificate of 'gist.github.com' hasn't got a known issuer.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c [following]
    converted 'https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c' (ANSI_X3.4-1968) -> 'https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c' (UTF-8)
    --2017-10-26 07:44:41-- https://gist.githubusercontent.com/anonymous/ba338038e799eafbba173215153a7f3a/raw/55ff1e45c97b46f12261e07ca07633a9922ad55d/tcp_tsunami.c
    Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 151.101.120.133
    Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|151.101.120.133|:443... connected.
    WARNING: The certificate of 'gist.githubusercontent.com' is not trusted.
    WARNING: The certificate of 'gist.githubusercontent.com' hasn't got a known issuer.
    HTTP request sent, awaiting response... 200 OK
    Length: 32858 (32K) [text/plain]
    Saving to: './tcp_tsunami.c'

    ./tcp_tsunami.c 100%[=====================================================================================================>] 32.09K --.-KB/s in 0.006s

    2017-10-26 07:44:41 (5.11 MB/s) - './tcp_tsunami.c' saved [32858/32858]

    make: *** /lib/modules/4.13.4-1-pve/build: No such file or directory. Stop.
    insmod: ERROR: could not load module tcp_tsunami.ko: No such file or directory
    cp: cannot stat './tcp_tsunami.ko': No such file or directory
    depmod: ERROR: could not open directory /lib/modules/4.13.4-1-pve: No such file or directory
    depmod: FATAL: could not search modules: No such file or directory
    modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.13.4-1-pve/modules.dep.bin'
    WARNING: timestamping does nothing in combination with -O. See the manual
    for details.

    converted 'https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/sysctl.conf' (ANSI_X3.4-1968) -> 'https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/sysctl.conf' (UTF-8)
    --2017-10-26 07:44:41-- https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/sysctl.conf
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.36.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.36.133|:443... connected.
    WARNING: The certificate of 'raw.githubusercontent.com' is not trusted.
    WARNING: The certificate of 'raw.githubusercontent.com' hasn't got a known issuer.
    HTTP request sent, awaiting response... 200 OK
    Length: 2704 (2.6K) [text/plain]
    Saving to: '/etc/sysctl.conf'

    /etc/sysctl.conf 100%[=====================================================================================================>] 2.64K --.-KB/s in 0s

    2017-10-26 07:44:41 (31.6 MB/s) - '/etc/sysctl.conf' saved [2704/2704]

    net.ipv4.ip_forward = 1
    sysctl: setting key "fs.file-max": Read-only file system
    sysctl: cannot stat /proc/sys/net/core/rmem_max: No such file or directory
    sysctl: cannot stat /proc/sys/net/core/wmem_max: No such file or directory
    sysctl: cannot stat /proc/sys/net/core/netdev_max_backlog: No such file or directory
    sysctl: cannot stat /proc/sys/net/core/somaxconn: No such file or directory
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_tw_reuse = 1
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
    net.ipv4.tcp_fin_timeout = 30
    net.ipv4.tcp_keepalive_time = 1200
    net.ipv4.ip_local_port_range = 10000 65000
    net.ipv4.tcp_max_syn_backlog = 8192
    net.ipv4.tcp_max_tw_buckets = 5000
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_fastopen: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_rmem: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_wmem: No such file or directory
    net.ipv4.tcp_mtu_probing = 1
    sysctl: cannot stat /proc/sys/net/core/default_qdisc: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_congestion_control: No such file or directory
    魔改版BBR启动成功!
    [email protected]:~# sysctl net.ipv4.tcp_available_congestion_control
    sysctl: cannot stat /proc/sys/net/ipv4/tcp_available_congestion_control: No such file or directory

    3月前 (10-26)
    回复
    回复风凡
  • 雨落无声

    你的服务器不信任github的证书,要先安装一个 ca-certificates才行。
    Debian / Ubuntu : apt-get install ca-certificates -y

    3月前 (10-29)
    回复
    回复雨落无声
  • yuyehack

    换成debian8 成功了

    4月前 (09-19)
    回复
    回复yuyehack
  • yuyehack

    水滴vps debian9 的 卸载内核异常

    4月前 (09-19)
    回复
    回复yuyehack
  • nite

    ubuntu14不行啊,换成16再搞!

    4月前 (09-14)
    回复
    回复nite
  • nic2013

    大佬,什么时候更新一下 4.13 的内核呗。

    4月前 (09-09)
    回复
    回复nic2013
  • nic2013

    大佬,建议弄一个自动获取最新内核吧,现在都 4.13 的内核了。

    4月前 (09-05)
    回复
    回复nic2013
  • 糖炒栗子

    这个脚本为什么限定在Debian8了啊,9就不行了。

    5月前 (08-15)
    回复
    回复糖炒栗子
  • chuchushita

    魔改版BBR启动成功!
    [email protected]:~# sysctl net.ipv4.tcp_available_congestion_control
    net.ipv4.tcp_available_congestion_control = cubic reno
    楼主,我的变成这样了,是是什么原因?

    5月前 (08-10)
    回复
    回复chuchushita
  • 雨落无声

    没有启动成功,你应该是Ovz虚拟化的VPS?如果不是,请给我完整的日志。

    5月前 (08-10)
    回复
    回复雨落无声
  • chuchushita

    楼主,麻烦请教一下啊,我的是Ovz虚拟化的VPS,要是能用魔改版BBR的话,要怎么做。要是不能用这个用什么好一点 :?:

    5月前 (08-10)
    回复
    回复chuchushita
  • 雨落无声

    Ovz目前无法使用脚本安装魔改bbr,ovz现在能用的单边加速只有uml + bbr。双边加速可以用kcp

    5月前 (08-10)
    回复
    回复雨落无声
  • chuchushita

    感谢楼主好意,我是小白,没接触过shell,算了,还是去试一下shadowsocks-libev
    昨天用了OpenVZ的UML+BBR+SSR加速一键包放出!老是掉线,有点没有头绪了

    5月前 (08-10)
    回复
    回复chuchushita
  • 糖炒栗子

    因为新泽西和迈阿密不行。换洛杉矶试试。

    5月前 (08-15)
    回复
    回复糖炒栗子
  • Eric

    一怒之下,再次重装, 这次就好了,debian8,显示的是,实际上也是。。。。。所以这 recitified这vps是傻逼

    6月前 (08-02)
    回复
    回复Eric
  • 雨落无声

    还有这种操作......表示无奈..

    6月前 (08-02)
    回复
    回复雨落无声