TOR Router 允许你使用 TOR 作为透明代理,并将所有流量(包括 DNS 请求)通过 TOR 传输,你只需要:一个使用 systemd 的系统(如果你想使用服务)和 tor。
与其他路由流量的工具不同,TOR Router 不会修改系统文件,原因在于:路由流量不需要移动文件,而且移动文件是个坏主意,因为脚本/工具中的故障可能导致系统网络连接中断,而你却不知道发生了什么。
注意: tor-router 不会路由 UDP 数据包,因为 TOR 不支持 UDP:https://2019.www.torproject.org/docs/faq.html.en#TransportIPnotTCP
如果你在使用 BlackArch Linux (https://blackarch.org),可以通过以下命令从仓库安装脚本:`# pacman -S tor-router`
从源码安装:
注意:你需要 BASH,而不是 sh
~$ git clone https://github.com/edu4rdshl/tor-router.git && cd ./tor-router && sudo bash install.sh
在使用 systemd 的发行版中,建议使用 install.sh 脚本,不过这里也描述了安装/配置 tor-router 的过程。
脚本需要 root 权限
~$ git clone https://github.com/edu4rdshl/tor-router.git && cd tor-router/files
# 为 tor-router 设置 TOR 透明代理
VirtualAddrNetwork 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040
DNSPort 5353
# sudo ./tor-router
删除 /etc/tor/torrc 中的 tor-router 配置行,使用 systemctl 禁用 tor-router.service(如果你使用了 install.sh 脚本),移除 /usr/bin/tor-router、/etc/systemd/system/tor-router.service,然后重启电脑。
运行脚本后,按照以下步骤确保一切正常:


BlackArch Linux:https://github.com/BlackArch/blackarch/blob/master/packages/tor-router