https://github.com/ruped24/autovpn2
OpenVPN VPN Gate Client for Linux, connects you to a random Free VPN in a country of your choice by country code.
https://github.com/ruped24/autovpn2
anonymous anonymous-proxy openvpn-client vpn vpn-client vpn-gateway vpn-relay zero-configuration zero-knowledge
Last synced: 7 months ago
JSON representation
OpenVPN VPN Gate Client for Linux, connects you to a random Free VPN in a country of your choice by country code.
- Host: GitHub
- URL: https://github.com/ruped24/autovpn2
- Owner: ruped24
- Created: 2020-05-13T21:32:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T12:11:30.000Z (over 2 years ago)
- Last Synced: 2024-02-14T21:35:24.737Z (almost 2 years ago)
- Topics: anonymous, anonymous-proxy, openvpn-client, vpn, vpn-client, vpn-gateway, vpn-relay, zero-configuration, zero-knowledge
- Language: Python
- Homepage:
- Size: 126 KB
- Stars: 39
- Watchers: 3
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-discoveries - autovpn2 - connect to random VPN servers from vpngate.net in a selected country _(`Python`)_ (DevOps Utilities)
README
# autovpn2
   [](http://www.wtfpl.net/) [](https://github.com/ruped24/autovpn2/graphs/commit-activity)
[VPN Gate](https://www.vpngate.net/en/) OpenVPN 2.4 Client to Free VPN Access. You can get through firewalls and beyond to browse restricted websites.
---
### Usage:
```bash
sudo autovpn2 KR
```
Expand for usage
**How to connect to a VPN Gate server:**
Expand for VPN Gate Servers List
[► **vpngate-x86_64.AppImage**](https://github.com/ruped24/autovpn2/releases/tag/v1.0)
Expand for Connectable countries
Execute ` ./vpngate-x86_64.AppImage` to get an updated list of connectable countries.
```
[?] Fetching vpngate servers
[+] Parsing servers response
Connectable countries
JP) Japan KR) Korea Republic of
TH) Thailand TW) Taiwan
US) United States VN) Viet Nam
```
[► **VPN Gate Servers List**](https://www.vpngate.net/en/)
_E.g._ Korea Republic (**KR** [:kr:](https://en.wikipedia.org/wiki/South_Korea))
To **start** the VPN: _E.g._ ` sudo autovpn2 KR`
To **stop** the VPN: Press CTRL + c
The _autovpn2_ script will ask if you want to try another VPN.
If you want to retry another VPN, then press y, if you want to quit, press n
***
Expand for ISO 3166 country codes
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
***
Expand for screenshot, demo and test
[▹ Check My IPx](https://ipx.ac/)
[▹ Anonymity check](http://proxydb.net/anon)
[▹ What is my proxy](http://www.whatismyproxy.com)
[▹ DNS leak test](https://dnsleaktest.com/)
:white_square_button: **|** [**Screenshot**](https://drive.google.com/file/d/10oEKydkW7YzZFK7VLOvAzz3HSzSIoED4/view?usp=sharing) **|** [**Demo**](https://drive.google.com/file/d/16VfJfKZqqR0RYzVxmPgfhGNKwsuYHVph/view?usp=sharing) **|**
---
### Dependencies:
```bash
apt install openvpn
```
---
### Installation:
```bash
sudo mv autovpn2.py /usr/local/bin/autovpn2
```
---
### Frequently Asked Questions:
Expand for Frequently Asked Questions
### FAQ:
> Why do I get this missing cipher error message below:
`2024-10-11 20:51:59 DEPRECATED OPTION: --cipher set to 'AES-128-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations.
2024-10-11 20:51:59 Note: Kernel support for ovpn-dco missing, disabling data channel offload.
2024-10-11 20:51:59 OpenVPN 2.6.9 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO]
2024-10-11 20:51:59 library versions: OpenSSL 3.2.2-dev , LZO 2.10
2024-10-11 20:51:59 DCO version: N/A
2024-10-11 20:51:59 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
`
VPNGate and autovpn2 client works with OpenVPN 2.4 cipher ['AES-128-CBC'](https://drive.google.com/file/d/1YhjYiK5RFTU1fJgGe5rV_LoOr8b3fkaX/view?usp=sharing)
The Fix is to fallback from 2.6.x to 2.4.x :(
> Why do I sometimes get **`[autovpn2] rewriting config file`** stuck in a loop when I use country code JP?
The parser got a bad or corrupt config file for said country from the servers CSV List.
You can also use the [vpngate-x86_64.AppImage](https://github.com/ruped24/autovpn2/releases/tag/v1.0) utility to fetch the list of connectable countries.
> The default USA (**US** [:us:](https://en.wikipedia.org/wiki/United_States)) servers seems to be slow to me, which country is the fastest?
In "my" seat-of-the-pants testing, Japan (**JP** [:jp:](https://en.wikipedia.org/wiki/Japan)) or Korea Republic (**KR** [:kr:](https://en.wikipedia.org/wiki/South_Korea)) servers seem to be "faster".
> Can I change the default country code?
Yes, you can change the default [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard code in the script.
Change Line [21](https://github.com/ruped24/autovpn2/blob/80782a993fafc99a2b8eb67861f15bf654cef594/autovpn2.py#L21) and
Line [45](https://github.com/ruped24/autovpn2/blob/80782a993fafc99a2b8eb67861f15bf654cef594/autovpn2.py#L45) to the country code (Uppercase) of your choice.
> How can I get a list of Connetable countries without goinng to [vpngate.net](https://www.vpngate.net/en/) website.
You can use the [vpngate-x86_64.AppImage](https://github.com/ruped24/autovpn2/releases/tag/v1.0) utility to go fetch the connectable list of countries.
> How to fix my DNS leak?
Pick one of these free and public [DNS](https://www.lifewire.com/free-and-public-dns-servers-2626062) Servers.
> This is a technical question, WHY Python 2.7???! It's [EOL](https://www.python.org/dev/peps/pep-0373/#maintenance-releases) dude! :confused:
Haha, The truth is, I didn't want to fight (_choosing my battles_;) with [Python3](https://www.pythonconverter.com/)'s bytes to string conversions for this [_one-off_](http://www.wtfpl.net) script.
Personally, I compile my legacy Python 2.7 standalone scripts to a Linux ELF 64-bit LSB executable using [Nuitka](https://nuitka.net/doc/user-manual.html) and [Appimagekit](https://appimage.org).
The created binary executes independent of a Python installation.
A [precompiled x86_64 autovpn2 binary](https://github.com/ruped24/autovpn2/releases/tag/v1.0) can be found under releases.
> What's with the name and the "2"?
I wrote this as a drop in replacement for the original [autovpn](https://en.kali.tools/?p=418) written in [Go](https://en.wikipedia.org/wiki/Go_(programming_language)), that's now in Github's [Digital Haven](https://github.com/adtac/autovpn).
The "2" is to not conflict with the original script if installed on said system.
```diff
- Note: autovpn2 defaults to the US servers. The Japan or Korea (JP, KR) servers are preferred.
```
---
#### Legal Disclaimer:
###### We are not affiliated with [VPN Gate](https://www.vpngate.net/en/) in any way. We are not advocating the use of their or any Free VPN service.