When you use the Tor browser to browse the web, all traffic to the internet is redirected through a series of IP addresses spread across multiple countries around the world. This mechanism is perfect for hiding your real position from prying eyes. However, it doesn't help if you're trying to visit a specific website that only accepts inbound connections from a certain country. If you need the website in question to think that your connection is coming from a specific country, you can edit the Tor configuration file by manually adding the input and output nodes of the network connection. To keep the location from which you are connecting to the web private, it's best to use a VPN server, but Tor can be a great solution to this problem if you don't have a VPN connection available. This article explains how to set up a specific entry and exit node that the web browser will need to use to connect to the web on Windows, macOS and Linux.
Steps
Step 1. Start Tor at least once
To modify the Tor configuration file, the program must be started at least once so that the file is created automatically by the browser. Simply double click on the icon Start Tor browser present in the program installation folder, then click on the button Connect.
- If you have already started Tor, close it. To be able to modify the configuration file effectively, the program must not be running.
- It should be noted that not all websites and countries in the world allow the use of Tor as an internet browser, so in some cases you will not be able to access certain web pages using this browser.
Step 2. Navigate to the Tor installation folder
If you are using Windows or Linux, the path of the directory in question varies according to the installation point that has been chosen. If you are using a Mac instead, you will need to access a different folder:
-
Windows and Linux:
Tor's default installation folder is the desktop for both operating systems. Double-click the folder Tor Browser to access it.
-
Mac:
open a Finder window, press the key combination Command + Shift + G, then type or paste the following address into the text field that appears: ~ / Library / Application Support / TorBrowser-Data. Click on the button Go to have access to the indicated folder.
Step 3. Navigate to the folder that contains the "torrc" file
This is the Tor configuration file that you need to manually edit. Follow these instructions:
-
Windows and Linux:
double click on the folder Browser, double-click the folder TorBrowser, double-click the folder Date and finally double click on the folder Tor.
-
Mac:
double click on the folder Tor.
Step 4. Open the file named torrc using a text editor
Double-click on the file in question. If it doesn't open automatically using a text editor, you'll be prompted to choose the app to use (for example Block notes on Windows or TextEdit on Mac).
Step 5. Add the new line of text
EntryNodes
.
Place the text cursor under the last line of the file, then type the following text EntryNodes {} StrictNodes 1 and press the key Enter to create a new line at the end of the document.
Performing this step may not be necessary if you only need to create a node of exit specific that corresponds to the IP address that will be shown to all the websites and internet services to which you connect.
Step 6. Add the line of text
ExitNodes
.
Type the following text
ExitNodes {} StrictNodes 1
in the new line you just created.
Step 7. Find the country code you want to use as the entry and exit point for the Tor network connection
Visit the URL https://www.iso.org/obp/ui/#search using a web browser, then take note of the two-digit numeric code that identifies the country you want to use for the connection. If you wish, you can use multiple countries.
- For example, if you want Tor to use Canada as an entry node to the web and Egypt as an exit node, you will need to identify the identification codes of Canada ("ca") and Egypt ("eg").
- Not all countries have an entry and exit node for Tor, so after identifying the identification code of the country or countries you want to use, visit https://metrics.torproject.org/rs.html, type the country command: eg (replace the eg code with the one of the country you have chosen or want to search for) and click on the button Search to check if there is a Tor server in the country in question.
Step 8. Insert in the file the identification code of the country that you will use as an entry and exit node
Type it in the file, enclosing it in braces {}, to the right of the "EntryNodes" line, then repeat the step for the "ExitNodes" entry. For example, if the entry node is in Canada and the exit node is in Egypt, you will need to enter the following text in the file:
-
EntryNodes {ca} StrictNodes 1
-
ExitNodes {eg} StrictNodes 1
Step 9. Consider not using so-called "strict" nodes
The "StrictNodes 1" parameter instructs Tor to use only the nodes you specified in the file. However, this operating mode is limiting, since if no active nodes are available in the country indicated, the program will not be able to establish a connection. If you wish, you can substitute the parameter
StrictNodes 1
with the value
StrictNodes 0
to make sure that Tor can still establish an internet connection using servers in other countries, in case the one specified is not reachable.
Step 10. If you are using a "strict" node, add more countries
If you still want to force Tor to only use nodes in the specified country, consider adding more countries, rather than limiting yourself to just one. To add other countries, simply enter the codes of the desired countries in the line of text by enclosing them in curly brackets and separating them from each other with commas. For example, if you want to use Canada, Egypt and Turkey as "ExitNodes", you will need to enter the following line of text in the file:
-
ExitNodes {ca}, {eg}, {tr} StrictNodes 1
Make sure there are no gaps between country codes enclosed in curly brackets
Step 11. Save the file and close the text editor
If you are using a Windows PC or a Mac, simply access the menu File, select the item Save, then close the program. If you are using a Linux computer, the procedure to follow will depend on the program you are using. If you are using a graphics editor, you should be able to save the file simply by pressing the key combination Ctrl + S.
Advice
- If you are having connection problems with certain websites, click on the button to access the Tor menu located in the upper right corner of the window and choose the option New Tor Circuit for this site.
- If an ingress or egress node does not accept connections on the port you specified (for example port 443, if you are using the HTTPS protocol), you will not be able to access specific websites.
- Changing the entry and exit node of a specific country can give you access to the content of a website that is restricted to certain geographic areas, but it could also prevent Tor from protecting your anonymity efficiently. If you just need to watch videos, this specification might not bother you. Conversely, if you need to browse the web completely anonymously, the Tor developers recommend using the default settings.
- The safest way to hide where you are connecting to the internet is to use a VPN server. In this way you can from time to time choose the country from which to access the web.