16.10 yakkety and aboveInstall the the shadowsocks-libev package from apt repository. sudo apt update sudo apt install shadowsocks-libevSave ss.json as /etc/shadowsocks-libev/config.json. Replace server_port and password in ss.json with your own choices. Restart the shadowsocks-libev service. sudo systemctl restart shadowsocks-libev sudo systemctl status shadowsocks-libev
16.04 xenial
Install shadowsocks with pip. sudo apt update sudo apt install python-pip sudo pip install shadowsocksSave ss.json under /etc/shadowsocks/. Replace server_port and password in ss.json with your own choices. Save ssserver.service under /usr/lib/systemd/system/ Enable the systemd service. sudo systemctl enable ssserver sudo systemctl start ssserver sudo systemctl status ssserver
14.04 trusty
Install shadowsocks with pip. sudo apt-get update sudo apt-get install python-pip sudo pip install shadowsocksSave ss.json, start.sh, stop.sh under /etc/shadowsocks/. Replace server_port and password in ss.json with your own choices. Put the following in /etc/rc.local to start ssserver upon server start. # Start shadowsocks server /etc/shadowsocks/start.sh
Use TCP BBR
This will enable TCP BBR congestion control algorithm to improve network bandwidth utilization (10x improvement is not uncommon). Install linux kernel 4.9
Note: do this only if the distribution comes with a older kernel version. URL=http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.9/linux-image-4.9.9-040909-generic_4.9.9-040909.201702090333_amd64.debwget $URLsudo dpkg -i $(basename $URL)sudo rebootEnable TCP BBR
SYSCTL_CONF=/etc/sysctl.d/60-tcp-bbr.confecho "net.core.default_qdisc=fq" | sudo tee $SYSCTL_CONFecho "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a $SYSCTL_CONFsudo sysctl -p $SYSCTL_CONFsysctl net.ipv4.tcp_available_congestion_controlsysctl net.ipv4.tcp_congestion_controllsmod | grep bbrss.json- {
- "server": "0.0.0.0",
- "server_port": "[port]",
- "password": "[password]",
- "timeout": 300,
- "method": "xchacha20-ietf-poly1305",
- "mode": "tcp_only",
- "fast_open": true,
- "nameserver": "8.8.8.8"
- }
复制代码 ssserver.service- [Unit]
- Description=Daemon to start shadowsocks server
- Wants=network-online.target
- After=network.target
- [Service]
- Type=simple
- ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss.json -qq
- User=nobody
- [Install]
- WantedBy=multi-user.target
复制代码 start.sh- #!/bin/bash
- sudo /usr/local/bin/ssserver -c /etc/shadowsocks/ss.json --user nobody -qq -d start
复制代码 stop.sh- #!/bin/bash
- sudo /usr/local/bin/ssserver -c /etc/shadowsocks/ss.json -d stop
复制代码
https://gist.github.com/zhiguangwang/7018fbc0a38a5b663868
|