
Then make sure you can write at opt partition. Youtube-ui-china.l.google.My advise is to set it to ext4 (long time ago i had issues using ext2 and ext3) and label it as "opt" so DD-WRT can mount it at boot automaticaly. Youtube-ui-china.l. has IPv6 address $ sudo src/chinadns -m -c $ host Youtube-ui.l. is an alias for youtube-ui-china.l. has address $ host is an alias for youtube-ui.l. Iptables -t nat -A PREROUTING -p tcp -j $ sudo $ host # These traffic go to REDSOCKS chain first Iptables -t nat -A REDSOCKS -p tcp -j REDIRECT -to-ports 12345 # Redirect all TCP traffic to redsocks, which listens on port 12345 Sudo iptables -t nat -A REDSOCKS -d $subnet -j RETURN # China traffic does not go through REDSOCKS Iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN Iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN Iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN Iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN Iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN Iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN Iptables -t nat -A REDSOCKS -d $SS_SERVER_IP -j RETURN Iptables -t nat -N REDSOCKS # Create a new chain called REDSOCKS Installing shadowsocks is very simple, note that it will be installed under I assume that you have shadowsocks server running on a public server, so I will skip that part and only talk about the client side. ( Update: I have switched from ChinaDNS to dnsmasq+dnscrypt, please read Securing DNS Traffic in China to see how it works.) Shadowsocks ChinaDNS queries local DNS servers to resolve Chinese domains and queries foreign DNS servers to resolve foreign domains, and from my testing it is useful to avoid DNS poisoning with the “DNS compression pointer mutation” option. To avoid DNS poisoning, we can always resolve DNS over our secured shadowsocks connection, but this is not optimal if a China website have CDNs outside China. Even if you don’t care about performance, this is still necessary in some circumstances like geoip restriction such as tv. does not deliver contents if you live outside of China.įinally, we want to improve the performance even further by using ChinaDNS. To remain as fast as normal when accessing China websites you also need to skip routing traffic to Redsocks for anything within the China IP ranges. DNS traffic has to be routed by redsocks as well otherwise your DNS replies will be contaminated. It’s simple to get it up and running on a local machine, but on a router you need to use redsocks to redirect traffic to the shadowsocks client running on your Raspberry Pi.
#Router with shadowsocks client free#
The mechanism is to use shadowsocks on your router which directs any traffic to a shadowsocks server in the free world. Don’t be despair and with some hacking you can get your Internet freedom back. Assume you already have a Raspberry Pi configured as a WIFI router like mine shown below, but you live in China and have to deal with the fact that many websites can’t be accessed due to GFW.
