Centos7下安裝配置Redsocks


  Redsocks是一個開源的網絡程序,代碼依賴開源的libevent網絡庫。Redsocks允許你將所有TCP連接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安裝配置Shadowsocks)。通常的用途是流量透傳或流量轉發,首先將本機上目的地為的某些特定IP的流量轉發到Redsocks的監聽端口上(本文為8888),之后Redsocks會將這些流量再轉發給后端的Shadowsocks,再通過shadowocks轉到更遠的地方。

1、下載編譯

[root@localhost ~]# yum install libevent-devel git gcc
[root@localhost ~]# mkdir ~/shadowsocks
[root@localhost ~]# cd ~/shadowsocks
[root@localhost ~]# git clone https://github.com/darkk/redsocks
[root@localhost ~]# cd ~/shadowsocks/redsocks
[root@localhost ~]# make
[root@localhost ~]# cp ~/shadowsocks/redsocks/redsocks /usr/local/bin/

 2、新建配置文件(默認即可,無需更改)

[root@localhost ~]# vi /etc/redsocks.conf

base {
        log_debug = off;
        log_info = on;
        log = stderr;
        daemon = off;
        redirector = iptables;
}
redsocks {
        local_ip = 127.0.0.1;
        local_port = 8888;
        ip = 127.0.0.1;
        port = 1080;
        type = socks5;
}

 3、啟動/停止

啟動
[root@localhost ~]# nohup /usr/local/bin/redsocks -c /etc/redsocks.conf &
停止
[root@localhost ~]# kill -9 對應進程

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM