Share a post that uses Raspberry Pi +ss+chinadns+bandwagon as a gateway

Source: Internet
Author: User

This scheme is suitable for the Raspberry Pi hardware, do not want to make changes in the router friends, this is a network can be all over, but also according to the destination IP (domestic and non-domestic routing, not all data go ss), of course, if there is a better solution or error please point out.

Preparatory work:
1:raspberry B + (recommended A + +, this version of the relatively big progress in the other, specifically do not say their own Google), which is almost equivalent to a Linux computer in the LAN, and finally routed through it.
2: A certain familiarity with Linux, but if you are confident, Google can also.
3:banwagon, this doesn't explain.
4: Suppose you are already a root account.

Solution Ideas:
1: Resolve DNS pollution;
2: Packet walk shadowsocks;

The installation configuration of the Raspberry PI B + is as follows:
#升级一下现有的组件
Apt-get Update
Apt-get Install Dnsutils

#shadowsocks Installation:
Apt-get Install Libssl-dev
git clone https://github.com/shadowsocks/shadowsocks-libev.git
CD Shadowsocks-libev
./configure
Make
Make install

#shadowsocks configuration, where server_ip and Port are VPS (bandwagon) already set (server side configuration is not a problem)
Vi/etc/shadowsocks_vps.json
{
"Server": "Server_ip",
"Server_port": Server_port,
"Local_address": "0.0.0.0",
"Local_port": 1080,
"Password": "Password",
"Timeout": 3000,
"Method": "AES-256-CFB",
"Workers": 10
}


#下载安装ChinaDNS
Https://github.com/clowwindy/ChinaDNS-C/releases/download/1.2.1/chinadns-c-1.2.1.tar.gz
TAR-ZXF chinadns-c-1.2.1.tar.gz
CD chinadns-c-1.2.1
./configure
Make
Make install


#下载安装redsocks
Apt-get Install Redsocks
#修改配置:
Vi/etc/redsocks.conf
Log_info = off;
To modify the Redsocks segment:
Local IP 127.0.0.1 = 0.0.0.0
Local_port to 1081 (redsocks port)
Port is SOCKS5 (port)

#开机启动, including the setting of the Iptabls:
Vi/etc/rc.local
Nohup/usr/local/bin/ss-local-c/etc/shadowsocks_vps.json-u--acl/root/shadowsocks-libev/acl/chn.acl >/dev/null &
Nohup/usr/sbin/redsocks-c/etc/redsocks.conf >/dev/null &
Nohup/usr/local/bin/ss-tunnel-c/etc/shadowsocks_vps.json-l 5353-l 8.8.4.4:53-u >/dev/null &
Nohup/root/chinadns-c-1.2.1/src/chinadns-s "114.114.114.114,127.0.0.1:5353"-l/root/chinadns-c-1.2.1/iplist.txt- C/root/chinadns-c-1.2.1/chnroute.txt >/dev/null &

Iptables-t nat-f
Iptables-t Nat-n Redsocks
Iptables-t Nat-n Redsocks_filter

#本地和保留地址放行, the others go to the last rule (forward to port 1081)
Iptables-t nat-a redsocks_filter-d 0.0.0.0/8-j RETURN
Iptables-t nat-a redsocks_filter-d 127.0.0.0/8-j RETURN
Iptables-t nat-a redsocks_filter-d 192.168.1.0/24-j RETURN
Iptables-t nat-a redsocks_filter-d 192.168.0.0/24-j RETURN
Iptables-t nat-a redsocks_filter-j Redsocks

#转发到1081端口
Iptables-t nat-a redsocks-p tcp-j REDIRECT--to-port 1081

#进来的数据包进入指定的chains (top)
Iptables-t nat-a prerouting-p tcp-j redsocks_filter


Below is the configuration of the bandwagon:
1: Install the Debian system, you should install the latest.
2:apt-get Install git Libssl-dev
3:shadowsocks installation: (as above, as this already includes services and clients)
#修改配置, Port is the server port configured for the upper Raspberry Pi B + configuration, same as the password.
/etc/shadowsocks_vps.json
{
"Server": "0.0.0.0",
"Server_port":p ort,
"Local_port": 1881,
"Password": "Password",
"Method": "AES-256-CFB",
"Timeout": 3000
}

#执行, note: To add the-u parameter
4: Executive Nohup/usr/local/bin/ss-server-u-c/etc/shadowsocks_vps.json >/dev/null &



#最后修改路由器的默认网关和DNS为这个raspberry the Pi B + IP



-----------------Off-Topic-----------------------------
Because I am illiterate, Chinese is not good. The above content I do not represent personal position and subjective will, all the source of the forum's collation, if any problems have nothing to do with me.
All types of threats and intimidation are declined, please contact the administrator to delete them if necessary.

Share a post that uses Raspberry Pi +ss+chinadns+bandwagon as a gateway

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.