Utilizar o Tor na porta LAN
O firmware Tor transferido do nosso site encaminha apenas as ligações do ssid – “Tor” para a rede tor. Se pretender encaminhar todas as ligações LAN para a rede Tor, terá de duplicar a configuração. Seguem-se as instruções detalhadas.
_**
**_
Ligue-se ao router por SSH, altere os scripts seguintes e reinicie o router. Pode ligar-se ao router por ssh quando estiver ligado ao ssid: openwrt.
Se tiver definido uma palavra-passe, utilize ssh:
$ ssh root@192.168.1.1
Se não tiver definido uma palavra-passe, utilize telnet
$ telnet 192.168.1.1
/etc/config/network
Comente as linhas vermelhas e adicione as linhas verdes
config interface ‘lan’
# option ifname ‘eth1’
option force_link ‘1’
# option type ‘bridge’
option proto ‘static’
option ipaddr ‘192.168.1.1’
option netmask ‘255.255.255.0’
option ip6assign ’60’
config interface ‘tor1’
option ifname ‘eth1’
option proto
‘static’
option ipaddr ‘172.16.2.1’
option netmask
‘255.255.255.0’
/etc/config/dhcp
Adicione as linhas seguintes
config dhcp ‘tor1’
option interface tor1
option start 100
option limit 150
option leasetime 1h
option ra server
/etc/config/firewall
Adicione todas as secções seguintes
config zone
option name ‘tor1’
option network ‘tor1’
option input ‘REJECT’
option output ‘ACCEPT’
option forward ‘REJECT’
option conntrack ‘1’
config rule
option name ‘Allow-Tor-DHCP’
option src ‘tor1’
option proto ‘udp’
option dest_port ’67’
option target ‘ACCEPT’
option family ‘ipv4’
config rule
option name ‘Allow-Tor-DNS’
option src ‘tor1’
option proto ‘udp’
option dest_port ‘9053’
option target ‘ACCEPT’
option family ‘ipv4’
config rule
option name ‘Allow-Tor-Transparent’
option src ‘tor1’
option proto ‘tcp’
option dest_port ‘9040’
option target ‘ACCEPT’
option family ‘ipv4’
config rule
option name ‘Allow-Tor-SOCKS’
option src ‘tor1’
option proto ‘tcp’
option dest_port ‘9050’
option target ‘ACCEPT’
option family ‘ipv4’
/etc/firewall.user
Adicione as linhas verdes
enable_transparent_tor() {
iptables -t nat -A
PREROUTING -i wlan0-1 -p udp –dport 53 -j REDIRECT –to-ports 9053
iptables -t nat -A PREROUTING -i wlan0-1 -p tcp –syn -j REDIRECT
–to-ports 9040
iptables -t nat -A PREROUTING -i eth1 -p udp –dport 53 -j REDIRECT
–to-ports 9053
iptables -t nat -A PREROUTING -i eth1 -p tcp –syn
-j REDIRECT –to-ports 9040
}
enable_transparent_tor
/etc/tor/torrc
Adicione as linhas verdes
User tor
VirtualAddrNetwork 10.192.0.0/10
TransPort 9040
TransListenAddress 172.16.1.1
TransListenAddress 172.16.2.1
DNSPort 9053
DNSListenAddress 172.16.1.1
DNSListenAddress 172.16.2.1
About GL.iNet
Founded in 2010, GL.iNet is a leading provider of innovative routers and networking solutions. From compact travel routers to cutting-edge remote KVMs, GL.iNet delivers award-winning networking technology designed for performance and security.
GL.iNet gives people and organizations the power to connect with confidence. By putting control in the hands of users, GL.iNet supports the productivity and collaboration that shape a Good Life.