SS-REDIR(1)
π SS-REDIR(1) β okay bestie, this is the shadowsocks-libev manual page, and yes we're reading it together π«Ά
So this is ss-redir from the Shadowsocks-libev manual β it's the shadowsocks client as transparent proxy, libev port. Sit down, grab a drink, we're gonna get through it π
β¨ NAME β¨
ss-redir β shadowsocks client as transparent proxy, libev port. That's the whole vibe. She redirects, she proxies, she's transparent about it π
πΈ SYNOPSIS πΈ
ss-redir [-uUv6] [-h|--help] [-s <server_host>] [-p <server_port>] [-l
<local_port>] [-k <password>] [-m <encrypt_method>] [-f <pid_file>] [-t
<timeout>] [-c <config_file>] [-b <local_address>] [-a <user_name>] [-n
<nofile>] [--mtu <MTU>] [--no-delay] [--plugin <plugin_name>]
[--plugin-opts <plugin_options>] [--password <password>] [--key
<key_in_base64>]
No cap, that's the whole shape of her π
π¦ DESCRIPTION π¦
Okay so β Shadowsocks-libev is a lightweight and secure socks5 proxy, and it's a port of the original shadowsocks created by clowwindy. It's written in pure C and it takes advantage of libev so it gets both high performance and low resource consumption. Like, obsessed. Main character energy fr π₯
Shadowsocks-libev consists of five components. ss-redir is the one that works as a transparent proxy on local machines to proxy TCP traffic β and here's the catch bestie, she requires netfilter's NAT module π. For more info, go check out shadowsocks-libev(8) and the EXAMPLE section below, iykyk.
π OPTIONS π
-s <server_host>β sets the server's hostname or IP. Where we're going βοΈ-p <server_port>β sets the server's port number.-l <local_port>β sets the local port number.-k <password>,--password <password>β sets the password. The server and the client should use the same password β like matching friendship bracelets but for crypto π«Ά--key <key_in_base64>β sets the key directly. The key should be encoded with URL-safe Base64.-m <encrypt_method>β sets the cipher.
Shadowsocks-libev accepts 19 different ciphers:
aes-128-gcm, aes-192-gcm, aes-256-gcm, rc4-md5, aes-128-cfb,
aes-192-cfb, aes-256-cfb, aes-128-ctr, aes-192-ctr, aes-256-ctr,
bf-cfb, camellia-128-cfb, camellia-192-cfb, camellia-256-cfb,
chacha20-ietf-poly1305, xchacha20-ietf-poly1305, salsa20, chacha20
and chacha20-ietf.
The default cipher is chacha20-ietf-poly1305 β she's the moment β
Heads up bestie: if it's built with PolarSSL or custom OpenSSL libraries, some of these ciphers may not work. Not me finding that out the hard way π
-a <user_name>β run as a specific user.-f <pid_file>β start shadowsocks as a daemon with a specific pid file.-t <timeout>β sets the socket timeout in seconds. The default value is60.-c <config_file>β use a configuration file. Refer toshadowsocks-libev(8)CONFIG FILE section for more details.-n <number>β specify max number of open files. Only available on Linux.-b <local_address>β specify the local address to use while this client is making outbound connections to the server.-uβ enable UDP relay.TPROXYis required in redir mode, and you may need root permission π-Uβ enable UDP relay and disable TCP relay.-Tβ usetproxyinstead ofredirect. (for tcp)-6β resolve hostname to IPv6 address first.--mtu <MTU>β specify the MTU of your network interface.--mptcpβ enable Multipath TCP. Only available with MPTCP enabled Linux kernel.--reuse-portβ enable port reuse. Only available with Linux kernel >3.9.0.--no-delayβ enableTCP_NODELAY.--tcp-incoming-sndbuf <size>β set TCP send buffer size for incoming connections.--tcp-incoming-rcvbuf <size>β set TCP receive buffer size for incoming connections.--tcp-outgoing-sndbuf <size>β set TCP send buffer size for outgoing connections.--tcp-outgoing-rcvbuf <size>β set TCP receive buffer size for outgoing connections.--plugin <plugin_name>β enable SIP003 plugin. (Experimental) π--plugin-opts <plugin_options>β set SIP003 plugin options. (Experimental)-vβ enable verbose mode. She talks now π£οΈ-h|--helpβ print help message.
π₯ EXAMPLE π₯
ss-redir requires netfilter's NAT function β no NAT, no party. Here's an example:
# Create new chain
iptables -t nat -N SHADOWSOCKS
iptables -t mangle -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
iptables -t nat -A SHADOWSOCKS -d 123.123.123.123 -j RETURN
# Ignore LANs and any other addresses you'd like to bypass the proxy
# See Wikipedia and RFC5735 for full list of reserved networks.
# See ashi009/bestroutetb for a highly optimized CHN route list.
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
# Anything else should be redirected to shadowsocks's local port
iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 12345
# Add any UDP rules
ip route add local default dev lo table 100
ip rule add fwmark 1 lookup 100
iptables -t mangle -A SHADOWSOCKS -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
# Apply the rules
iptables -t nat -A PREROUTING -p tcp -j SHADOWSOCKS
iptables -t mangle -A PREROUTING -j SHADOWSOCKS
# Start the shadowsocks-redir
ss-redir -u -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
Bestie, that # It's very IMPORTANT, just be careful. comment is in the original and I'm keeping it because it's giving warnings from a wise elder π Don't skip the RETURN rules, fr fr.
π SEE ALSO π
ss-local(1), ss-server(1), ss-tunnel(1), ss-manager(1), shadowsocks-libev(8), iptables(8), /etc/shadowsocks-libev/config.json β go read the whole friend group π
And that's the page! Here's the cute sign-off: this served you Shadowsocks-libev 3.3.6, dated 10/11/2026, and it's the SS-REDIR(1) page β slay, you read the whole thing, I'm so proud of you π§β¨π
π¦ where this page comes from
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- opensuse-leap 16.0: shadowsocks-libev 3.3.6-bp160.3.1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms