选择VPS并安装基础系统

根据各自网络的情况,选择合适的VPS。我用的是Bandwagon,系统Debian9。

安装shadowsocks-libev

更新软件源并更新系统

apt update & apt upgrade

添加stretch-backports源

printf "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list

更新软件源并安装shadowsocks-libev和simple-obfs

apt update
apt -t stretch-backports install shadowsocks-libev simple-obfs

针对不同系统的安装可以看Github:shadowsocks-libev

配置shadowsocks

编辑配置文件

vim /etc/shadowsocks-libev/config.json

配置文件如下

{
    "server":"0.0.0.0",
    "server_port":666,          #端口可以换,仅作示例
    "local_port":1080,
    "password":"yourpassword",  #密码
    "timeout":60,
    "method":"chacha20-ietf-poly1305",
    "mode":"tcp_and_udp",
    "fast_open":true,
    "plugin":"obfs-server",
    "plugin_opts":"obfs=tls"
}

运行并设置开机启动

systemctl start shadowsocks-libev
systemctl enable shadowsocks-libev

开启BBR

首先检查内核版本uname -a,高于4.9就可以直接开启,当然Debian 9是符合的。

执行lsmod | grep bbr,如果结果中没有tcp_bbr,就先执行

modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf

修改系统变量

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

保存生效

sysctl -p

执行

sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control

如果结果都有bbr, 则证明你的内核已开启bbr

执行lsmod | grep bbr, 看到有tcp_bbr模块即说明bbr已启动

Across the Great wall, we can reach every corner in the world.