Open rogerxu opened 6 years ago
Fix yum
repository
$ cd /etc/yum.repos.d/
$ ls
CentOS-Base.repo
$ vim CentOS-Base.repo
remark out baseurl
$ yum install -y deltarpm
Upgrade python
$ yum update -y python
$ python --version
Install pip
$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py
$ pip --version
Install shadowsocks
$ pip install shadowsocks
Create a config file /etc/shadowsocks.json
. Example:
{
"server": "0.0.0.0",
"server_port": 443,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "mypassword",
"timeout": 300,
"method": "rc4-md5",
"fast_open": false,
"workers": 2
}
To run in the foreground:
$ ssserver -c /etc/shadowsocks.json
To run in the background:
$ ssserver -c /etc/shadowsocks.json -d start
$ ssserver -c /etc/shadowsocks.json -d stop
Install speedtest
$ pip install speedtest-cli
$ speedtest --list | grep -i 'shanghai'
5083) Shanghai Branch, China Unicom (Shanghai, China)
Test network speed
$ speedtest --server=5083
epel: https://fedoraproject.org/wiki/EPEL/zh-cn
Install epel
$ yum install epel-release
Install dependencies
$ yum install libnet libpcap libnet-devel libpcap-devel
$ wget https://github.com/snooda/net-speeder/archive/master.zip
$ unzip master.zip
Build with Linux Cooked interface (venetX, OpenVZ):
$ sh build.sh -DCOOKED
Build with standard interface (Xen, KVM, physical machine)
$ sh build.sh
$ cp net_speeder /usr/bin
Run
$ net_speeder venet0 "ip"
Add to boot script
$ echo 'nohup net_speeder venet0 "ip host `hostname -i` and src port 443" >/dev/null 2>&1 &' >> /etc/rc.d/rc.local
/etc/rc.d/rc.local
nohup net_speeder venet0 "ip host `hostname -i` and src port 443" >/dev/null 2>&1 &
snooda/net-speeder: net-speeder 在高延迟不稳定链路上优化单线程下载速度