Centos 翻墙

Install shadowsocks

1
2
3
yum -y install epel-release
yum -y install python-pip
pip install shadowsocks

Configurtion shadowsocks config

免费翻墙账号

1
vim /etc/shadowsocks/shadowsocks.json
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "server":"173.0.55.66",
    "server_port":11111,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"dongtaiwang.com 123abc",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false,
    "workers": 1
}

Create systemd server

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create systemd server
vim  /etc/systemd/system/shadowsocks.service 

# configuration systemd server
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/bin/sslocal -c /etc/shadowsocks/shadowsocks.json
[Install]
WantedBy=multi-user.target

# start server
systemctl restart shadowsocks.service

Install privoxy

1
2
# server_port default  8118
yum install privoxy

Configurtion privoxy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
vim /etc/privoxy/config
搜索forward-socks5t,第1336行,将 forward-socks5t / 127.0.0.1:9050 . 取消注释并修改为

forward-socks5t / 127.0.0.1:1080 . 

并取消下面的几条注释
forward         192.168.*.*/     .
forward            10.*.*.*/     .
forward           127.*.*.*/     .

forward           localhost/     .

# start server
systemctl daemon-reload && systemctl restart privoxy

Configurtion profile

1
2
3
4
5
6
7
8
vim /etc/profile
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118

source /etc/profile

# test
curl -I www.google.com

configurtion docker https proxy

1
2
3
4
5
6
7
8
# configurtion docker sverice
[Service]
Environment="HTTP_PROXY=127.0.0.1:8118"
Environment="HTTPS_PROXY=http://127.0.0.1:8118"
Environment="NO_PROXY=localhost,127.0.0.1"

# test
docker pull gcr.io/google-containers/busybox:latest