• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

OpenVZ平台Google BBR加速TCP之Rinetd方式

网络资源 Liam 1年前 (2019-04-29) 373次浏览 8个评论 扫描二维码
文章目录[隐藏]

简介

Rinetd这种方式其实两三个月前就已经有了,是v2ex网友@linhua的成果,他直接将BBR内置到了Rinetd里边,比较方便的就能配置出来。也就是由于配置比较简单,先说一下手动搭建的方法。后续扩软博主可能会制作出通用的rinetd-bbr一键脚本,到时候更新一键包方法。

手动安装

Github地址:https://github.com/linhua55/lkl_study
系统支持:仅支持64位系统。
1、下载文件到/usr/bin/rinetd-bbr

wget -O /usr/bin/rinetd-bbr https://github.com/linhua55/lkl_study/releases/download/v1.2/rinetd_bbr_powered 

2、设置权限

chmod a+x /usr/bin/rinetd-bbr 

3、创建配置文件

vi /etc/rinetd-bbr.conf 

输入以下内容

# bindadress bindport connectaddress connectport   0.0.0.0 443 0.0.0.0 443 

其中的443请改为你的端口,IP地址统一写0.0.0.0

4、获取接口名称

# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo     inet6 ::1/128 scope host        valid_lft forever preferred_lft forever 2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN     link/void     inet 127.0.0.2/32 scope host venet0     inet 10.10.10.10/32 brd 10.10.10.10 scope global venet0:0 

看具有公网IP的接口名称(比如我的公网IP10.10.10.10),上面这种的接口是venet0:0而不是venet0,搬瓦工的OpenVZ应该都是venet0:0接口。

5、启动

/usr/bin/rinetd-bbr -f -c /etc/rinetd-bbr.conf raw venet0:0 & 

注意:将最后的接口改为你上面获取到的接口。在命令最后面加&以使其能后台运行。

验证

正常情况下的输出:

[    0.000000] Linux version 4.10.0+ ([email protected]) (gcc version 4.9.4 (Ubuntu 4.9.4-2ubuntu1~14.04.1) ) #1 Mon Jul 31 04:50:50 UTC 2017 [    0.000000] bootmem address range: 0x7f2acc000000 - 0x7f2acffff000 [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16159 [    0.000000] Kernel command line:  [email protected]0000:1 [    0.000000] PID hash table entries: 256 (order: -1, 2048 bytes) [    0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes) [    0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes) [    0.000000] Memory available: 64492k/0k RAM [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [    0.000000] NR_IRQS:4096 [    0.000000] lkl: irqs initialized [    0.000000] clocksource: lkl: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns [    0.000001] lkl: time and timers initialized (irq2) [    0.000003] pid_max: default: 4096 minimum: 301 [    0.000021] Mount-cache hash table entries: 512 (order: 0, 4096 bytes) [    0.000023] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes) [    0.009053] console [lkl_console0] enabled [    0.009056] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [    0.009128] NET: Registered protocol family 16 [    0.009265] clocksource: Switched to clocksource lkl [    0.009324] NET: Registered protocol family 2 [    0.009418] TCP established hash table entries: 512 (order: 0, 4096 bytes) [    0.009421] TCP bind hash table entries: 512 (order: 0, 4096 bytes) [    0.009503] TCP: Hash tables configured (established 512 bind 512) [    0.009971] UDP hash table entries: 128 (order: 0, 4096 bytes) [    0.009976] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes) [    0.010060] virtio-mmio: Registering device virtio-mmio.0 at 0x1000000-0x100010b, IRQ 1. [    0.010186] workingset: timestamp_bits=62 max_order=14 bucket_order=0 [    0.010203] virtio-mmio virtio-mmio.0: Failed to enable 64-bit or 32-bit DMA.  Trying to continue, but this might not work. [    0.010350] NET: Registered protocol family 10 [    0.010849] Segment Routing with IPv6 [    0.010859] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver [    0.010993] Warning: unable to open an initial console. [    0.011006] This architecture does not have kernel memory protection. [    2.169284] random: fast init done 

查看iptables规则:

# iptables -t raw -nL Chain PREROUTING (policy ACCEPT) target     prot opt source               destination ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443 /* LKL_RAW */ DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443 /* LKL_RAW */   Chain OUTPUT (policy ACCEPT) target     prot opt source               destination 

已经有两条规则了。

原文地址:https://blog.kuoruan.com/119.html


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:OpenVZ平台Google BBR加速TCP之Rinetd方式
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(8)个小伙伴在吐槽
  1. This design is spectacular! You most certainly know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job. I really loved what you had to say, and more than that, how you presented it. Too cool!
    black mass2020-08-31 10:13 回复 Mac OS X | Chrome 67.0.3396.87
  2. I don't know whether it's just me or if everybody else experiencing issues with your website. It appears as though some of the text within your content are running off the screen. Can someone else please comment and let me know if this is happening to them too? This might be a problem with my web browser because I've had this happen previously. Kudos
    black mass2020-08-28 15:39 回复 Linux | Firefox浏览器 2.0.0.2
  3. Hey there! Someone in my Facebook group shared this site with us so I came to give it a look. I'm definitely enjoying the information. I'm bookmarking and will be tweeting this to my followers! Excellent blog and great design. cheap flights 2CSYEon
    cheap flights2020-08-26 19:37 回复 Mac OS X | Chrome 66.0.3359.181
  4. You ought to be a part of a contest for one of the most useful blogs on the web. I'm going to recommend this site! y2yxvvfw cheap flights
    cheap flights2020-08-25 11:18 回复 Mac OS X | Safari浏览器 605.1.15
  5. There's definately a lot to find out about this topic. I like all of the points you made.
    cheap flights2020-08-24 19:05 回复 Mac OS X | Chrome 68.0.3432.3
  6. It's a pity you don't have a donate button! I'd certainly donate to this superb blog! I guess for now i'll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this blog with my Facebook group. Talk soon!
    web hosting services2020-08-14 12:14 回复 Linux | Chrome 51.0.2705.45
  7. Thank you, I have just been searching for information approximately this subject for ages and yours is the best I've found out till now. However, what concerning the conclusion? Are you positive about the supply?
    website hosting2020-08-11 00:15 回复 Linux | Chrome 56.0.2924.87
  8. constantly i used to read smaller posts that as well clear their motive, and that is also happening with this paragraph which I am reading now. adreamoftrains website hosting companies
    adreamoftrains best hosting2020-08-10 23:41 回复 Windows 7 | Opera 9.80