# How to configure correctly TOR part 2...the connection has timed out....



## ziomario (Oct 12, 2021)

Hello to everyone.

This is the second attempt to configure correctly tor on FreeBSD 13R. This is how I have configured everything right now :


```
/etc/sysctl.conf
net.inet.ip.random_id=1
```

/etc/rc.conf


```
tor_setuid=YES
tor_enable=YES
```


gedit /usr/local/etc/tor/torrc


```
SocksPort 0
Log notice syslog
ORPort 9090
Nickname ididnteditheconfig
ContactInfo Random Person
ExitRelay 0
#SOCKSPolicy accept 192.168.1.0/16
#SOCKSPolicy accept6 FC00::/7
#SOCKSPolicy reject *
#Address noname.example.com
#OutboundBindAddressExit 10.0.0.4
#OutboundBindAddressOR 10.0.0.5
```

On Firefox :

Manual proxy configuration

```
SOCKS Host : 127.0.0.1:9090 (port 9090 opened on the router admin page)
Proxy DNS when using SOCKS5 = yes
```


```
service tor start
```


```
ps ax | grep tor
1352  -  S       0:13,57 /usr/local/bin/tor -f /usr/local/etc/tor/torrc --PidFile /var/run/tor/tor.pid --RunAsDaemon 1 --DataDirectory /var/db/tor --User _tor
```

When i try to open a website : timeout error. The connection has timed out. what's missing in the configuration ?


----------



## SirDice (Oct 12, 2021)

ziomario said:


> ```
> setuid=YES
> ```


What's this supposed to do in rc.conf?



ziomario said:


> (port 9090 opened on the router admin page)


I'm sorry, what? Don't do this please. You don't need to open this port, nobody from the outside world is supposed to connect to _your_ proxy.


----------



## ziomario (Oct 12, 2021)

ok. closed port 9090 on the router...thanks.

6. Start tor:
Here we set tor to start at boot time and use the setuid feature, in order to bind to lower ports like 443 (the daemon itself will still run as a regular non-privileged user).

sysrc tor_setuid=YES

oh...it's a typo...


----------



## SirDice (Oct 12, 2021)

```
SocksPort 0
```
This disables the SOCKS port. In other words, you disabled the SOCKS proxy you want to use. 


```
ORPort 9090
```
This sets the tor port, which you should only use if you want to become part of the TOR network. But then you should run TOR on an externally accessible IP address, not on 127.0.0.1 (which is only locally accessible on that machine).


----------



## SirDice (Oct 12, 2021)

ziomario said:


> oh...it's a typo...


Yeah, that should have been `tor_setuid`. Don't set it though, that setting just gives me the creeps. I don't see the point of running this on elevated privileges.


----------



## ziomario (Oct 12, 2021)

from here : https://community.torproject.org/relay/setup/guard/freebsd/

4. Configure /usr/local/etc/tor/torrc​This is a very simple version of the torrc configuration file in order to run a Middle/Guard relay on the Tor network:

Nickname    myBSDRelay    # Change your relay's nickname to something you like
ContactInfo your@email    # Please write your email address and be aware that it will be published
ORPort      443           # You might want to use/try a different port, should you want to
ExitRelay   0
---> SocksPort   0


----------



## SirDice (Oct 12, 2021)

ziomario said:


> This is a very simple version of the torrc configuration file in order to run a Middle/Guard relay on the Tor network:


You don't want to become a middle/guard relay on the tor network. You just want to use it as a client proxy to get on the tor network. That's a completely different configuration.


----------



## SirDice (Oct 12, 2021)

It's been a long time since I did anything with TOR but I suspect the default configuration is already properly set up as a SOCKS proxy. So you don't need to configure anything, just enable the service and start it. Just copy /usr/local/etc/tor/torrc.sample to /usr/local/etc/tor/torrc.


----------



## ziomario (Oct 12, 2021)

It's working here. Thanks to your suggestions. For the users who will read this post,the working basic conf file for tor is :


```
SocksPort 9050
Log notice syslog
Nickname ididnteditheconfig
ContactInfo Random Person <email>
ExitRelay 0
```


```
/etc/rc.conf

tor_enable="YES"

/etc/sysctl.conf

net.inet.ip.random_id=1
```

On Firefox :

SOCKS Host : 127.0.0.1:9090
Proxy DNS when using SOCKS5 = yes


----------



## dd_ff_bb (Oct 12, 2021)

ziomario said:


> It works only if I set the SOCKS5 proxy on the firefox network configuration to 127.0.0.1.



He was referring to tor side of configuration not client side.


----------

