搭建自己的翻墙服务器--Shadowsocks 服务端快速安装指南
入手自己的服务器
要想搭建自己的翻墙服务器,首先你得租一个境外的服务器。推荐了解一下digitalocean、vultr、linode这三家,大概每月2.5-5美金,选一个自己用起来不卡的即可。我个人使用的是vultr纽约节点,最便宜的一档2.5美元一个月的套餐,供参考
创建服务器
购买好云服务之后创建服务器,推荐使用最新的centos 7 64位系统。
安装依赖
使用root账户登陆系统,安装所需要的依赖
yum -y install git psmisc python-setuptools python-pip;
yum -y groupinstall "Development Tools";
如果要使用chacha20_poly1305加密,则需要编译安装libsodium
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz;
tar xf LATEST.tar.gz;
cd libsodium-stable;
./configure && make -j4 && make install;
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf;
ldconfig;
安装Shadowsocks服务端程序
pip install git+https://github.com/shadowsocks/shadowsocks.git@master;
启用Google BBR拥塞控制
关于BBR可以看这里 来自Google的TCP BBR拥塞控制算法解析
启用方法:
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh;
chmod +x bbr.sh;
./bbr.sh;
安装完成后,脚本会提示需要重启 VPS,输入 y 并回车后重启。
重启完成后,进入 VPS,验证一下是否成功安装最新内核并开启 TCP BBR,输入以下命令:
uname -r
查看内核版本,大于 4.9 就表示 OK 了
sysctl net.ipv4.tcp_available_congestion_control
返回值一般为:net.ipv4.tcp_available_congestion_control = bbr cubic reno
sysctl net.ipv4.tcp_congestion_control
返回值一般为:
net.ipv4.tcp_congestion_control = bbr
sysctl net.core.default_qdisc
返回值一般为:
net.core.default_qdisc = fq
lsmod | grep bbr
返回值有tcp_bbr模块即说明bbr已启动。
关闭Centos7的防火墙
Centos7的防火墙默认是打开的,并且不允许ss通过,可以直接禁止掉。
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
启动服务端
服务端的启动方式可直接参考这里
祝大家愉快。
Hello!
Congratulations @aaronshao! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOPCongratulations @aaronshao! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOPCongratulations @aaronshao! You received a personal award!
Click here to view your Board of Honor
Congratulations @aaronshao! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!