Vpn gate для linux

Vpn gate для linux

VPN Gate Linux client for Softether SSL-VPN protocol

Written with bash & node.js for GNOS.

  • Configurable profiles
  • Linux netns isolation
  • Scrap VPN Gate using phantomjs
  • SYN Scan to check servers latency
  • Filtering & Selection using jq
  • Supports both pkexec & sudo
  • Softether SSL-VPN protocol
  • HTTP & SOCKS4 proxy support
  • Managed DHCP: dhclient
  • Automatic dependency installation (Ubuntu)

Profiles are stored in

Profiles files are simple bash declarations.

VPN Gate servers

Variable Default Description
filter ‘true’ jq select() expression
select ‘.»SYN scan (ms)»‘ jq sort_by() expression
mirror «» Alternative Scrapping url

connect replaces Scrapping/Filtering/Scanning/Selecting.

Variable Default Description
connect » Connection string

Default USER_NAME is vpn with empty PASSWORD , default HUB_NAME is vpngate .

Variable Default Description
cmd ‘bash’ Command to execute, or «null» to keep connected
proxy » HTTP proxy
socks » SOCKS proxy

Content is eval -ed so you can write complex commands but beware of security implications:

Also have fun with quoting:

Application defaults overrides

Variable Default Description
cacheSeconds 7200 Scrapping cache validity in seconds
verbose «» Set to -v to force verbose output
reconnect «» Set to -r to force reconnection
update «» Set to -u to disable cache
gui «» Set to -g to enable GUI server selector
mirror «» Scrapping url, read https://bunkerbustervpn.com/vpngate.html
  • Softether vpnclient , integrated with systemd .
  • Softether vpncmd , declared in PATH .
  • Node.js (lts/10), managed by nvm .
  • OPTIONAL, yad for GUI

Put files somewhere, for example /opt/vpngate .

Auto dependencies installation

Tested on latest Ubuntu with NPM configured to run npm install -g without sudo.

This will call pkexec to gain privileges and pull missing dependencies:

Manual dependencies installation

To use sudo instead of default automatic pkexec use this alias:

Set $SUDO_UID to empty to run command as root, not recommended.

VPN Gate Scrapping cache is kept at

VPN Gate Profile cache at

DHCP caches are

JSON array of objects, named data , attributes:

About

🌉 VPN Gate Linux client for Softether SSL-VPN protocol

Источник

Vpn gate для linux

VPN GATE client for linux

  • Be able to connect to open vpn servers at http://www.vpngate.net/en/ directly or through proxy
  • Auto add DNS to fix DNS leak.
  • Auto filter out dead VPN servers.
  • Can execute user defined script after vpn_tunnel is established or broken.

Note: Work on Debian and Redhat based system. Tested on Ubuntu, Raspbian, Fedora, Bunsen . New commit (2020/04/28) fixed it to work with python 3.6+ and only tested on Ubuntu 20.04.

I will wrap SoftEther_vpn later when I have time. You are welcome to fork this repo and wrap SoftEther_vpn yourself.

Indicator: is optional.

Tested on Ubuntu and is only enabled by default on Ubuntu.

For other unix os, you need to modify the run file and install packages below:

If you have any trouble or request about the program, please make a new issue at https://github.com/Dragon2fly/vpngate-with-proxy/issues

  • python 2.7.x 3.6+: should already be shipped with your linux

Except python 2.7.x 3.6+, all below dependencies should be automatically installed at first run.

  • openvpn: $ sudo apt-get install openvpn
  • python-requests: $ sudo apt-get install python-requests
  • python-urwid 1.3+: $ sudo apt-get install python-urwid , for tui version (terminal user interface)
  • wmctrl: $ sudo apt-get install wmctrl , for Indicator of tui version, use for focusing window from indicator.
  • If your network is behind a proxy
  • If you has just installed your os, please update your os for it to fetch packages list and know where to download other packages later.
  • Please check the os clock and calendar if it is correct for openvpn authentication to work properly.

If your network is behind a proxy:

You can also download the zip file It contains the «vpngate-with-proxy» folder. Extract it into anywhere you want eg: $HOME .

user_script:

Within this folder, there should be a file user_script.sh . This file allow you to run extra commands to fit your need. You have to manually edit this file and don’t change the file name. Commands are divided into 2 groups:

  • up: execute after vpn tunnel is established successfully.
  • down: execute after vpn tunnel is broken/terminated.

If you have configured system wide proxy or proxy in firefox, it’d better to turn it off. After vpn tunnel is established, the programs that use system wide proxy may failed to connect to the internet using your proxy.

Launch vpngate-with-proxy by

  • arg could be either none or tui or cli.
  • vpnproxy_tui.py has better UI, colorful and easier to use. Run when arg is none or tui
  • vpnproxy_cli.py is normal terminal application, lightweight and is aim to run on server (RaspberryPi ?). Run when arg is cli

Then the program will first setup a configuration file config.ini by asking you for proxy if needed to connect to the Internet. After that it will show the default configuration of the program. Change any parameter to suit you and press Enter to continue. Next time launching this program, you won’t see this configuration again. Either modify config.ini or check 5. Some notes

If no thing goes wrong, the vpn server’s list will show up.

Connect to a specific vpn server by typing its index number (eg: 3) and then Enter. If nothing went wrong, a successfully message show up.

Your currently chosen server will be highlighted with dark blue color.

All connected servers before the current one is show in dark red color.

Change your desire setting by press the F# key corresponding to that setting. Hit that F# key again to discard all changes and close setting popup. Setting will only be saved when you hit or Enter.

  • F2: Proxy, use http proxy? address? port?
  • F3: DNS, change DNS when connecting to vpn? which dns to change to?
  • F4: Country, looking for a specific country or all that available?
  • F5: Sort by, sort these servers by what parameter?

Vpn command: As you mentioned above, give an index of the server then hit Enter will open a vpn tunnel from your to that server. And there are still some more.

  • r, refresh: fetch new server’s data from vpngate.net or mirrors
  • restore: will restore your system DNS back to original one
  • kill: send SIGTERM to all openvpn processes
  • q: terminate vpn tunnel, then quit the program
  • log: check if current season is logged or not. Log file is vpn.log and is in the same folder with this program. Every time you start the program, log file is rewritten (old content will be lost) if log is turned on.
    • log on: turn on logging
    • log off: turn off logging

Other keys and combinations:

  • Up, Down, PgUp, PgDown: scroll the server list
  • F10 : toggle logging on/off
  • Esc : clear the text in any input form (vpn command, Proxy, Country)
  • Ctrl + F5: the same as r or refresh command
  • Ctrl + r : the same as restore command
  • Ctrl + k : the same as kill command
  • Ctrl + c : if connected to vpn server, terminate vpn tunnel, turn back to normal state. Else, quit the program

4. After VPN Tunnel is established successfully:

A successful connection doesn’t mean you have access to the Internet. If you can access the Internet through selected vpn server, that doesn’t mean you are totally safe.

Check if you can access the Internet: * try browse some websites. Low score VPN servers tend to block you out of the Internet

If you are serious about privacy, this is necessary. DNS server knows the web addresses that you connected to, unless you type IP address directly.

  • Turn on DNS fix by press F3 before connecting to vpn server. Choose some good DNS from http://pcsupport.about.com/od/tipstricks/a/free-public-dns-servers.htm
  • Connect to any VPN server and test if your dns provider is changed.

If DNS is not changed, make sure that you have turned off your system wide proxy and try again. While using the ethernet for vpn, connected to wifi may reset your DNS.

You could also use below command in Ubuntu to see trace route:

  • To view or change settings before the program fetches server’s list, use one of below:

(vpnproxy_cli.py only) To view or change settings at server’s list: type Vpn command c or config then Enter

Ctrl+z: Try not to press this combination while program is running. It will not terminate the vpn tunnel nor kill the program properly. Which means iptable may be left messed up, DNS won’t reset to original, you may be still in vpn.

The program only shows the last log line at the bottom of terminal. In fact, there is 20 last lines of the log. To view these lines, you just need to extend the high of the terminal window.

The log is shown up side down so the latest information will be in the highest place

  • If your terminal looks weird after program crashed or Ctrtl+z , $ reset would help

If the program is unable to fetch new server data nor connect to any vpn server, your networking is not back to normal.

That is when restore , kill and log on command come in handy.

You will need to reset your network setting by:

  1. kill all openvpn processes
  2. $ sudo service network-manager restart

Restart your system or reconnect to wifi or ethernet will also help. If it still doesn’t, your proxy may be offline or \etc\resolv.conf ‘s content is incorrect. Ping your proxy from another computer to test. And double check \etc\resolv.conf

If your network is behind a proxy, there is a chance that your ip will be blocked. Testing if OpenVPN servers are dead or alive requires spamming many socket connection. Although the program has limited the number of socket connection per second, the proxy may think it is being DDoS. Search in the source code for test_interval and increase it a little bit.

If vpn_indicator is unresponsive, kill it by:

For other problems and bugs, please make an issue at https://github.com/Dragon2fly/vpngate-with-proxy/issues. State clearly the OS and what steps that you have taken that lead to the bug.

About

vpn gate client for linux, be able to connect to open vpn server through proxy

Источник

Vpn gate для linux

VPN Gate Client to Free VPN Access. You can get through firewalls and beyond to browse restricted websites.

How to connect to a VPN Gate server:

Expand for VPN Gate Servers List

Expand for Connectable countries

Execute ./vpngate-x86_64.AppImage to get an updated list of connectable countries.

E.g. Korea Republic (KR 🇰🇷 )

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

Frequently Asked Questions:

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.

Retry that country code later or just try another country code (KR 🇰🇷 ).

You can also use the vpngate-x86_64.AppImage utility to fetch the list of connectable countries.

The default USA (US 🇺🇸 ) servers seems to be slow to me, which country is the fastest?

In «my» seat-of-the-pants testing, Japan (JP 🇯🇵 ) or Korea Republic (KR 🇰🇷 ) servers seem to be «faster».

Can I change the default country code?

Yes, you can change the default ISO 3166-2 standard code in the script.

Change Line 21 and Line 45 to the country code (Uppercase) of your choice.

How can I get a list of Connetable countries without goinng to vpngate.net website.

You can use the vpngate-x86_64.AppImage utility to go fetch the connectable list of countries.

Pick one of these free and public DNS Servers.

This is a technical question, WHY Python 2.7. It’s EOL dude! 😕

Haha, The truth is, I didn’t want to fight (choosing my battles😉 with Python3’s bytes to string conversions for this one-off script.

Personally, I compile my legacy Python 2.7 standalone scripts to a Linux ELF 64-bit LSB executable using Nuitka and appimagekit.

The created binary executes independent of a Python installation.

I wrote this as a drop in replacement for the original autovpn written in Go, that’s now in Github’s Digital Haven.

The «2» is to not conflict with the original script if installed on said system.

We are not affiliated with VPN Gate in any way. We are not advocating the use of their or any Free VPN service.

About

OpenVPN VPN Gate Client for Linux, connects you to a random Free VPN in a country of your choice by country code.

Источник

Читайте также:  Как настроить электронный бюджет windows
Оцените статью