Configure one Tor client as a LAN gateway for multiple hosts
You can expose your Tor client to other machines on your LAN by binding it to additional addresses in torrc.
By default Tor only accepts SOCKS connections from localhost. Tor can be configured as a client or a relay on another machine, and allow other machines to be able to connect to it for anonymity. 如果许多电脑需要匿名网关来访问外面的网络,这是最有用的。 然而请注意,通过这种配置,您的私人网络内的任何人(介于您与 Tor 客户端/中继之间)都可以看到您发送的明文流量。 在到达 Tor 中继之前,你并没有匿名化。 有鉴于此,如果作为域名控制者,你知道一切都锁定,那就没问题,但这种配置可能不适合大型私人网络,因为安全是重中之重。
Configuration is simple, editing your torrc file's SocksListenAddress according to the following examples:
SocksListenAddress 127.0.0.1
SocksListenAddress 192.168.x.x:9100
SocksListenAddress 0.0.0.0:9100
如果你属于多个网络或子网,可声明多个监听地址。
SocksListenAddress 192.168.x.x:9100 #eth0
SocksListenAddress 10.x.x.x:9100 #eth1
在这之后,在相应网络/子网的客户端使用 socks 代理,其地址和端口与 SocksListenAddress 指定的相同。 请注意,SocksPort 配置选项给出的端口仅用于 localhost(127.0.0.1)。 在设置 SocksListenAddress 时,你需要提供端口与地址,如上所示。 如果您想要强制所有传出数据都通过中央 Tor 客户端/中继,而不只是选择性让服务器作为代理,那么 iptables 程序(用于 *nix)或许会对您有帮助。