Centos7搭建tor Relay 中继

添加官方源/etc/yum.repos.d/tor.repo

[tor]
name=Tor for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.torproject.org/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/centos/public_gpg.key
cost=100

或者使用epel源

yum install epel-release

安装tor

yum install tor

修改配置文件/etc/tor/torrc

ExitPolicy reject #非出口节点
AccountingMax 500 GBytes # 每月分配给 Tor 500G 流量  
AccountingStart month 1 0:00 # 每月1号0点(Locale)清零  
RelayBandwidthRate 20000 KBytes  # Throttle traffic to 20000KB/s 
RelayBandwidthBurst 20000 KBytes # But allow bursts up to 20000KB/s

开机启动

sudo systemctl enable tor

启动

systemctl start tor

使用docker


docker run -d -v /etc/localtime:/etc/localtime --restart always -p 9001:9001 -e "RELAY_BANDWIDTH_RATE=20000 KBytes"  -e "RELAY_BANDWIDTH_BURST=20000 KBytes" --name tor-relay jess/tor-relay -f /etc/tor/torrc.middle

参考文章:https://blog.jessfraz.com/post/running-a-tor-relay-with-docker/

https://yepster.me/tor-deployment/

0%