Automatic script to start shadowsocks-redir and configure routing table
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Peter Cai 51e65cb571
fix ipv6 with UDP
vor 10 Monaten
routes update chnroute vor 1 Jahr
systemd add systemd service vor 2 Jahren README: document about the "server" line vor 2 Jahren always call daemon-reload vor 2 Jahren
shadowsocks-auto-redir fix ipv6 with UDP vor 10 Monaten

Once upon a time, I wrote a blog post on how to set up shadowsocks-redir on ArchLinux as a system-wide proxy with chnroute as default.

And now I want to make the whole process automatic.

The following manual supports only distributions with systemd. ArchLinux is taken as default.
This script requires ROOT permission and comes with ABSOLUTELY NO WARRANTY. Use it at your own risk.


As this is no more than a simple script, I am not going to package it for any Linux distribution.

Install the dependencies first

# Execute as ROOT
pacman -S jq shadowsocks-libev ipset

Then clone this repo into any directory that the current user has access to. Take $HOME as an example.

# Execute as normal user
cd ~
git clone

Link itself to /opt and install the systemd unit

# Execute as ROOT
./ link


Now, put your Shadowsocks configuration file into /etc/shadowsocks/ (Please use a plain IP address for the server address, not a domain), for example, /etc/shadowsocks/config.json, and then run

# Execute as ROOT
systemctl start [email protected]

After the unit get started properly, all the TCP traffic from your system will go through the Shadowsocks proxy.

In addition, this script supports some exta fields (under ss_redir_options) in the configuration JSON file.

  "ss_redir_options": {
    "bypass_ips": [
    "bypass_preset": "chnroute",
    "ota": true

bypass_ips: A list of extra IPs to which traffic should not go through Shadowsocks proxy (by default, the server IP and the internal IP addresses are excluded from the proxy) bypass_preset: Include a predefined set of IPs to which traffic should not go through Shadowsocks proxy (currently only chnroute available which excludes all Chinese Mainland IPs) ota: Enable One-Time Authentication or not.

NOTE: This script does nothing to resolve DNS poisoning. If your network is subject to DNS poisoning, an anti-poisoning DNS server should be used or set up.


Switch to the directory of this project

# Execute as normal user
git pull
sudo ./ update


Stop all the relavent systemd services before uninstallation.

Switch to the directory of this project

# Execute as ROOT
./ unlink