Skip to content

Instantly share code, notes, and snippets.

@kookxiang
Created October 6, 2015 06:47
Show Gist options
  • Save kookxiang/50be125d52b37b09c144 to your computer and use it in GitHub Desktop.
Save kookxiang/50be125d52b37b09c144 to your computer and use it in GitHub Desktop.
SS-Redir config file for OpenWRT
#!/bin/sh
# Notice: hosts file is required
killall ss-redir > /dev/null
ss-redir -v -c /etc/ss-redir.json &
iptables -t nat -N SHADOWSOCKS > /dev/null
iptables -t nat -F SHADOWSOCKS > /dev/null
iptables -t nat -D PREROUTING -j SHADOWSOCKS > /dev/null
iptables -t nat -I PREROUTING -j SHADOWSOCKS > /dev/null
# Google Services
iptables -t nat -A SHADOWSOCKS -p tcp -d 59.18.34.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 59.18.35.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 59.18.44.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 64.233.162.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 64.233.163.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 64.233.177.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 64.233.186.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 64.233.189.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 74.125.202.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 94.201.50.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 173.194.123.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 173.194.203.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 203.208.48.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 203.208.49.0/24 -j REDIRECT --to-ports 12580
iptables -t nat -A SHADOWSOCKS -p tcp -d 210.242.125.0/24 -j REDIRECT --to-ports 12580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment