Browse Source

tor configuration

Bob Mottram 10 years ago
parent
commit
157be6e477
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      install-freedombone.sh

+ 6
- 5
install-freedombone.sh View File

@@ -4993,7 +4993,7 @@ function route_outgoing_traffic_through_tor {
4993 4993
       iptables -t nat -A PREROUTING -i $_int_if -d $_clearnet -j RETURN
4994 4994
   done
4995 4995
 
4996
-  #redirect all other pre-routing and output to Tor
4996
+  # Redirect all other pre-routing and output to Tor
4997 4997
   iptables -t nat -A OUTPUT -p tcp --syn -j REDIRECT --to-ports $_trans_port
4998 4998
   iptables -t nat -A PREROUTING -i $_int_if -p udp --dport 53 -j REDIRECT --to-ports 53
4999 4999
   iptables -t nat -A PREROUTING -i $_int_if -p tcp --syn -j REDIRECT --to-ports $_trans_port
@@ -5012,21 +5012,23 @@ function route_outgoing_traffic_through_tor {
5012 5012
 
5013 5013
   save_firewall_settings
5014 5014
 
5015
+  if ! grep -q "fs.file-max" /etc/sysctl.conf; then
5016
+	  echo "fs.file-max=100000" >> /etc/sysctl.conf
5017
+	  /sbin/sysctl -p
5018
+  fi
5019
+
5015 5020
   echo 'domain localdomain' > /etc/resolv.conf
5016 5021
   echo 'search localdomain' >> /etc/resolv.conf
5017 5022
   echo 'nameserver 127.0.0.1' >> /etc/resolv.conf
5018 5023
 
5019
-  sed -i 's|VirtualAddrNetworkIPv4*|VirtualAddrNetworkIPv4 10.192.0.0/10|g' /etc/tor/torrc
5020 5024
   if ! grep -q "VirtualAddrNetworkIPv4" /etc/tor/torrc; then
5021 5025
       echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >> /etc/tor/torrc
5022 5026
   fi
5023 5027
 
5024
-  sed -i 's|AutomapHostsOnResolve*|AutomapHostsOnResolve 1|g' /etc/tor/torrc
5025 5028
   if ! grep -q "AutomapHostsOnResolve" /etc/tor/torrc; then
5026 5029
       echo 'AutomapHostsOnResolve 1' >> /etc/tor/torrc
5027 5030
   fi
5028 5031
 
5029
-  sed -i 's|TransPort*|TransPort 9040|g' /etc/tor/torrc
5030 5032
   if ! grep -q "TransPort" /etc/tor/torrc; then
5031 5033
       echo 'TransPort 9040' >> /etc/tor/torrc
5032 5034
   fi
@@ -5039,7 +5041,6 @@ function route_outgoing_traffic_through_tor {
5039 5041
       echo "TransListenAddress $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/tor/torrc
5040 5042
   fi
5041 5043
 
5042
-  sed -i 's|DNSPort*|DNSPort 53|g' /etc/tor/torrc
5043 5044
   if ! grep -q "DNSPort" /etc/tor/torrc; then
5044 5045
       echo 'DNSPort 53' >> /etc/tor/torrc
5045 5046
   fi