The Vagrant project will provision VM with configured VPN openconnect connection and SOCKS5 proxy for this connection
- Clone this repository
git clone https://github.com/jsporna/vagrant-vpn-openconnect-socks5-proxy.git
- Change into the
vagrant-vpn-openconnect-socks5-proxy
directory - Run
vagrant up; vagrant ssh -c 'vpn-up'
VPN Connection is up and SOCKS proxy listen on localhost:1080
-
curl
curl -x socks5://localhost:1080 ifconfig.co
-
firefox
-
create new profile using browser: in new tab enter
about:profiles
or create new profile using Profile Manager: runfirefox --ProfileManger
-
in new profile setup proxy: in new tab enter
about:preferences
and go to Network Settings -
check Manual proxy configuration and fill up SOCKS Host with
localhost
and Port with1080
-
check Proxy DNS when using SOCKS v5
-
-
google-chrome
google-chrome --proxy-server='socks://127.0.0.1:1080 &
The Vagrant projecxt can be uses as-is; there are a couple of parameters you have to set up installation.
There are several ways to set parameters:
- Update the Vagrantfile. This is straightforward; the downside is that you will loose changes when you update this repository.
- Use environment variables. Might be difficult to remember the parameters used when the VM was instantiated.
- Use the
.env
/.env.local
files (requires vagrant-env plugin). Configure your VPN connection by editing the.env
file; or better copy.env
to.env.local
and edit the latter one, it won't be overridden when you update this repository and it won't mark your git tree as changed (you won't accidentally commit your local configuration!)
Parameters are considered in the following order (first one wins):
- Environment variables
.env.local
(if vagrant-env plugin is installed).env
(if vagrant-env plugin is installed)- Vagrantfile definitions
VPN_GATEWAY
: VPN gatewayVPN_PROTOCOL
: VPN connection protocolVPN_USER
: VPN usernameVPN_PASSWORD
: VPN user password
When installed, this Vagrant project will make use of the following third party Vagrant plugins:
- vagrant-env: loads environment variables from .env files
- vagrant-exec: allow in userfriendly way run scripts in Vagrant VM
To install Vagrant plugins run:
vagrant plugin install <name>...
Please provide feedback of any kind via Github issues on this repository.