[TOR] How to control routing by choosing preferred countries.

Discussion in 'Application Software' started by Yen, May 25, 2018.

  1. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    11,208
    11,001
    340
    Hi,

    when using TOR you might want to have control about where your TOR route should start and where it should end and which countries you do want to exclude for routing.

    There is a config file named torrc which is suitable for this to control.

    Important are the Nodes and far more the ExitNodes. (Where you leave to enter the internet and get your IP address).

    Each country has got a country code:

    Code:
    Country                               Code
    ASCENSION ISLAND                      {ac}
    AFGHANISTAN                           {af}
    ALAND                                 {ax}
    ALBANIA                               {al}
    ALGERIA                               {dz}
    ANDORRA                               {ad}
    ANGOLA                                {ao}
    ANGUILLA                              {ai}
    ANTARCTICA                            {aq}
    ANTIGUA AND BARBUDA                   {ag}
    ARGENTINA REPUBLIC                    {ar}
    ARMENIA                               {am}
    ARUBA                                 {aw}
    AUSTRALIA                             {au}
    AUSTRIA                               {at}
    AZERBAIJAN                            {az}
    BAHAMAS                               {bs}
    BAHRAIN                               {bh}
    BANGLADESH                            {bd}
    BARBADOS                              {bb}
    BELARUS                               {by}
    BELGIUM                               {be}
    BELIZE                                {bz}
    BENIN                                 {bj}
    BERMUDA                               {bm}
    BHUTAN                                {bt}
    BOLIVIA                               {bo}
    BOSNIA AND HERZEGOVINA                {ba}
    BOTSWANA                              {bw}
    BOUVET ISLAND                         {bv}
    BRAZIL                                {br}
    BRITISH INDIAN OCEAN TERR             {io}
    BRITISH VIRGIN ISLANDS                {vg}
    BRUNEI DARUSSALAM                     {bn}
    BULGARIA                              {bg}
    BURKINA FASO                          {bf}
    BURUNDI                               {bi}
    CAMBODIA                              {kh}
    CAMEROON                              {cm}
    CANADA                                {ca}
    CAPE VERDE                            {cv}
    CAYMAN ISLANDS                        {ky}
    CENTRAL AFRICAN REPUBLIC              {cf}
    CHAD                                  {td}
    CHILE                                 {cl}
    PEOPLE'S REPUBLIC OF CHINA            {cn}
    CHRISTMAS ISLANDS                     {cx}
    COCOS ISLANDS                         {cc}
    COLOMBIA                              {co}
    COMORAS                               {km}
    CONGO                                 {cg}
    CONGO (DEMOCRATIC REPUBLIC)           {cd}
    COOK ISLANDS                          {ck}
    COSTA RICA                            {cr}
    COTE D IVOIRE                         {ci}
    CROATIA                               {hr}
    CUBA                                  {cu}
    CYPRUS                                {cy}
    CZECH REPUBLIC                        {cz}
    DENMARK                               {dk}
    DJIBOUTI                              {dj}
    DOMINICA                              {dm}
    DOMINICAN REPUBLIC                    {do}
    EAST TIMOR                            {tp}
    ECUADOR                               {ec}
    EGYPT                                 {eg}
    EL SALVADOR                           {sv}
    EQUATORIAL GUINEA                     {gq}
    ESTONIA                               {ee}
    ETHIOPIA                              {et}
    FALKLAND ISLANDS                      {fk}
    FAROE ISLANDS                         {fo}
    FIJI                                  {fj}
    FINLAND                               {fi}
    FRANCE                                {fr}
    FRANCE METROPOLITAN                   {fx}
    FRENCH GUIANA                         {gf}
    FRENCH POLYNESIA                      {pf}
    FRENCH SOUTHERN TERRITORIES           {tf}
    GABON                                 {ga}
    GAMBIA                                {gm}
    GEORGIA                               {ge}
    GERMANY                               {de}
    GHANA                                 {gh}
    GIBRALTER                             {gi}
    GREECE                                {gr}
    GREENLAND                             {gl}
    GRENADA                               {gd}
    GUADELOUPE                            {gp}
    GUAM                                  {gu}
    GUATEMALA                             {gt}
    GUINEA                                {gn}
    GUINEA-BISSAU                         {gw}
    GUYANA                                {gy}
    HAITI                                 {ht}
    HEARD & MCDONALD ISLAND               {hm}
    HONDURAS                              {hn}
    HONG KONG                             {hk}
    HUNGARY                               {hu}
    ICELAND                               {is}
    INDIA                                 {in}
    INDONESIA                             {id}
    IRAN, ISLAMIC REPUBLIC OF             {ir}
    IRAQ                                  {iq}
    IRELAND                               {ie}
    ISLE OF MAN                           {im}
    ISRAEL                                {il}
    ITALY                                 {it}
    JAMAICA                               {jm}
    JAPAN                                 {jp}
    JORDAN                                {jo}
    KAZAKHSTAN                            {kz}
    KENYA                                 {ke}
    KIRIBATI                              {ki}
    KOREA, DEM. PEOPLES REP OF            {kp}
    KOREA, REPUBLIC OF                    {kr}
    KUWAIT                                {kw}
    KYRGYZSTAN                            {kg}
    LAO PEOPLE'S DEM. REPUBLIC            {la}
    LATVIA                                {lv}
    LEBANON                               {lb}
    LESOTHO                               {ls}
    LIBERIA                               {lr}
    LIBYAN ARAB JAMAHIRIYA                {ly}
    LIECHTENSTEIN                         {li}
    LITHUANIA                             {lt}
    LUXEMBOURG                            {lu}
    MACAO                                 {mo}
    MACEDONIA                             {mk}
    MADAGASCAR                            {mg}
    MALAWI                                {mw}
    MALAYSIA                              {my}
    MALDIVES                              {mv}
    MALI                                  {ml}
    MALTA                                 {mt}
    MARSHALL ISLANDS                      {mh}
    MARTINIQUE                            {mq}
    MAURITANIA                            {mr}
    MAURITIUS                             {mu}
    MAYOTTE                               {yt}
    MEXICO                                {mx}
    MICRONESIA                            {fm}
    MOLDAVA REPUBLIC OF                   {md}
    MONACO                                {mc}
    MONGOLIA                              {mn}
    MONTENEGRO                            {me}
    MONTSERRAT                            {ms}
    MOROCCO                               {ma}
    MOZAMBIQUE                            {mz}
    MYANMAR                               {mm}
    NAMIBIA                               {na}
    NAURU                                 {nr}
    NEPAL                                 {np}
    NETHERLANDS ANTILLES                  {an}
    NETHERLANDS, THE                      {nl}
    NEW CALEDONIA                         {nc}
    NEW ZEALAND                           {nz}
    NICARAGUA                             {ni}
    NIGER                                 {ne}
    NIGERIA                               {ng}
    NIUE                                  {nu}
    NORFOLK ISLAND                        {nf}
    NORTHERN MARIANA ISLANDS              {mp}
    NORWAY                                {no}
    OMAN                                  {om}
    PAKISTAN                              {pk}
    PALAU                                 {pw}
    PALESTINE                             {ps}
    PANAMA                                {pa}
    PAPUA NEW GUINEA                      {pg}
    PARAGUAY                              {py}
    PERU                                  {pe}
    PHILIPPINES (REPUBLIC OF THE)         {ph}
    PITCAIRN                              {pn}
    POLAND                                {pl}
    PORTUGAL                              {pt}
    PUERTO RICO                           {pr}
    QATAR                                 {qa}
    REUNION                               {re}
    ROMANIA                               {ro}
    RUSSIAN FEDERATION                    {ru}
    RWANDA                                {rw}
    SAMOA                                 {ws}
    SAN MARINO                            {sm}
    SAO TOME/PRINCIPE                     {st}
    SAUDI ARABIA                          {sa}
    SCOTLAND                              {uk}
    SENEGAL                               {sn}
    SERBIA                                {rs}
    SEYCHELLES                            {sc}
    SIERRA LEONE                          {sl}
    SINGAPORE                             {sg}
    SLOVAKIA                              {sk}
    SLOVENIA                              {si}
    SOLOMON ISLANDS                       {sb}
    SOMALIA                               {so}
    SOMOA,GILBERT,ELLICE ISLANDS          {as}
    SOUTH AFRICA                          {za}
    SOUTH GEORGIA, SOUTH SANDWICH ISLANDS {gs}
    SOVIET UNION                          {su}
    SPAIN                                 {es}
    SRI LANKA                             {lk}
    ST. HELENA                            {sh}
    ST. KITTS AND NEVIS                   {kn}
    ST. LUCIA                             {lc}
    ST. PIERRE AND MIQUELON               {pm}
    ST. VINCENT & THE GRENADINES          {vc}
    SUDAN                                 {sd}
    SURINAME                              {sr}
    SVALBARD AND JAN MAYEN                {sj}
    SWAZILAND                             {sz}
    SWEDEN                                {se}
    SWITZERLAND                           {ch}
    SYRIAN ARAB REPUBLIC                  {sy}
    TAIWAN                                {tw}
    TAJIKISTAN                            {tj}
    TANZANIA, UNITED REPUBLIC OF          {tz}
    THAILAND                              {th}
    TOGO                                  {tg}
    TOKELAU                               {tk}
    TONGA                                 {to}
    TRINIDAD AND TOBAGO                   {tt}
    TUNISIA                               {tn}
    TURKEY                                {tr}
    TURKMENISTAN                          {tm}
    TURKS AND CALCOS ISLANDS              {tc}
    TUVALU                                {tv}
    UGANDA                                {ug}
    UKRAINE                               {ua}
    UNITED ARAB EMIRATES                  {ae}
    UNITED KINGDOM (no new registrations) {gb}
    UNITED KINGDOM                        {uk}
    UNITED STATES                         {us}
    UNITED STATES MINOR OUTL.IS.          {um}
    URUGUAY                               {uy}
    UZBEKISTAN                            {uz}
    VANUATU                               {vu}
    VATICAN CITY STATE                    {va}
    VENEZUELA                             {ve}
    VIET NAM                              {vn}
    VIRGIN ISLANDS (USA)                  {vi}
    WALLIS AND FUTUNA ISLANDS             {wf}
    WESTERN SAHARA                        {eh}
    YEMEN                                 {ye}
    ZAMBIA                                {zm}
    ZIMBABWE                              {zw}
    INFO: Use capital country letters, some say it has to be capital.

    What you need:

    Specify the exit nodes you want to use: (Example)
    Code:
    ExitNodes {CH},{RU},{UA}
    StrictNodes 1
    You want to have Switzerland, Russia and Ukraine as countries from where you get your IP to enter the internet.
    Add StrictNodes 1 command.

    You want to have nodes excluded: (Example)
    Code:
    ExcludeNodes {FR},{DE},{US},{UK}
    This excludes France, Germany, US and the UK to be Nodes on your route.


    You want to have Exit Nodes excluded: (Example). THIS is the country you leave and enter the internet.
    Code:
    ExcludeExitNodes {US},{AU},{CA},{NZ},{GB},{FR},{DE},{UK}
    This means you do NOT get an IP address from the following countries:

    US, Australia, Canada, New Zealand, Great Britain, France, Germany, United Kingdom.

    Locate your torrc file of your TOR installation. The location depends on the OS and the kind of installation. If you don't find it search for it. Part of the path is usually TorBrowser/Data/Tor/ or on windows username\Application Data\tor\log\ or \Application Data\tor\log\

    Open it with an text editor and add the commands with your preferred routing. Separate your countries with a comma.:)

    When saving your edited torrc file make sure you do not add an extension like dot txt or something. Leave it original.
    At Linux use the plain text editor, at windows notepad++
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. m14lovely

    m14lovely MDL Novice

    Mar 26, 2018
    5
    2
    0
  3. ThomasMann

    ThomasMann MDL Addicted

    Dec 31, 2015
    936
    146
    30
    When you avoid the suspect countries as a first contact, does the second server, even if it is in the US, actually have a possibility to get the original ISP?

    Plus, I am always puzzled by one thing.
    Clearly, the fastest speed you will get when you use a VPN in the country you actually are, any speed test will show that.

    Now, intuitivly this it not done, is there and actual reason for this? There are of course some countries like US, Australia, Canada, New Zealand, Great Britain, France, Germany, United Kingdom, where one better not risk it. But when you are f.e. in Switzerland is there a FACTUAL REASON not to use a VPN server in your country?