全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 8249|回复: 19
打印 上一主题 下一主题

nfp OPENVZ brook+南琴浪rinetd 效果好过 v2ray+mkcp

[复制链接]
跳转到指定楼层
1#
发表于 2018-4-19 10:56:34 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
6刀年付刚升级了1G网口
本想升级内核支持bbr。担心启动不成功,太折腾。改用南琴浪推荐的rinetd。
刚才用北京电信,测试油管 1080  测试结果:
(1)用brook 可以稳定在3-7Mbps。适合看1920X1080@24
(2)用v2ray+mkcp 速度抖动厉害,在几百kbps-4Mbps之间抖动。勉强看1920X1080@24

root@nfp1:~/# mkdir Rinetd
root@nfp1:~/Rinetd# vi tcp_nanqinlang-rinetd-debian+ubuntu.sh
./tcp_nanqinlang-rinetd-debian+ubuntu.sh
文件内容是下面的脚本 只适用于debian和ubuntu,单个端口加速,我填写了brook的端口。
#!/bin/bash
Green_font="\033[32m" && Red_font="\033[31m" && Font_suffix="\033[0m"
Info="${Green_font}[Info]${Font_suffix}"
Error="${Red_font}[Error]${Font_suffix}"
echo -e "${Green_font}
#====================================================
# Project: tcp_nanqinlang
# Description: --debian&ubuntu --rinetd --singleNIC
# Version: based on linhua's origin
# Origin: https://github.com/linhua55/lkl_study
# Author: linhua && nanqinlang
# Blog:   https://sometimesnaive.org
# Github: https://github.com/nanqinlang
#====================================================
${Font_suffix}"

check_system(){
        #sort
        [[ -z "`cat /etc/issue | grep -iE "debian"`" && -z "`cat /etc/issue | grep -iE "ubuntu"`" ]] && echo -e "${Error} only support Debian !" && exit 1
        #bit
        [[ "`uname -m`" != "x86_64" ]] && echo -e "${Error} only support 64bit !" && exit 1
}

check_root(){
        [[ "`id -u`" != "0" ]] && echo -e "${Error} must be root user !" && exit 1
}

check_ovz(){
        apt-get update && apt-get install -y virt-what
        [[ "`virt-what`" != "openvz" ]] && echo -e "${Error} only support OpenVZ !" && exit 1
}

check_requirement(){
        # check iptables
        apt-get install -y iptables

        # check "iptables grep cut xargs ip awk"
        for CMD in iptables grep cut xargs ip awk
        do
                if ! type -p ${CMD}; then
                        echo -e "${Error} requirements not found, please check !" && exit 1
                fi
        done
}

directory(){
        [[ ! -d /home/tcp_nanqinlang ]] && mkdir -p /home/tcp_nanqinlang
        cd /home/tcp_nanqinlang
}

download(){
        wget https://raw.githubusercontent.co ... inetd/module/rinetd
        chmod +x rinetd
}

config-port(){
        echo -e "${Info} Please input port to be accelerated"
        read -p "(multi ports is diveded by space . not support port range. default port:8080):" ports

        if [[ -z "${ports}" ]]; then
                echo -e "0.0.0.0 8080 0.0.0.0 8080\c" >> config-port.conf
        else
                for port in ${ports}
                do
                        #can write config in new line
                        echo "0.0.0.0 ${port} 0.0.0.0 ${port}" >> config-port.conf
                done
        fi
}

config-rinetd(){
        # single NIC
        IFACE=`ip -4 addr | awk '{if ($1 ~ /inet/ && $NF ~ /^[ve]/) {a=$NF}} END{print a}'`
        echo -e "#!/bin/bash \ncd /home/tcp_nanqinlang \nnohup ./rinetd -f -c config-port.conf raw ${IFACE} &" >> config-rinetd.sh && chmod +x config-rinetd.sh
}

self-start(){
        sed -i "s/exit 0/ /ig" /etc/rc.local
        echo -e "\n/home/tcp_nanqinlang/config-rinetd.sh\c" >> /etc/rc.local
        chmod +x /etc/rc.local
}

run-it-now(){
        ./config-rinetd.sh
}

install(){
        check_system
        check_root
        check_ovz
        check_requirement
        directory
        download
        config-port
        config-rinetd
        self-start
        run-it-now
        status
}

status(){
        if [[ ! -z `ps -A | grep rinetd` ]]; then
                echo -e "${Info} tcp_nanqinlang is running !"
                else echo -e "${Error} tcp_nanqinlang not running, please check !"
        fi
}

uninstall(){
        check_root
        kill -9 `ps -A | grep rinetd | awk '{print $1}'`
        rm -rf /home/tcp_nanqinlang
        iptables -t raw -F
        sed -i '/\/home\/tcp_nanqinlang\/config-rinetd.sh/d' /etc/rc.local
        echo -e "${Info} uninstall finished."
}



echo -e "${Info} Please select function"
echo -e "1.install rinetd-bbr\n2.Check rinetd-bbr running status\n3.uninstall rinetd-bbr"
read -p "input number(1-3):" function

while [[ ! "${function}" =~ ^[1-3]$ ]]
        do
                echo -e "${Error} invalid parameter"
                echo -e "${Info} select again" && read -p "input number(1-3):" function
        done

if   [[ "${function}" == "1" ]]; then
        install
elif [[ "${function}" == "2" ]]; then
        status
else
        uninstall
fi
20#
发表于 2018-5-2 15:22:30 | 只看该作者
aru 发表于 2018-4-19 11:12
魔都电信udp被QOS的死死的,不能用

郁闷啊
19#
 楼主| 发表于 2018-4-19 21:39:05 | 只看该作者
notmya 发表于 2018-4-19 19:37
LKL方式,这也不叫升级系统内核啊。。。

https://github.com/nanqinlang-tcp/tcp_nanqinlang ...

都不是升级内核。刚开始接触OVZ。坑还挺多,apt-get install build-essential 都会失败。
18#
 楼主| 发表于 2018-4-19 21:32:33 | 只看该作者
wagumaxida 发表于 2018-4-19 19:35
这个brook能集成到路由器上吗?

介绍:Brook 是一个高效的Socks5 代理软件,官方支持Windows、Linux、MacOS、IOS、Android、树莓派等设备,同时是使用Golang 语言编写,安装、使用异常简单。
推荐一个小众好用的代理软件 — Brook
17#
发表于 2018-4-19 19:37:42 | 只看该作者
Jennifer 发表于 2018-4-19 14:18
没升级OVZ内核。不打算升级了。你想折腾看看这个 搬瓦工VPS一键升级内核开启BBR ...


LKL方式,这也不叫升级系统内核啊。。。

https://github.com/nanqinlang-tcp/tcp_nanqinlang
16#
发表于 2018-4-19 19:35:09 | 只看该作者
这个brook能集成到路由器上吗?
15#
 楼主| 发表于 2018-4-19 14:18:29 | 只看该作者
gdzh65 发表于 2018-4-19 13:21
请问楼ovz如何升级内核?!

没升级OVZ内核。不打算升级了。你想折腾看看这个 搬瓦工VPS一键升级内核开启BBR
14#
 楼主| 发表于 2018-4-19 14:11:22 | 只看该作者
本帖最后由 Jennifer 于 2018-4-19 14:22 编辑
南琴浪 发表于 2018-4-19 13:00
我都差点不认得自己的代码了,一个是遗忘,一个是因为 loc 的神排版和纯文本样式,对于习惯了 vs 的我真是 ...


作者来了,热烈欢迎!
原脚本内容粘贴到nfp VPS上变成乱码,临时把中文改成英文,有不当之处,请见谅。
13#
发表于 2018-4-19 13:30:46 | 只看该作者
kcp不敢用,波动太大
12#
发表于 2018-4-19 13:21:46 | 只看该作者
请问楼ovz如何升级内核?!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-12-21 19:54 , Processed in 0.065115 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表