0
  1. I created a new ubuntu 22.04 lts instance in linode
  2. install tor apt install tor
  3. create new torrc file with only one line
    echo "ExitNodes {us} StrictNodes 1" > torrc
  4. use this file to start tor
    tor -f ./torrc &
    logs:
May 13 13:00:44.983 [notice] Tor 0.4.6.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.2, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.4.8 and Glibc 2.35 as libc.
May 13 13:00:44.983 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/
May 13 13:00:44.983 [notice] Read configuration file "/root/./torrc".
May 13 13:00:44.986 [notice] Opening Socks listener on 127.0.0.1:9050
May 13 13:00:44.986 [notice] Opened Socks listener connection (ready) on 127.0.0.1:9050
May 13 13:00:44.000 [notice] Parsing GEOIP IPv4 file /usr/share/tor/geoip.
May 13 13:00:45.000 [notice] Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
May 13 13:00:45.000 [warn] You are running Tor as root. You don't need to, and you probably shouldn't.
May 13 13:00:45.000 [notice] Bootstrapped 0% (starting): Starting
May 13 13:00:45.000 [notice] Starting with guard context "default"
May 13 13:00:46.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
May 13 13:00:46.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
May 13 13:00:46.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
May 13 13:00:46.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
May 13 13:00:46.000 [notice] Bootstrapped 20% (onehop_create): Establishing an encrypted directory connection
May 13 13:00:47.000 [notice] Bootstrapped 25% (requesting_status): Asking for networkstatus consensus
May 13 13:00:47.000 [notice] Bootstrapped 30% (loading_status): Loading networkstatus consensus
May 13 13:00:48.000 [notice] I learned some more directory information, but not enough to build a circuit: We have no usable consensus.
May 13 13:00:48.000 [notice] Bootstrapped 40% (loading_keys): Loading authority key certs
May 13 13:00:48.000 [notice] The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services.
May 13 13:00:48.000 [notice] Bootstrapped 45% (requesting_descriptors): Asking for relay descriptors
May 13 13:00:48.000 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 0/7088, and can only build 0% of likely paths. (We have 0% of guards bw, 0% of midpoint bw, and 0% of end bw (no exits in consensus, using mid) = 0% of path bw.)
May 13 13:00:49.000 [notice] Bootstrapped 50% (loading_descriptors): Loading relay descriptors
May 13 13:00:49.000 [notice] The current consensus contains exit nodes. Tor can build exit and internal paths.
May 13 13:00:50.000 [notice] Bootstrapped 55% (loading_descriptors): Loading relay descriptors
May 13 13:00:50.000 [notice] Bootstrapped 60% (loading_descriptors): Loading relay descriptors
May 13 13:00:50.000 [notice] Bootstrapped 70% (loading_descriptors): Loading relay descriptors
May 13 13:00:50.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
May 13 13:00:51.000 [notice] Bootstrapped 80% (ap_conn): Connecting to a relay to build circuits
May 13 13:00:51.000 [notice] Bootstrapped 85% (ap_conn_done): Connected to a relay to build circuits
May 13 13:00:51.000 [notice] Bootstrapped 89% (ap_handshake): Finishing handshake with a relay to build circuits
May 13 13:00:51.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
May 13 13:00:51.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
May 13 13:00:52.000 [notice] Bootstrapped 100% (done): Done

5.test:

root@localhost:~# curl -x socks5h://localhost:9050 ipinfo.io/country
LU
root@localhost:~# killall -HUP tor
May 13 13:01:46.000 [notice] Received reload signal (hup). Reloading config and resetting internal state.
May 13 13:01:46.000 [notice] Read configuration file "/root/./torrc".
root@localhost:~# curl -x socks5h://localhost:9050 ipinfo.io/country
US
root@localhost:~# killall -HUP tor
May 13 13:01:55.000 [notice] Received reload signal (hup). Reloading config and resetting internal state.
May 13 13:01:55.000 [notice] Read configuration file "/root/./torrc".
root@localhost:~# curl -x socks5h://localhost:9050 ipinfo.io/country
LU
  1. As you see, the IPs I got are random in US or LU, the ExitNodes configure didn't worked. I am so confused , can any body help me to find anything wrong?
1
  • Are you sure that this ipinfo.io and tor are using the same geoip database? Otherwise they may disagree with what country the exit relay is in. Also StrictNodes does not apply to ExitNodes.
    – Steve
    May 17 at 16:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.