Browse Source

Tor configuration

Bob Mottram 10 years ago
parent
commit
14b7965f96
1 changed files with 8 additions and 14 deletions
  1. 8
    14
      install-freedombone.sh

+ 8
- 14
install-freedombone.sh View File

@@ -6995,7 +6995,7 @@ function route_outgoing_traffic_through_tor {
6995 6995
 
6996 6996
   ### set variables
6997 6997
   # Destinations you don't want routed through Tor
6998
-  _non_tor="192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 192.168.4.0/24 192.168.10.0/24 192.168.42.0/24"
6998
+  _non_tor="192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24 192.168.10.0/24 192.168.42.0/24"
6999 6999
 
7000 7000
   # The user that Tor runs as
7001 7001
   _tor_uid="debian-tor"
@@ -7056,7 +7056,7 @@ function route_outgoing_traffic_through_tor {
7056 7056
 
7057 7057
   echo 'domain localdomain' > /etc/resolv.conf
7058 7058
   echo 'search localdomain' >> /etc/resolv.conf
7059
-  echo 'nameserver 127.0.0.1' >> /etc/resolv.conf
7059
+  echo "nameserver $WIFI_STATIC_IP_ADDRESS" >> /etc/resolv.conf
7060 7060
 
7061 7061
   if ! grep -q "VirtualAddrNetworkIPv4" /etc/tor/torrc; then
7062 7062
       echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >> /etc/tor/torrc
@@ -7070,24 +7070,16 @@ function route_outgoing_traffic_through_tor {
7070 7070
       echo 'TransPort 9040' >> /etc/tor/torrc
7071 7071
   fi
7072 7072
 
7073
-  if ! grep -q "TransListenAddress 127.0.0.1" /etc/tor/torrc; then
7074
-      echo 'TransListenAddress 127.0.0.1' >> /etc/tor/torrc
7075
-  fi
7076
-
7077
-  if ! grep -q "TransListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" /etc/tor/torrc; then
7078
-      echo "TransListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/tor/torrc
7073
+  if ! grep -q "TransListenAddress $WIFI_STATIC_IP_ADDRESS" /etc/tor/torrc; then
7074
+      echo "TransListenAddress $WIFI_STATIC_IP_ADDRESS" >> /etc/tor/torrc
7079 7075
   fi
7080 7076
 
7081 7077
   if ! grep -q "DNSPort" /etc/tor/torrc; then
7082 7078
       echo 'DNSPort 53' >> /etc/tor/torrc
7083 7079
   fi
7084 7080
 
7085
-  if ! grep -q "DNSListenAddress 127.0.0.1" /etc/tor/torrc; then
7086
-      echo 'DNSListenAddress 127.0.0.1' >> /etc/tor/torrc
7087
-  fi
7088
-
7089
-  if ! grep -q "DNSListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" /etc/tor/torrc; then
7090
-      echo "DNSListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/tor/torrc
7081
+  if ! grep -q "DNSListenAddress $WIFI_STATIC_IP_ADDRESS" /etc/tor/torrc; then
7082
+      echo "DNSListenAddress $WIFI_STATIC_IP_ADDRESS" >> /etc/tor/torrc
7091 7083
   fi
7092 7084
 
7093 7085
   echo 'route_outgoing_traffic_through_tor' >> $COMPLETION_FILE
@@ -7269,6 +7261,8 @@ function enable_wifi_hotspot {
7269 7261
       echo "    network $WIFI_SUBNET" >> /etc/network/interfaces
7270 7262
       echo "    gateway $ROUTER_IP_ADDRESS" >> /etc/network/interfaces
7271 7263
       echo "    dns-nameservers $ROUTER_IP_ADDRESS" >> /etc/network/interfaces
7264
+      echo "    up iptables -t nat -I POSTROUTING -s $WIFI_SUBNET/24 -j MASQUERADE" >> /etc/network/interfaces
7265
+      echo "    down iptables -t nat -D POSTROUTING -s $WIFI_SUBNET/24 -j MASQUERADE" >> /etc/network/interfaces
7272 7266
   fi
7273 7267
 
7274 7268
   if ! grep -q '#option domain-name "example.org";' /etc/network/interfaces; then