Skip to content

Instantly share code, notes, and snippets.

@louy2
Created December 31, 2015 07:23
Show Gist options
  • Save louy2/0491026175fb6f9aaf8a to your computer and use it in GitHub Desktop.
Save louy2/0491026175fb6f9aaf8a to your computer and use it in GitHub Desktop.
Vagrantfile for a Ubuntu box bridging an OpenVPN via Shadowsocks
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "public_network", bridge: "<name of network interface>"
config.vm.provision "shell", inline: <<-INSTALL
apt-get -y update
apt-get -y -q install openvpn python-pip
pip install shadowsocks
INSTALL
config.vm.provision "shell", inline: <<-SHELL
echo "nameserver 8.8.8.8\n" | sudo tee -a /etc/resolvconf/resolv.conf.d/head
SHELL
config.vm.network "forwarded_port", guest: 443, host: 44343
config.vm.provision "shell", run: "always", inline: <<-SHADOW
openvpn --daemon --config <path/to/openvpn/config>
ssserver -p 443 -k <password> -m <encryption method> -d start
SHADOW
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment